Commit 819cbc3a authored by Henk Verlinde's avatar Henk Verlinde
Browse files

feat: update meta tags

parent 75bde49e
Loading
Loading
Loading
Loading
+23 −8
Original line number Diff line number Diff line
@@ -6,20 +6,34 @@ titleSeparator = "-"
titleAddition = "Modern Documentation Theme"
description = "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default."

## Open Graph + Twitter Cards
## Open Graph
images = ["doks.png"]
twitterSite = "henkverlinde"
twitterCreator = "henkverlinde"
facebookAuthor = "verlinde.henk"
facebookPublisher = "verlinde.henk"
ogLocale = "en_US"
domainTLD = "doks.netlify.app"
titleHome = "Doks Theme"

## Twitter Cards
twitterSite = "@getdoks"
twitterCreator = "@henkverlinde"

## JSON-LD
# schemaType = "Person"
schemaType = "Organization"
schemaName = "Doks"
schemaAuthor = "Henk Verlinde"
schemaAuthorTwitter = "https://twitter.com/henkverlinde"
schemaAuthorLinkedIn = "https://www.linkedin.com/in/henkverlinde/"
schemaAuthorGitHub = "https://github.com/h-enk"
schemaLocale = "en-US"
schemaLogo = "logo-doks.png"
schemaTwitter = "https://twitter.com/henkverlinde"
schemaLinkedIn = "https://www.linkedin.com/in/henkverlinde/"
schemaGitHub = "https://github.com/h-enk"
schemaLogoWidth = 512
schemaLogoHeight = 512
schemaImage = "doks.png"
schemaImageWidth = 1280
schemaImageHeight = 640
schemaTwitter = "https://twitter.com/getdoks"
schemaLinkedIn = ""
schemaGitHub = "https://github.com/h-enk/doks"
schemaSection = "blog"

## Sitelinks Search Box
@@ -37,6 +51,7 @@ lqipWidth = "20x"

# Footer
footer = "Powered by <a href=\"https://www.netlify.com/\">Netlify</a>, <a href=\"https://gohugo.io/\">Hugo</a>, and <a href=\"https://getdoks.org/\">Doks</a>"
copyRight = "Copyright (c) 2020-2021 Henk Verlinde"

# Alert
alert = false
+6 −6
Original line number Diff line number Diff line
@@ -4,19 +4,19 @@
  {{ range $i, $e := .Data.Pages -}}
    {{ if ne .Params.sitemap_exclude true }}
    <url>
      <loc>{{ .RelPermalink }}</loc>{{ if not .Lastmod.IsZero }}
      <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
      <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
      <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
      <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
      <xhtml:link
                  rel="alternate"
                  hreflang="{{ .Lang }}"
                  href="{{ .RelPermalink }}"
                  href="{{ .Permalink }}"
                  />{{ end }}
      <xhtml:link
                  rel="alternate"
                  hreflang="{{ .Lang }}"
                  href="{{ .RelPermalink }}"
                  href="{{ .Permalink }}"
                  />{{ end }}
    </url>
    {{ end -}}
@@ -25,19 +25,19 @@
    {{ range $i, $e := .Data.Pages -}}
      {{ if ne .Params.sitemap_exclude true -}}
      <url>
        <loc>{{ .RelPermalink }}</loc>{{ if not .Lastmod.IsZero }}
        <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
        <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
        <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
        <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
        <xhtml:link
                    rel="alternate"
                    hreflang="{{ .Lang }}"
                    href="{{ .RelPermalink }}"
                    href="{{ .Permalink }}"
                    />{{ end }}
        <xhtml:link
                    rel="alternate"
                    hreflang="{{ .Lang }}"
                    href="{{ .RelPermalink }}"
                    href="{{ .Permalink }}"
                    />{{ end }}
      </url>
      {{ end -}}
+1 −1
Original line number Diff line number Diff line
# redirects for Netlify - https://www.netlify.com/docs/redirects/
{{- range $p := .Site.Pages -}}
{{- range .Aliases }}
{{ . }} {{ $p.RelRelPermalink -}}
{{ . }} {{ $p.RelPermalink -}}
{{- end }}
{{- end -}}
 No newline at end of file
