Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jpescador/hugo-future-imperfect.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md32
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/partials/header.html1
-rw-r--r--layouts/partials/seo_schema.html26
4 files changed, 62 insertions, 0 deletions
diff --git a/README.md b/README.md
index 68ad016..6aabc9c 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,7 @@ interested in seeing a live example.
- [exampleSite](#examplesite)
- [config.toml](#configtoml)
- [Hugo's Built-In Server](#hugos-built-in-server)
+ - [Hugo's website SEO](#hugos-website-seo)
- [Shortcodes](#shortcodes)
- [fancybox](#fancybox)
- [img-post](#img-post)
@@ -115,6 +116,37 @@ hugo server
You will then be able to view your live website at [localhost:1313](http://localhost:1313).
+### Hugo's website SEO
+
+This theme support SEO elements for your website.
+It was adapted and integrated thanks to the following guide:
+[https://keithpblog.org/post/hugo-website-seo/](https://keithpblog.org/post/hugo-website-seo/)
+
+If you wish to enable SEO on this theme, follow these instructions:
+1. To include the following parameters in your _config.toml_
+```
+# .config.toml
+...
+enableRobotsTXT = true
+canonifyURLs = true
+# and if you think your md file names or locations might change:
+[permalinks]
+ post = "/blog/:title/"
+...
+```
+
+2. Add your website to Google Search Console:
+ - Login to the [Google Search Console](https://www.google.com/webmasters/tools/home)
+ - Add your website as property
+ - Add the html page as required by google to verify ownership
+ - Submit the sitemap (/sitemap.xml) for indexing
+ - Wait
+
+3. Add your website to Bing
+ - Login to the [Bing Webmaster Console](https://www.bing.com/toolbox/webmaster/)
+ - Add your site, details and verify
+ - From the 3 option, we recommend adding the xml file to you website
+
## Shortcodes
In addition to the native [Hugo shortcodes](https://gohugo.io/extras/shortcodes/),
the theme also includes the following codes that I hope you find useful:
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index e171304..3ff4184 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -7,6 +7,9 @@ paginate = 3
disqusShortname = "shortname"
googleAnalytics = ""
pluralizeListTitles = false
+# Set the followings to true as part of your site SEO
+enableRobotsTXT = true
+canonifyURLs = true
[params]
# Sets the meta tag description
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 03d8096..b954fe9 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -6,6 +6,7 @@
-->
<html>
<head>
+ {{ partial "seo_schema" . }}
{{ with $.Scratch.Get "generalTitle" }}
<title>{{ . }}</title>
{{ else }}
diff --git a/layouts/partials/seo_schema.html b/layouts/partials/seo_schema.html
new file mode 100644
index 0000000..a30598d
--- /dev/null
+++ b/layouts/partials/seo_schema.html
@@ -0,0 +1,26 @@
+<script type="application/ld+json">
+ {
+ "@context" : "http://schema.org",
+ "@type" : "BlogPosting",
+ "mainEntityOfPage": {
+ "@type": "WebPage",
+ "@id": "{{ .Site.BaseURL }}"
+ },
+ "articleSection" : "{{ .Section }}",
+ "name" : "{{ .Title }}",
+ "headline" : "{{ .Title }}",
+ "description" : "{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}",
+ "inLanguage" : "{{ .Lang }}",
+ "author" : "{{ range .Site.Author }}{{ . }}{{ end }}",
+ "creator" : "{{ range .Site.Author }}{{ . }}{{ end }}",
+ "publisher": "{{ range .Site.Author }}{{ . }}{{ end }}",
+ "accountablePerson" : "{{ range .Site.Author }}{{ . }}{{ end }}",
+ "copyrightHolder" : "{{ range .Site.Author }}{{ . }}{{ end }}",
+ "copyrightYear" : "{{ .Date.Format "2006" }}",
+ "datePublished": "{{ .Date }}",
+ "dateModified" : "{{ .Date }}",
+ "url" : "{{ .Permalink }}",
+ "wordCount" : "{{ .WordCount }}",
+ "keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }}"Blog" ]
+ }
+ </script> \ No newline at end of file