Build a beautiful and simple website in literally minutes. Demo at http://deanattali.com/beautiful-jekyll
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.6 KiB

9 years ago
9 years ago
9 years ago
9 years ago
8 years ago
8 years ago
8 years ago
  1. <head>
  2. <meta charset="utf-8" />
  3. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  5. <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
  6. <meta name="author" content="{{ site.author.name }}" />
  7. {% if page.subtitle %}
  8. <meta name="description" content="{{ page.subtitle }}">
  9. {% endif %}
  10. {% if layout.common-ext-css %}
  11. {% for css in layout.common-ext-css %}
  12. <link rel="stylesheet" href="{{ css }}" />
  13. {% endfor %}
  14. {% endif %}
  15. {% if layout.common-css %}
  16. {% for css in layout.common-css %}
  17. <link rel="stylesheet" href="{{ css | replace: '//', '/' }}" />
  18. {% endfor %}
  19. {% endif %}
  20. {% if layout.common-googlefonts %}
  21. {% for font in layout.common-googlefonts %}
  22. <link rel="stylesheet" href="//fonts.googleapis.com/css?family={{ font }}" />
  23. {% endfor %}
  24. {% endif %}
  25. {% if page.ext-css %}
  26. {% for css in page.ext-css %}
  27. <link rel="stylesheet" href="{{ css }}" />
  28. {% endfor %}
  29. {% endif %}
  30. {% if page.css %}
  31. {% for css in page.css %}
  32. <link rel="stylesheet" href="{{ css | replace: '//', '/' }}" />
  33. {% endfor %}
  34. {% endif %}
  35. {% if page.googlefonts %}
  36. {% for font in page.googlefonts %}
  37. <link rel="stylesheet" href="//fonts.googleapis.com/css?family={{ font }}" />
  38. {% endfor %}
  39. {% endif %}
  40. {% if page.meta-title %}
  41. <meta property="og:title" content="{{ page.meta-title }}" />
  42. {% elsif page.title %}
  43. <meta property="og:title" content="{{ page.title }}" />
  44. {% else %}
  45. <meta property="og:title" content="{{ site.title }}" />
  46. {% endif %}
  47. {% if page.meta-description %}
  48. <meta property="og:description" content="{{ page.meta-description }}">
  49. {% elsif page.subtitle %}
  50. <meta property="og:description" content="{{ page.subtitle }}">
  51. {% else %}
  52. <meta property="og:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}">
  53. {% endif %}
  54. <meta property="og:type" content="website" />
  55. {% if page.id %}
  56. <meta property="og:url" content="{{ site.url }}{{ page.url }}" />
  57. <link rel="canonical" href="{{ site.url }}{{ page.url }}" />
  58. {% else %}
  59. <meta property="og:url" content="{{ site.url }}{{ page.url | remove: '/index.html' | remove: '.html' }}" />
  60. <link rel="canonical" href="{{ site.url }}{{ page.url | remove: '/index.html' | remove: '.html' }}" />
  61. {% endif %}
  62. {% if page.share-img %}
  63. <meta property="og:image" content="{{ page.share-img }}" />
  64. {% elsif site.avatar %}
  65. <meta property="og:image" content="{{ site.url }}{{ site.avatar }}" />
  66. {% endif %}
  67. <!-- Twitter summary cards -->
  68. <meta name="twitter:card" content="summary" />
  69. <meta name="twitter:site" content="@{{ site.author.twitter }}" />
  70. <meta name="twitter:creator" content="@{{ site.author.twitter }}" />
  71. {% if page.meta-title %}
  72. <meta name="twitter:title" content="{{ page.meta-title }}" />
  73. {% elsif page.title %}
  74. <meta name="twitter:title" content="{{ page.title }}" />
  75. {% else %}
  76. <meta name="twitter:title" content="{{ site.title }}" />
  77. {% endif %}
  78. {% if page.meta-description %}
  79. <meta name="twitter:description" content="{{ page.meta-description }}">
  80. {% elsif page.subtitle %}
  81. <meta name="twitter:description" content="{{ page.subtitle }}">
  82. {% else %}
  83. <meta name="twitter:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}">
  84. {% endif %}
  85. {% if page.share-img %}
  86. <meta name="twitter:image" content="{{ page.share-img }}" />
  87. {% elsif site.avatar %}
  88. <meta name="twitter:image" content="{{ site.url }}{{ site.avatar }}" />
  89. {% endif %}
  90. </head>