header.tx 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!doctype html>
  2. <html dir="<: $dir :>" lang="<: $lang :>">
  3. <head>
  4. <title><: $title :></title>
  5. <meta charset="utf-8" />
  6. <link rel="icon" type="image/vnd.microsoft.icon" href="<: $theme_dir :>/img/icon/favicon.ico" />
  7. <meta name="description" content="<: $meta_desc | strip_and_trunc :>"/>
  8. : if ($default_tags) {
  9. <meta name="tags" content="<: $default_tags :>" />
  10. : }
  11. <meta property="postid" content="<: $primary_post.id :>" />
  12. <!-- Open Graph / Facebook -->
  13. <meta property="og:type" content="<: $og_type :>" />
  14. <meta property="og:url" content="https://<: $domain :>/<: $route :>" />
  15. <meta property="og:title" content="<: $title :>" />
  16. : if ($default_tags) {
  17. <meta property="og:article:tags" content="<: $default_tags :>" />
  18. : }
  19. : if ($primary_post.is_image) {
  20. <meta property="og:image" content="https://<: $domain :>/<: $primary_post.href :>" />
  21. <meta property="og:image:type" content="<: $primary_post.content_type :>" />
  22. <meta property="og:image:width" content="1280" />
  23. <meta property="og:image:height" content=720 />
  24. : }
  25. : elsif ($primary_post.is_video) {
  26. <meta property="og:video" content="https://<: $domain :>/<: $primary_post.href :>" />
  27. <meta property="og:video:type" content="<: $primary_post.content_type :>" />
  28. <meta property="og:video:width" content="1280" />
  29. <meta property="og:video:height" content="720" />
  30. <meta property="og:video:image" content="https://<: $domain :>/<: $primary_post.preview :>" />
  31. : }
  32. : if ($primary_post.user) {
  33. <meta property="og:article:author" content="<: $primary_post.user :>" />
  34. : }
  35. : if ($primary_post.created) {
  36. <meta property="og:article:published_time" content="<: $primary_post.created | iso8601 :>" />
  37. <meta property="og:article:modified_time" content="<: $primary_post.created | iso8601 :>" />
  38. : }
  39. : if ($fb_app_id) {
  40. <meta property="fb:app_id" content="<: $fb_app_id :>" />
  41. : }
  42. <!-- Twitter -->
  43. <meta property="twitter:card" content="<: $twitter_type :>" />
  44. <meta property="twitter:url" content="https://<: $domain :>/<: $route :>" />
  45. : if ($primary_post.is_image) {
  46. <meta property="twitter:image" content="https://<: $domain :>/<: $primary_post.href :>" />
  47. <meta property="twitter:image:type" content="<: $primary_post.type :>" />
  48. <meta property="twitter:image:width" content="1280" />
  49. <meta property="twitter:image:height" content=720 />
  50. : }
  51. : elsif ($primary_post.is_video) {
  52. <meta property="twitter:player:stream" content="https://<: $domain :>/<: $primary_post.href :>" />
  53. <meta property="twitter:player:stream:content_type" content="<: $primary_post.type :>" />
  54. <meta property="twitter:player:width" content="1280" />
  55. <meta property="twitter:player:height" content="720" />
  56. <meta property="twitter:player" content="https://<: $domain :>/<: $route :>?embed=1" />
  57. : }
  58. <meta property="twitter:title" content="<: $title :>" />
  59. <meta property="twitter:description" content="<: $meta_desc | strip_and_trunc :>" />
  60. <meta name="viewport" content="width=device-width">
  61. <link rel="stylesheet" type="text/css" href="/styles/structure.css" />
  62. <link rel="stylesheet" type="text/css" href="/styles/screen.css" media="screen" />
  63. <link rel="stylesheet" type="text/css" href="/styles/print.css" media="print" />
  64. : if ($embed) {
  65. <base target="_blank" />
  66. <link rel="stylesheet" type="text/css" href="/styles/embed.css" media="screen" />
  67. : }
  68. <!-- Stylesheets !-->
  69. : for $stylesheets -> $stylesheet {
  70. <link rel="stylesheet" type="text/css" href="<: $stylesheet :>" media="screen" />
  71. : }
  72. : for $scripts -> $script {
  73. <script type="text/javascript" src="<: $script :>"></script>
  74. : }
  75. </head>
  76. <body>