head.ejs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE html>
  2. <html lang="<%=config.language.substring(0, 2) %>">
  3. <head>
  4. <meta charset="utf-8">
  5. <%
  6. function capitalize (str) { return str.charAt(0).toUpperCase() + str.substring(1).toLowerCase() }
  7. var title = page.title;
  8. if (is_archive()) {
  9. title = capitalize(__('index.archive'));
  10. if (is_month()) {
  11. title += ': ' + page.year + '/' + page.month;
  12. } else if (is_year()) {
  13. title += ': ' + page.year;
  14. }
  15. } else if (is_category()) {
  16. title = capitalize(__('index.category')) + ': ' + page.category;
  17. } else if (is_tag()) {
  18. title = capitalize(__('index.tag')) + ': ' + page.tag;
  19. }
  20. %>
  21. <title><% if (title) { %><%= title %> | <% } %><%= config.title %></title>
  22. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  23. <%- open_graph({
  24. image: thumbnail(page),
  25. fb_app_id: theme.miscellaneous.open_graph.fb_app_id,
  26. fb_admins: theme.miscellaneous.open_graph.fb_admins,
  27. twitter_id: theme.miscellaneous.open_graph.twitter_id,
  28. google_plus: theme.miscellaneous.open_graph.google_plus,
  29. }) %>
  30. <%- meta(page) %>
  31. <% if (theme.rss) { %>
  32. <link rel="alternative" href="<%- theme.rss %>" title="<%= config.title %>" type="application/atom+xml" />
  33. <% } %>
  34. <% if (theme.customize.favicon) { %>
  35. <link rel="icon" href="<%- url_for(theme.customize.favicon) %>" />
  36. <% } %>
  37. <%- css('vendor/font-awesome/css/font-awesome.min') %>
  38. <%- css('vendor/open-sans/styles') %>
  39. <%- css('vendor/source-code-pro/styles') %>
  40. <%- css('css/style') %>
  41. <%- js('vendor/jquery/2.1.3/jquery.min') %>
  42. <%- partial('plugin/scripts', { isHead: true }) %>
  43. </head>