summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--exampleSite/config.toml6
-rw-r--r--exampleSite/static/img/og.pngbin0 -> 32206 bytes
-rw-r--r--layouts/partials/head.html9
4 files changed, 17 insertions, 2 deletions
diff --git a/README.md b/README.md
index 25cd813..089d3a5 100644
--- a/README.md
+++ b/README.md
@@ -15,9 +15,9 @@ A minimal Hugo theme inspired by [printempw](https://github.com/printempw/)'s He
## Todo
- [ ] Custom pagination
-- [ ] Archive page
+- [x] Archive page
- [x] Analytics
-- [ ] SEO optimization
+- [x] SEO optimization
- [ ] Better mobile devices support
- [ ] Multilingual
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 7eb1fc1..fe8d9d7 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -13,8 +13,14 @@ paginate = 10
post = "/:filename/" # Custom post links, e.g. "/:year/:month/:title/"
[params]
+ author = "DSRKafuU" # You can also set author in post front matter individually
subTitle = "This is a Sub Title"
+ # Open Graph & Twitter Card variables
+ # You can also set description and images in post front matter individually
+ description = "A minimal hugo theme powered by Primer CSS."
+ images = ["img/og.png"] # This will use the image called og.png in static/img folder
+
# Posts shown in homepage
mainSections = ["post"]
diff --git a/exampleSite/static/img/og.png b/exampleSite/static/img/og.png
new file mode 100644
index 0000000..894afe8
--- /dev/null
+++ b/exampleSite/static/img/og.png
Binary files differ
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 0362712..df0f46a 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -12,6 +12,15 @@
{{ else }}
<title>{{ .Title }} - {{ .Site.Title }}</title>
{{ end }}
+<meta name="author" content="{{if .Params.author }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}">
+<meta name="description" content="{{if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.description }}{{ end }}">
+{{ if .Params.tags }}
+<meta name="keywords" content="{{ delimit .Params.tags ", " }}">
+{{ end }}
+
+
+{{ template "_internal/opengraph.html" . }}
+{{ template "_internal/twitter_cards.html" . }}
{{ partial "analytic-google.html" . }}