diff --git a/README.md b/README.md index 283f4b7..0c449cd 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 c9ecbdb..646b330 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 @@ -39,6 +42,16 @@ pluralizeListTitles = false faviconVersion = "" # Sets Social Share links to appear on posts socialShare = true + # Sets specific share to appear on posts (default behavior is to appear) + socialShareTwitter = true + socialShareGoogleplus = true + socialShareFacebook = true + socialShareReddit = true + socialShareLinkedin = true + socialShareStumbleupon = true + socialSharePinterest = true + socialShareEmail = true + # Load custom CSS or JavaScript files. The variable is an array so that you # can load multiple files if necessary. You can also load the standard theme # files by adding the value, "default". @@ -53,7 +66,9 @@ pluralizeListTitles = false highlightjsCDN = "//cdn.bootcss.com" highlightjsLang = ["r", "yaml", "css"] highlightjsTheme = "github" - + MathJaxCDN = "//cdn.bootcss.com" + MathJaxVersion = "2.7.1" + # Disqus will take priority over Staticman (github.com/eduardoboucas/staticman) # due to its ease of use. Feel free to check out both and decide what you would # prefer to use. See Staticman.yml for additional settings. @@ -177,6 +192,6 @@ pluralizeListTitles = false vine = "" googlescholar = "" orcid = "" - researchgate = "example" + researchgate = "example" # Email email = "example" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 3327e2c..5c57bd4 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -42,6 +42,7 @@ + {{ partial "footer_mathjax" . }} + + diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 4385ca1..cd609c3 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,6 +6,7 @@ -->
+ {{ partial "seo_schema" . }} {{ with $.Scratch.Get "generalTitle" }}X
StumbleUpon
{{ . | safeHTML }}
Learn More