+4 −4
Original line number Diff line number Diff line
<meta name="theme-color" content="{{ $.Site.Params.themeColor }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | relURL }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | relURL }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | relURL }}">
<link rel="manifest" crossorigin="use-credentials" href="{{ "site.webmanifest" | relURL }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | absURL }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | absURL }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | absURL }}">
<link rel="manifest" crossorigin="use-credentials" href="{{ "site.webmanifest" | absURL }}">
+37 −61
Original line number Diff line number Diff line
<meta property="og:locale" content="{{ .Site.Params.ogLocale }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:title" content="{{ .Title }}">
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
{{ if $.Scratch.Get "paginator" -}}
  {{ $paginator := .Paginate (where .Site.RegularPages.ByDate.Reverse "Section" "blog" ) -}}
  <meta property="og:url" content="{{ .Paginator.URL | relURL }}">
{{ else -}}
  <meta property="og:url" content="{{ .RelPermalink }}">
{{ end -}}

{{ with $.Params.images -}}
  {{ range first 6 . -}}
  <meta property="og:image" content="{{ $.RelPermalink }}{{ . }}">
  {{ end -}}
{{ else -}}
  {{ $images := $.Resources.ByType "image" -}}
  {{ $featured := $images.GetMatch "*feature*" -}}
  {{ if not $featured -}}
    {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
  {{ end -}}
  {{ with $featured -}}
    <meta property="og:image" content="{{ $featured.RelPermalink }}"/>
  <meta property="og:url" content="{{ .Paginator.URL | absURL }}">
{{ else -}}
    {{ with $.Site.Params.images -}}
      <meta property="og:image" content="{{ index . 0 | relURL }}"/>
    {{ end -}}
  <meta property="og:url" content="{{ .Permalink }}">
{{ end -}}
{{ with .Site.Params.title -}}
  <meta property="og:site_name" content="{{ . }}">
{{ end -}}

{{ $iso8601 := "2006-01-02T15:04:05-07:00" -}}
@@ -43,51 +28,42 @@
  {{ end -}}
{{ end -}}

{{ with .Params.audio -}}
  <meta property="og:audio" content="{{ . }}">
{{ end -}}
{{ with .Params.locale -}}
  <meta property="og:locale" content="{{ . }}">
{{ end -}}
{{ with .Site.Params.title -}}
  <meta property="og:site_name" content="{{ . }}">
{{ end -}}
{{ with .Params.videos -}}
  {{ range . -}}
    <meta property="og:video" content="{{ . | relURL }}">
  {{ end -}}
{{ if eq .Kind "home" -}}
  {{ .Scratch.Set "title" .Site.Params.titleHome -}}
{{ else -}}
  {{ .Scratch.Set "title" .Title -}}
{{ end -}}

{{ $RelPermalink := .RelPermalink -}}
{{ $siteSeries := .Site.Taxonomies.series -}}
{{ with .Params.series -}}
  {{ range $name := . -}}
    {{ $series := index $siteSeries $name -}}
    {{ range $page := first 6 $series.Pages -}}
      {{ if ne $page.RelPermalink $RelPermalink -}}
        <meta property="og:see_also" content="{{ $page.RelPermalink }}">
      {{ end -}}
    {{ end -}}
  {{ end -}}
{{ with $.Params.images -}}
  {{ range first 6 . -}}
  <meta property="og:image" content="{{ $.Permalink }}{{ . }}">
  {{ end -}}

{{ if .IsPage -}}
  {{ range .Site.Authors -}}
    {{ with .Social.facebook -}}
      <meta property="article:author" content="https://www.facebook.com/{{ . }}">
{{ else -}}
  {{ $images := $.Resources.ByType "image" -}}
  {{ $featured := $images.GetMatch "*feature*" -}}
  {{ if not $featured -}}
    {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
  {{ end -}}
    {{ with .Site.Social.facebook -}}
      <meta property="article:publisher" content="https://www.facebook.com/{{ . }}">
  {{ with $featured -}}
    <meta property="og:image" content="{{ $featured.Permalink }}"/>
  {{ else -}}
    {{ with $.Site.Params.images -}}
      <meta property="og:image" content="{{ index . 0 | absURL }}"/>
      <meta property="og:image:alt" content="{{ $.Site.Params.title }}">
    {{ end -}}
    <meta property="article:section" content="{{ .Section }}">
    {{ with .Params.tags -}}
      {{ range first 6 . -}}
        <meta property="article:tag" content="{{ . }}">
  {{ end -}}
{{ end -}}

{{ with $.Site.Params.images -}}
  {{ $.Scratch.Set "primaryImage" (index . 0 | absURL) -}}
{{ end -}}

{{ with .Params.audio -}}
  <meta property="og:audio" content="{{ . | absURL }}">
{{ end -}}

{{ with .Site.Social.facebook_admin -}}
  <meta property="fb:admins" content="{{ . }}">
{{ with .Params.videos -}}
  {{ range . -}}
    <meta property="og:video" content="{{ . | absURL }}">
  {{ end -}}
{{ end -}}
Loading