Skip to content

Commit

Permalink
Extract meta information from head.html (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
qdzhang authored Apr 14, 2021
1 parent 39f6f21 commit 3216801
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ mediaType = "text/toml"
[params]
style = "auto" # default: auto. light: light theme, dark: dark theme, auto: based on system.
logo = ""
keywords = "blog, theme, 博客, 个人博客, 文字, hugo, 原创"
description = "Hugo theme notepadium mod, a simple hugo theme for blogger"
author = "理头张"

[params.assets]
css = ["css/fonts.css"]
Expand Down
19 changes: 15 additions & 4 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@
<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark">

<meta name="keywords" content="blog, theme, 博客, 个人博客, 文字, hugo, 原创"/>
<meta name="description" content="Hugo theme notepadium mod, a simple hugo theme for blogger"/>
<meta name="author" content="理头张">
<meta name="copyright"content="理头张">
<meta name="keywords" content={{ .Site.Params.keywords }}>
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}">
<meta name="author" content={{ .Site.Params.author }}>
<meta name="copyright"content={{ .Site.Params.author }}>
<meta http-equiv="content-language" content="zh,en">

{{ $paginator := .Paginate (where .Site.RegularPages ".Params.post" "!=" false) }}
{{ if .IsHome }}
{{ if eq $paginator.PageNumber 1 }}
<link rel="canonical" href="{{ .Permalink }}">
{{ else }}
<link rel="canonical" href="{{ .Permalink }}page/{{ $paginator.PageNumber }}/">
{{ end }}
{{ else }}
<link rel="canonical" href="{{ .Permalink }}">
{{ end }}

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
Expand Down

0 comments on commit 3216801

Please sign in to comment.