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.

76 lines
3.6 KiB

4 years ago
  1. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  2. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  3. <meta name="description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
  4. <meta name="keywords" content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}" />
  5. <meta name="robots" content="noodp" />
  6. <link rel="canonical" href="{{ .Permalink }}" />
  7. {{ template "_internal/google_analytics.html" . }}
  8. <!-- Theme CSS -->
  9. <link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
  10. {{ if (isset .Params "color") }}
  11. <link rel="stylesheet" href="{{ (printf "assets/%s.css" .Params.color) | absURL }}">
  12. {{ else if and (ne $.Site.Params.ThemeColor "orange") (ne $.Site.Params.ThemeColor "color" "") }}
  13. <link rel="stylesheet" href="{{ (printf "assets/%s.css" $.Site.Params.ThemeColor) | absURL }}">
  14. {{ end }}
  15. <!-- Custom CSS to override theme properties (/static/style.css) -->
  16. {{ if (fileExists "static/style.css") -}}
  17. <link rel="stylesheet" href="{{ "style.css" | absURL }}">
  18. {{- end }}
  19. <!-- Icons -->
  20. <link rel="apple-touch-icon" href="{{ "img/apple-touch-icon-192x192.png" | absURL }}">
  21. {{ if isset $.Site.Params "favicon" }}
  22. <link rel="shortcut icon" href="{{ $.Site.Params.favicon | absURL }}">
  23. {{ else }}
  24. <link rel="shortcut icon" href="{{ printf "img/favicon/%s.png" ($.Site.Params.ThemeColor | default "orange") | absURL }}">
  25. {{ end }}
  26. <!-- Twitter Card -->
  27. <meta name="twitter:card" content="summary" />
  28. {{ if (isset $.Site.Params "twitter") }}
  29. {{ if (isset $.Site.Params.Twitter "site") }}
  30. <meta name="twitter:site" content="{{ $.Site.Params.Twitter.site }}" />
  31. {{ end }}
  32. <meta name="twitter:creator" content="{{ if .IsHome }}{{ $.Site.Params.Twitter.creator }}{{ else if isset .Params "authortwitter" }}{{ .Params.authorTwitter }}{{ else }}{{ .Params.Author }}{{ end }}" />
  33. {{ end }}
  34. <!-- OG data -->
  35. <meta property="og:locale" content="{{ $.Site.Language.Lang }}" />
  36. <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
  37. <meta property="og:title" content="{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }}{{ end }}">
  38. <meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
  39. <meta property="og:url" content="{{ .Permalink }}" />
  40. <meta property="og:site_name" content="{{ $.Site.Title }}" />
  41. {{ if and (not .IsHome) (isset .Params "cover") }}
  42. <meta property="og:image" content="{{ .Param "cover" | absURL }}">
  43. {{ else }}
  44. {{ if isset $.Site.Params "favicon" }}
  45. <meta property="og:image" content="{{ $.Site.Params.favicon | absURL }}">
  46. {{ else }}
  47. <meta property="og:image" content="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}">
  48. {{ end }}
  49. {{ end }}
  50. <meta property="og:image:width" content="2048">
  51. <meta property="og:image:height" content="1024">
  52. {{ range .Params.categories }}
  53. <meta property="article:section" content="{{ . }}" />
  54. {{ end }}
  55. {{ if isset .Params "date" }}
  56. <meta property="article:published_time" content="{{ time .Date }}" />
  57. {{ end }}
  58. <!-- RSS -->
  59. {{ with .OutputFormats.Get "RSS" }}
  60. <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
  61. {{ end }}
  62. <!-- JSON Feed -->
  63. {{ with .OutputFormats.Get "json" }}
  64. <link href="{{ .RelPermalink }}" rel="alternate" type="application/json" title="{{ $.Site.Title }}" />
  65. {{ end }}
  66. <!-- Extended head section-->
  67. {{ partial "extended_head.html" . }}