From 53c63fe950e9e36a32cc671c73bb5d61fb42df03 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 9 Feb 2018 03:49:06 +0100 Subject: [PATCH 01/39] Fix RSS links (#117) --- layouts/partials/rss-icon.html | 5 +++++ layouts/partials/sidebar.html | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/rss-icon.html diff --git a/layouts/partials/rss-icon.html b/layouts/partials/rss-icon.html new file mode 100644 index 00000000..ab4805f0 --- /dev/null +++ b/layouts/partials/rss-icon.html @@ -0,0 +1,5 @@ +{{ if .RSSLink }} + +{{ else }} + +{{ end }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 38c8801f..83ad24f5 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -22,9 +22,7 @@

{{ .header }}

{{ if .Site.Params.socialAppearAtTop }} @@ -124,9 +122,7 @@

About

{{ if .Site.Params.socialAppearAtBottom }} From cd931d68973174cdcfde619a348b217ffb6696e5 Mon Sep 17 00:00:00 2001 From: Patrick Collins Date: Thu, 8 Feb 2018 22:00:08 -0500 Subject: [PATCH 02/39] Fix invald close tag (#119) --- layouts/partials/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 83ad24f5..22077531 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -111,7 +111,7 @@

{{ with .Site.Params.intro.about }}
-

About

+

About

{{ . | safeHTML }}

Learn More
From 9d07761cf5b623c98848a5cc28f8ec454f956099 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sat, 10 Feb 2018 01:45:37 +0100 Subject: [PATCH 03/39] Remove duplicate inclusion of Highlight.js (#116) --- layouts/partials/footer.html | 1 - 1 file changed, 1 deletion(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index cd3c030b..0353f4b3 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -24,7 +24,6 @@ load the standard js files associated with the theme --> {{ if or (in ($.Scratch.Get "jsFiles") "default") (eq ($.Scratch.Get "jsFiles") false) }} - From 45ef7145beea120e2b2af4c6a64b9af9b1a5ffb6 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sat, 10 Feb 2018 01:48:37 +0100 Subject: [PATCH 04/39] Add OpenGraph meta tags (#115) --- layouts/partials/header.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index e834f0a6..03d8096d 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -34,6 +34,10 @@ {{ template "_internal/twitter_cards.html" . }} {{ template "_internal/opengraph.html" . }} + + + + {{ template "_internal/schema.html" . }} {{ template "_internal/google_news.html" . }} From 1a8075a20772f092b908ea4bfc3769ff8865f5c8 Mon Sep 17 00:00:00 2001 From: Rich Date: Sat, 10 Feb 2018 00:58:20 +0000 Subject: [PATCH 05/39] Recent posts should be a class not ID (#105) --- layouts/partials/navbar.html | 2 +- layouts/partials/sidebar.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 1f1812cb..0dca6f17 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -67,7 +67,7 @@

-
+

Recent Posts

diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 22077531..c0fd6d1f 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -30,7 +30,7 @@

{{ .header }}

-
+

Recent Posts

From 300f40e274728ac2b73e25623ce0c22455a9cb8d Mon Sep 17 00:00:00 2001 From: Patrick Collins Date: Fri, 9 Feb 2018 21:21:47 -0500 Subject: [PATCH 06/39] Patch RSS icon to list --- layouts/partials/rss-icon.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/rss-icon.html b/layouts/partials/rss-icon.html index ab4805f0..a48d5fdc 100644 --- a/layouts/partials/rss-icon.html +++ b/layouts/partials/rss-icon.html @@ -1,5 +1,5 @@ {{ if .RSSLink }} - +
  • {{ else }} - +
  • {{ end }} From 60201d39d2a16fdaef8e3b0d9a180263ee7278c3 Mon Sep 17 00:00:00 2001 From: Dudi Levy <4785835+dudil@users.noreply.github.com> Date: Mon, 12 Feb 2018 00:13:39 +0200 Subject: [PATCH 07/39] Bugfix/issue 114 (#121) * Remove redundent closing curled barcket * Added Property for h1 font-size * Fix property typo: -moz-transition --- static/css/main.css | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index ba32a84c..dbd8f8c4 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -130,8 +130,6 @@ } - } - @media screen and (max-width: 980px) { body, input, select, textarea { @@ -210,6 +208,10 @@ border-bottom: 0; } + h1 { + font-size: 1.3em; + } + h2 { font-size: 1.1em; } @@ -569,7 +571,7 @@ select:hover, textarea:hover { -webkit-transition:border-color 0.3s ease-in-out; - moz-transition:border-color 0.3s ease-in-out; + -moz-transition:border-color 0.3s ease-in-out; transition:border-color 0.3s ease-in-out; border-color: #2ebaae; } From 187e213d406e03aa8cc2fa755231433c5f5aa083 Mon Sep 17 00:00:00 2001 From: Dudi Levy <4785835+dudil@users.noreply.github.com> Date: Mon, 12 Feb 2018 00:15:26 +0200 Subject: [PATCH 08/39] Add the possibility to set only specific social networks to share the post (#112) --- exampleSite/config.toml | 10 ++++++++++ layouts/partials/share-links.html | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index faee664b..001ccd44 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -39,6 +39,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". diff --git a/layouts/partials/share-links.html b/layouts/partials/share-links.html index 236dc380..ef1d96c2 100644 --- a/layouts/partials/share-links.html +++ b/layouts/partials/share-links.html @@ -1,65 +1,82 @@ +{{ if .Site.Params.socialShareTwitter | default true}}
  • +{{ end }} +{{ if .Site.Params.socialShareGoogleplus | default true}}
  • +{{ end }} +{{ if .Site.Params.socialShareFacebook | default true}} +
  • +{{ end }} +{{ if .Site.Params.socialShareReddit | default true}}
  • +{{ end }} +{{ if .Site.Params.socialShareLinkedin | default true}}
  • +{{ end }} +{{ if .Site.Params.socialShareStumbleupon | default true}}
  • +{{ end }} +{{ if .Site.Params.socialSharePinterest | default true}}
  • +{{ end }} +{{ if .Site.Params.socialShareEmail | default true}}
  • +{{ end }} From 62b074f4db1e5170f25d77d0c03181c94e6c1018 Mon Sep 17 00:00:00 2001 From: Dan Ovando Date: Sat, 24 Feb 2018 20:19:58 -0800 Subject: [PATCH 09/39] Add capability for mathjax equations per instructions here (#126) https://bookdown.org/yihui/blogdown/templates.html --- exampleSite/config.toml | 6 ++++-- layouts/partials/footer.html | 1 + layouts/partials/footer_mathjax.html | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/footer_mathjax.html diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 001ccd44..e171304b 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -63,7 +63,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. @@ -187,6 +189,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 0353f4b3..dcc917f8 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -41,5 +41,6 @@ + {{ partial "footer_mathjax" . }} diff --git a/layouts/partials/footer_mathjax.html b/layouts/partials/footer_mathjax.html new file mode 100644 index 00000000..bd331bcb --- /dev/null +++ b/layouts/partials/footer_mathjax.html @@ -0,0 +1,5 @@ + + + From 020882f6ec3658a873f55d162ba114a7bd9288ae Mon Sep 17 00:00:00 2001 From: Dudi Levy <4785835+dudil@users.noreply.github.com> Date: Tue, 27 Feb 2018 16:39:14 +0200 Subject: [PATCH 10/39] - Add SEO elements to header, i18l friendly (#122) - Add Hugo related SEO parameters to example config.toml - Add relevant instructions to the README.md file --- README.md | 32 ++++++++++++++++++++++++++++++++ exampleSite/config.toml | 3 +++ layouts/partials/header.html | 1 + layouts/partials/seo_schema.html | 26 ++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 layouts/partials/seo_schema.html diff --git a/README.md b/README.md index 68ad0168..6aabc9ca 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 e171304b..3ff41842 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 03d8096d..b954fe92 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,6 +6,7 @@ --> + {{ partial "seo_schema" . }} {{ with $.Scratch.Get "generalTitle" }} {{ . }} {{ else }} diff --git a/layouts/partials/seo_schema.html b/layouts/partials/seo_schema.html new file mode 100644 index 00000000..a30598d6 --- /dev/null +++ b/layouts/partials/seo_schema.html @@ -0,0 +1,26 @@ + \ No newline at end of file From d572ce55a3a97b0f7b01604fe3b4ce39b8c4270d Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 10:36:52 +0100 Subject: [PATCH 11/39] Port back the modified theme from the blog repository --- layouts/index.html | 8 +- layouts/partials/disqus.html | 22 ++ layouts/partials/footer.html | 1 + layouts/partials/header.html | 2 +- layouts/partials/sidebar.html | 16 +- layouts/partials/twitter_cards.html | 25 ++ layouts/post/footer-category.html | 2 +- layouts/post/header.html | 27 ++- layouts/shortcodes/img-lazy.html | 7 + layouts/taxonomy/author.html | 17 ++ layouts/taxonomy/author.terms.html | 37 +++ layouts/taxonomy/category.html | 2 +- layouts/taxonomy/category.terms.html | 2 +- static/js/jquery-lazy/jquery.lazy.min.js | 2 + static/js/main.js | 288 +++++++++++------------ 15 files changed, 302 insertions(+), 156 deletions(-) create mode 100644 layouts/partials/disqus.html create mode 100644 layouts/partials/twitter_cards.html create mode 100644 layouts/shortcodes/img-lazy.html create mode 100644 layouts/taxonomy/author.html create mode 100644 layouts/taxonomy/author.terms.html create mode 100644 static/js/jquery-lazy/jquery.lazy.min.js diff --git a/layouts/index.html b/layouts/index.html index be5f8da2..237dc219 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,11 +3,15 @@ {{ partial "navbar" . }}
    - {{ range first 1 (where .Site.Pages "Type" "post") }} - {{ .Render "content-single" }} + {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} + {{ range $paginator.Pages }} + {{ .Render "content-list" }} {{ partial "share-menu" . }} {{ end }} + + {{ partial "pagination" . }} +
    {{ partial "sidebar" . }} {{ partial "footer" . }} diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html new file mode 100644 index 00000000..09687d24 --- /dev/null +++ b/layouts/partials/disqus.html @@ -0,0 +1,22 @@ +{{ if ne .Params.comments false}} +{{ if .Site.DisqusShortname }} +
    + + +{{ end }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index dcc917f8..b03db1ca 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -29,6 +29,7 @@ + {{ end }} {{ if ne ($.Scratch.Get "jsFiles") false }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index b954fe92..bf7e0244 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -33,7 +33,7 @@ {{ end }} {{ end }} - {{ template "_internal/twitter_cards.html" . }} + {{ partial "twitter_cards" . }} {{ template "_internal/opengraph.html" . }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index c0fd6d1f..78f16119 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -47,12 +47,18 @@

    Recent Posts

    {{ range first ($.Scratch.Get "postLimit") (where ($.Scratch.Get "recentPosts") "Type" "post") }}
    + {{ range .Params.authors }} + {{ with index $.Site.Data.authors . }} + {{ .name }} avatar + {{ end }} + {{ end }} +

    {{ .Title }}

    {{ $.Scratch.Set "dateType" .Date }}
    {{ .Render "featured" }} @@ -80,8 +86,7 @@

    - Categories -

    + Top categories

    {{ if .Site.Params.categoriesByCount }} {{ $.Scratch.Set "categories" .Site.Taxonomies.categories.ByCount }} @@ -90,6 +95,7 @@

    {{ end }} {{ range $key, $value := $.Scratch.Get "categories" }} + {{ if ge $value.Count 5 }}

    @@ -104,6 +110,10 @@

    {{ end }} + {{ end }} +

    + View more categories +

    {{ end }} {{ end }} diff --git a/layouts/partials/twitter_cards.html b/layouts/partials/twitter_cards.html new file mode 100644 index 00000000..d814d4b3 --- /dev/null +++ b/layouts/partials/twitter_cards.html @@ -0,0 +1,25 @@ +{{ if .IsPage }} + {{ with .Params.twitterlargeimage }} + + + + {{ else }} + + {{ with .Params.twitterimage }} + + {{ else }} + + {{ end }} + {{ end }} + + + + {{ range .Params.authors }} + {{ with index $.Site.Data.authors . }} + {{ with .twitter }}{{ end }} + {{ end }} + {{ end }} +{{ end }} + +{{ with .Site.Social.twitter }}{{ end }} +{{ with .Site.Social.twitter_domain }}{{ end }} diff --git a/layouts/post/footer-category.html b/layouts/post/footer-category.html index 8818c035..12821bfd 100644 --- a/layouts/post/footer-category.html +++ b/layouts/post/footer-category.html @@ -21,7 +21,7 @@ {{ range $k, $v := .Params.tags }} {{ $url := printf "tags/%s" (. | urlize | lower) }} -
  • +
  • {{ end }} {{ end }} {{ end }} diff --git a/layouts/post/header.html b/layouts/post/header.html index 6ffe2b1a..08268dee 100644 --- a/layouts/post/header.html +++ b/layouts/post/header.html @@ -9,17 +9,38 @@

    {{ .Title }}

    {{ with .Description }}

    {{ . }}

    {{ end }} + {{ with .Params.ita }} +

    + Questo articolo รจ disponibile anche + in italiano +

    + {{ end }} + {{ with .Params.eng }} +

    + This article is also available + in english +

    + {{ end }}
    {{ $.Scratch.Set "dateType" .Date }} - {{ .Params.author }} + {{ ($.Scratch.Get "dateType").Format "2 January 2006" }} + + + {{ range .Params.authors }} + + {{ with index $.Site.Data.authors . }} + {{ .name }} + {{ .name }} avatar + {{ end }} + + {{ end }} + {{ if .Site.Params.includeReadingTime }}

    {{ .ReadingTime }} minute read

    {{ end }} -
    diff --git a/layouts/shortcodes/img-lazy.html b/layouts/shortcodes/img-lazy.html new file mode 100644 index 00000000..5b5af962 --- /dev/null +++ b/layouts/shortcodes/img-lazy.html @@ -0,0 +1,7 @@ +

    + +
    + {{ if isset .Params "label" }} + {{ .Get "label" }} + {{ end }} +

    diff --git a/layouts/taxonomy/author.html b/layouts/taxonomy/author.html new file mode 100644 index 00000000..83fd3343 --- /dev/null +++ b/layouts/taxonomy/author.html @@ -0,0 +1,17 @@ +{{ partial "general-title" . }} + +{{ partial "header" . }} + {{ partial "navbar" . }} + +
    + {{ $author := index $.Site.Data.authors (.Title | lower) }} +

    Articles written by {{ $author.name }}

    + {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} + {{ range $paginator.Pages }} + {{ .Render "content-list" }} + {{ end }} + + {{ partial "pagination" . }} +
    + {{ partial "sidebar" . }} +{{ partial "footer" . }} diff --git a/layouts/taxonomy/author.terms.html b/layouts/taxonomy/author.terms.html new file mode 100644 index 00000000..15d25386 --- /dev/null +++ b/layouts/taxonomy/author.terms.html @@ -0,0 +1,37 @@ +{{ partial "general-title" . }} + +{{ partial "header" . }} + {{ partial "navbar" . }} + +
    + {{ if .Site.Params.authorsByCount }} + {{ $.Scratch.Set "authors" .Data.Terms.ByCount }} + {{ else }} + {{ $.Scratch.Set "authors" .Data.Terms.Alphabetical }} + {{ end }} + +
      +
      +

      {{ .Data.Plural }} of this blog

      +
      + {{ $data := .Data }} + {{ range $key, $value := $.Scratch.Get "authors" }} +
    • +
      +
      + {{ with index $.Site.Data.authors $value.Name }} + + {{ .name }} avatar + {{ .name }} + + {{ $value.Count }} + {{ end }} +
      +
      +
    • + {{ end }} +
    +
    + + {{ partial "sidebar" . }} +{{ partial "footer" . }} diff --git a/layouts/taxonomy/category.html b/layouts/taxonomy/category.html index 8881b148..5e175230 100644 --- a/layouts/taxonomy/category.html +++ b/layouts/taxonomy/category.html @@ -4,7 +4,7 @@ {{ partial "navbar" . }}
    -

    {{ .Title }}

    +

    Articles in category: {{ .Title }}

    {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} {{ range $paginator.Pages }} {{ .Render "content-list" }} diff --git a/layouts/taxonomy/category.terms.html b/layouts/taxonomy/category.terms.html index f6675cad..63eb3819 100644 --- a/layouts/taxonomy/category.terms.html +++ b/layouts/taxonomy/category.terms.html @@ -20,7 +20,7 @@

    {{ .Data.Plural }}

    {{ if ne $value.Name "" }} - {{ $value.Name }} + {{ $value.Name }} {{ $value.Count }} {{ else }} Uncategorized diff --git a/static/js/jquery-lazy/jquery.lazy.min.js b/static/js/jquery-lazy/jquery.lazy.min.js new file mode 100644 index 00000000..59aab4da --- /dev/null +++ b/static/js/jquery-lazy/jquery.lazy.min.js @@ -0,0 +1,2 @@ +/*! jQuery & Zepto Lazy v1.7.5 - http://jquery.eisbehr.de/lazy - MIT&GPL-2.0 license - Copyright 2012-2017 Daniel 'Eisbehr' Kern */ +!function(t,e){"use strict";function r(r,a,i,l,u){function f(){L=t.devicePixelRatio>1,c(i),a.delay>=0&&setTimeout(function(){s(!0)},a.delay),(a.delay<0||a.combined)&&(l.e=v(a.throttle,function(t){"resize"===t.type&&(w=B=-1),s(t.all)}),l.a=function(t){c(t),i.push.apply(i,t)},l.g=function(){return i=n(i).filter(function(){return!n(this).data(a.loadedName)})},l.f=function(t){for(var e=0;ee.top&&-ne.left&&-n=0?w:w=n(t).width()}function h(){return B>=0?B:B=n(t).height()}function m(t){return t.tagName.toLowerCase()}function b(t,e){if(e){var r=t.split(",");t="";for(var a=0,n=r.length;at||!a.enableThrottle||l?u():n=setTimeout(u,t-f)}}function p(){--z,i.length||z||y("onFinishedAll")}function y(t,e,n){return!!(t=a[t])&&(t.apply(r,[].slice.call(arguments,1)),!0)}var z=0,w=-1,B=-1,L=!1,T="afterLoad",D="load",I="error",N="img",E="src",F="srcset",C="sizes",O="background-image";"event"===a.bind||o?f():n(t).on(D+"."+u,f)}function a(a,o){var l=this,u=n.extend({},l.config,o),f={},c=u.name+"-"+ ++i;return l.config=function(t,r){return r===e?u[t]:(u[t]=r,l)},l.addItems=function(t){return f.a&&f.a("string"===n.type(t)?n(t):t),l},l.getItems=function(){return f.g?f.g():{}},l.update=function(t){return f.e&&f.e({},!t),l},l.force=function(t){return f.f&&f.f("string"===n.type(t)?n(t):t),l},l.loadAll=function(){return f.e&&f.e({all:!0},!0),l},l.destroy=function(){return n(u.appendScroll).off("."+c,f.e),n(t).off("."+c),f={},e},r(l,u,a,f,c),u.chainable?a:l}var n=t.jQuery||t.Zepto,i=0,o=!1;n.fn.Lazy=n.fn.lazy=function(t){return new a(this,t)},n.Lazy=n.lazy=function(t,r,i){if(n.isFunction(r)&&(i=r,r=[]),n.isFunction(i)){t=n.isArray(t)?t:[t],r=n.isArray(r)?r:[r];for(var o=a.prototype.config,l=o._f||(o._f={}),u=0,f=t.length;ularge. - skel - .on('+medium', function() { - $intro.prependTo($main); - }) - .on('-medium', function() { - $intro.prependTo($sidebar); - }); - - }); - -})(jQuery); +/* + Future Imperfect by HTML5 UP + html5up.net | @n33co + Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) +*/ + +(function($) { + + skel.breakpoints({ + xlarge: '(max-width: 1680px)', + large: '(max-width: 1280px)', + medium: '(max-width: 980px)', + small: '(max-width: 736px)', + xsmall: '(max-width: 480px)' + }); + + $(function() { + + var $window = $(window), + $body = $('body'), + $menu = $('#menu'), + $shareMenu = $('#share-menu'), + $sidebar = $('#sidebar'), + $main = $('#main'); + + // TODO: Fix this, or implement lazy load. + // Disable animations/transitions until the page has loaded. + // $body.addClass('is-loading'); + + // $window.on('load', function() { + // window.setTimeout(function() { + // $body.removeClass('is-loading'); + // }, 100); + // }); + + // Fix: Placeholder polyfill. + $('form').placeholder(); + + // Prioritize "important" elements on medium. + skel.on('+medium -medium', function() { + $.prioritize( + '.important\\28 medium\\29', + skel.breakpoint('medium').active + ); + }); + + // IE<=9: Reverse order of main and sidebar. + if (skel.vars.IEVersion <= 9) + $main.insertAfter($sidebar); + + $menu.appendTo($body); + $shareMenu.appendTo($body); + + $menu.panel({ + delay: 500, + hideOnClick: true, + hideOnEscape: true, + hideOnSwipe: true, + resetScroll: true, + resetForms: true, + side: 'right', + target: $body, + visibleClass: 'is-menu-visible' + }); + + $shareMenu.panel({ + delay: 500, + hideOnClick: true, + hideOnEscape: true, + hideOnSwipe: true, + resetScroll: true, + resetForms: true, + side: 'right', + target: $body, + visibleClass: 'is-share-visible' + }); + + // Menu. + /*$menu + .appendTo($body) + .panel({ + delay: 500, + hideOnClick: true, + hideOnSwipe: true, + resetScroll: true, + resetForms: true, + side: 'right', + target: $body, + visibleClass: 'is-menu-visible' + });*/ + + // Search (header). + var $search = $('#search'), + $search_input = $search.find('input'); + + $body + .on('click', '[href="#search"]', function(event) { + + event.preventDefault(); + + // Not visible? + if (!$search.hasClass('visible')) { + + // Reset form. + $search[0].reset(); + + // Show. + $search.addClass('visible'); + + // Focus input. + $search_input.focus(); + + } + + }); + + $search_input + .on('keydown', function(event) { + + if (event.keyCode == 27) + $search_input.blur(); + + }) + .on('blur', function() { + window.setTimeout(function() { + $search.removeClass('visible'); + }, 100); + }); + + // Intro. + var $intro = $('#intro'); + + // Move to main on <=large, back to sidebar on >large. + skel + .on('+medium', function() { + $intro.prependTo($main); + }) + .on('-medium', function() { + $intro.prependTo($sidebar); + }); + + }); + +})(jQuery); From e392d33a54070f2cdb40487b4145fae3fbce2e38 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 11:19:03 +0100 Subject: [PATCH 12/39] Add topCategoriesThreshold parameter --- layouts/partials/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 78f16119..563bbbed 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -95,7 +95,7 @@

    {{ end }} {{ range $key, $value := $.Scratch.Get "categories" }} - {{ if ge $value.Count 5 }} + {{ if ge $value.Count .Site.Params.topCategoriesThreshold }}

    From 914d7d06bf7cb57263c26000434cdcd61113112b Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 11:21:20 +0100 Subject: [PATCH 13/39] Change URL for 'Learn more' button --- layouts/partials/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 563bbbed..94fe926c 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -123,7 +123,7 @@

    About

    {{ . | safeHTML }}

    - Learn More + Learn More
    {{ end }} From b8969364848fcf24475e52f3a7a638968c354f84 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 11:26:07 +0100 Subject: [PATCH 14/39] Add more copyright information --- layouts/partials/sidebar.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 94fe926c..bbf7f88c 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -148,6 +148,10 @@

    About

    {{ .Site.Title }} {{ end }} {{end}}. + Disclaimer
    + Design HTML5 UP
    + Ported by Julio Pescador
    + Modified by Alessandro Lai
    Powered by Hugo

    From ee636279ab7d3f74a3725362008a5e32c9acec32 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 11:52:45 +0100 Subject: [PATCH 15/39] Revert "Add topCategoriesThreshold parameter" This reverts commit b83e3d0 --- layouts/partials/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index bbf7f88c..9b479322 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -95,7 +95,7 @@

    {{ end }} {{ range $key, $value := $.Scratch.Get "categories" }} - {{ if ge $value.Count .Site.Params.topCategoriesThreshold }} + {{ if ge $value.Count 5 }}

    From 37ff7584653c81cd439ada10d478eb03f1fe3a72 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 12:14:44 +0100 Subject: [PATCH 16/39] Re-add ToC --- layouts/post/content-single.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/layouts/post/content-single.html b/layouts/post/content-single.html index 65b78595..82361f9f 100644 --- a/layouts/post/content-single.html +++ b/layouts/post/content-single.html @@ -10,6 +10,11 @@ {{ end }} {{ .Render "featured" }} + + {{ if .Params.toc }} + {{ .TableOfContents }} + {{ end }} +
    {{ .Content }}
    From 9ac3c00e79ea1abfb5fbc5094115db0b7031f30d Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 13:00:55 +0100 Subject: [PATCH 17/39] Apply CSS fixes for multi-authors in the sidebar --- layouts/partials/header.html | 1 + layouts/partials/sidebar.html | 12 ++++++++---- static/css/additional.css | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 static/css/additional.css diff --git a/layouts/partials/header.html b/layouts/partials/header.html index bf7e0244..0226e4c1 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -56,6 +56,7 @@ + {{ end }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 9b479322..013b9f67 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -47,11 +47,15 @@

    Recent Posts

    {{ range first ($.Scratch.Get "postLimit") (where ($.Scratch.Get "recentPosts") "Type" "post") }}
    - {{ range .Params.authors }} - {{ with index $.Site.Data.authors . }} - {{ .name }} avatar - {{ end }} +
    + {{ range $key, $value := .Params.authors }} + {{ with index $.Site.Data.authors $value }} + + {{ .name }} avatar + + {{ end }} {{ end }} +

    {{ .Title }} diff --git a/static/css/additional.css b/static/css/additional.css new file mode 100644 index 00000000..c627fb99 --- /dev/null +++ b/static/css/additional.css @@ -0,0 +1,14 @@ +#sidebar .mini-post div.author-avatars { + float: right; +} + +#sidebar .mini-post a { + position: initial; +} + +#sidebar .mini-post a img.author-avatar { + border-radius: 100%; + display: block; + width: 3.2em; + margin-bottom: 0.4em; +} From a666040b86731b3197d46245784cc931609b6c7a Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 13:09:32 +0100 Subject: [PATCH 18/39] Port facile-it/facile-it.github.io#15 --- layouts/partials/header.html | 1 + 1 file changed, 1 insertion(+) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 0226e4c1..74edb706 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -19,6 +19,7 @@ + {{ .Hugo.Generator }} {{ partial "favicon" . }} From 16b447d7d4ad7d57247e18e3c44a563ec8e2fc9c Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 14:50:39 +0100 Subject: [PATCH 19/39] Use super-reduced highlight.js --- layouts/partials/footer.html | 2 +- static/js/highlight.pack.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 static/js/highlight.pack.js diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index b03db1ca..6bd8b15a 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -12,7 +12,7 @@ {{ $highVer := .Site.Params.highlightjsVersion }} {{ $highCDN := (.Site.Params.highlightjsCDN | default "//cdn.bootcss.com") }} {{ if (not (eq $highVer "")) }} - + {{ $.Scratch.Set "highLangs" .Site.Params.highlightjsLang }} {{ range .Params.highlightjsLang }}{{ $.Scratch.Add "highLangs" . }}{{ end }} {{ range ($.Scratch.Get "highLangs") }} diff --git a/static/js/highlight.pack.js b/static/js/highlight.pack.js new file mode 100644 index 00000000..ad97d5c8 --- /dev/null +++ b/static/js/highlight.pack.js @@ -0,0 +1,2 @@ +/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */ +!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,"&").replace(//g,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return w(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function u(e){s+=""}function c(e){("start"===e.event?o:u)(e.node)}for(var l=0,s="",f=[];e.length||r.length;){var g=i();if(s+=n(a.substring(l,g[0].offset)),l=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===l);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return s+n(a.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):x(a.k).forEach(function(e){u(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return l("self"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var c=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=c.length?t(c.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function l(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function p(e,n,t,r){var a=r?"":I.classPrefix,i='',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=l(E,r),e?(B+=e[1],a+=p(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!y[E.sL])return n(k);var t=e?f(E.sL,k,!0,x[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(B+=t.r),e&&(x[E.sL]=t.top),p(t.language,t.value,!1,!0)}function b(){L+=null!=E.sL?d():h(),k=""}function v(e){L+=e.cN?p(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(k+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),b(),t.rB||t.eB||(k=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),b(),a.eE&&(k=n));do E.cN&&(L+=C),E.skip||(B+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),a.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return k+=n,n.length||1}var N=w(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,E=i||N,x={},L="";for(R=E;R!==N;R=R.parent)R.cN&&(L=p(R.cN,"",!0)+L);var k="",B=0;try{for(var M,j,O=0;;){if(E.t.lastIndex=O,M=E.t.exec(t),!M)break;j=m(t.substring(O,M.index),M[0]),O=M.index+j}for(m(t.substr(O)),R=E;R.parent;R=R.parent)R.cN&&(L+=C);return{r:B,value:L,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function g(e,t){t=t||I.languages||x(y);var r={r:0,value:n(e)},a=r;return t.filter(w).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return I.tabReplace||I.useBR?e.replace(M,function(e,n){return I.useBR&&"\n"===e?"
    ":I.tabReplace?n.replace(/\t/g,I.tabReplace):""}):e}function h(e,n,t){var r=n?L[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function d(e){var n,t,r,o,l,s=i(e);a(s)||(I.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):n=e,l=n.textContent,r=s?f(s,l,!0):g(l),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),l)),r.value=p(r.value),e.innerHTML=r.value,e.className=h(e.className,s,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){I=o(I,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,d)}}function m(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)}function N(n,t){var r=y[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function R(){return x(y)}function w(e){return e=(e||"").toLowerCase(),y[e]||y[L[e]]}var E=[],x=Object.keys,y={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="
    ",I={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=d,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e}); \ No newline at end of file From 5ad27f320ebafe700ce1fcb8d9c190c118b8f87c Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 16:01:12 +0100 Subject: [PATCH 20/39] Move social share to the bottom of the post --- layouts/post/content-single.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/layouts/post/content-single.html b/layouts/post/content-single.html index 82361f9f..bb740dd1 100644 --- a/layouts/post/content-single.html +++ b/layouts/post/content-single.html @@ -1,14 +1,6 @@
    {{ .Render "header" }} - {{ if .Site.Params.socialShare }} -
    -
      - {{ partial "share-links" . }} -
    -
    - {{ end }} - {{ .Render "featured" }} {{ if .Params.toc }} @@ -19,6 +11,14 @@ {{ .Content }} + {{ if .Site.Params.socialShare }} +
    +
      + {{ partial "share-links" . }} +
    +
    + {{ end }} +
    {{ .Render "footer-category" }}
    From 9dcf43fb2bb13d6aa1f7553edff265e11bbce438 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 16:57:46 +0100 Subject: [PATCH 21/39] Restore usage of CDN HL.js --- layouts/partials/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 6bd8b15a..b03db1ca 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -12,7 +12,7 @@ {{ $highVer := .Site.Params.highlightjsVersion }} {{ $highCDN := (.Site.Params.highlightjsCDN | default "//cdn.bootcss.com") }} {{ if (not (eq $highVer "")) }} - + {{ $.Scratch.Set "highLangs" .Site.Params.highlightjsLang }} {{ range .Params.highlightjsLang }}{{ $.Scratch.Add "highLangs" . }}{{ end }} {{ range ($.Scratch.Get "highLangs") }} From 80735297e952a1f3e81cf03e6ad72195547e169d Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 7 Feb 2018 17:19:17 +0100 Subject: [PATCH 22/39] Fix jQuery-lazy init --- layouts/partials/footer.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index b03db1ca..db0bb189 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -42,6 +42,11 @@ - {{ partial "footer_mathjax" . }} + {{ partial "footer_mathjax" . }} + From 35f6db8ecb58ffd5c0f602a163a516e55bf7f16f Mon Sep 17 00:00:00 2001 From: Salvatore Cordiano Date: Thu, 16 Apr 2020 23:13:34 +0200 Subject: [PATCH 23/39] Update theme for Hugo 0.69.0 --- layouts/index.html | 4 ++-- layouts/partials/header.html | 2 +- layouts/partials/sidebar.html | 10 +++++++--- layouts/taxonomy/author.terms.html | 2 +- layouts/taxonomy/category.terms.html | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 237dc219..a880c945 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,8 +3,8 @@ {{ partial "navbar" . }}
    - {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} - {{ range $paginator.Pages }} + {{ $paginator := .Paginate .Site.RegularPages 5 }} + {{ range .Paginator.Pages }} {{ .Render "content-list" }} {{ partial "share-menu" . }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 74edb706..6dfd3bb8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -20,7 +20,7 @@ - {{ .Hugo.Generator }} + {{ hugo.Generator }} {{ partial "favicon" . }} {{ with .Params.author }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 013b9f67..ddf52af7 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -22,7 +22,9 @@

    {{ .header }}

    {{ if .Site.Params.socialAppearAtTop }}
      {{ if .Site.Params.rssAppearAtTop }} - {{ partial "rss-icon" . }} +
    • + +
    • {{ end }} {{ partial "social" . }}
    @@ -104,7 +106,7 @@

    {{ if ne $value.Name "" }} - {{ $value.Name }} + {{ $value.Name | humanize }} {{ $value.Count }} {{ else }} Uncategorized @@ -136,7 +138,9 @@

    About

    {{ if .Site.Params.socialAppearAtBottom }}
      {{ if .Site.Params.rssAppearAtBottom }} - {{ partial "rss-icon" . }} +
    • + +
    • {{ end }} {{ partial "social" . }}
    diff --git a/layouts/taxonomy/author.terms.html b/layouts/taxonomy/author.terms.html index 15d25386..a2ec10cd 100644 --- a/layouts/taxonomy/author.terms.html +++ b/layouts/taxonomy/author.terms.html @@ -12,7 +12,7 @@
      -

      {{ .Data.Plural }} of this blog

      +

      {{ .Data.Plural | humanize }} of this blog

      {{ $data := .Data }} {{ range $key, $value := $.Scratch.Get "authors" }} diff --git a/layouts/taxonomy/category.terms.html b/layouts/taxonomy/category.terms.html index 63eb3819..b2170f91 100644 --- a/layouts/taxonomy/category.terms.html +++ b/layouts/taxonomy/category.terms.html @@ -12,7 +12,7 @@
        -

        {{ .Data.Plural }}

        +

        {{ .Data.Plural | humanize }}

        {{ $data := .Data }} {{ range $key, $value := $.Scratch.Get "categories" }} @@ -20,7 +20,7 @@

        {{ .Data.Plural }}

        {{ if ne $value.Name "" }} - {{ $value.Name }} + {{ $value.Name | humanize }} {{ $value.Count }} {{ else }} Uncategorized From 40fa6bdbd32a95b12961a3b3c4475c6cb0659c5e Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 17 Apr 2020 13:11:22 +0200 Subject: [PATCH 24/39] Refine taxonomies refactors following Hugo docs --- layouts/partials/sidebar.html | 6 +++--- layouts/taxonomy/author.terms.html | 2 +- layouts/taxonomy/category.terms.html | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index ddf52af7..c74d9263 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -106,11 +106,11 @@

        diff --git a/layouts/taxonomy/author.terms.html b/layouts/taxonomy/author.terms.html index a2ec10cd..a6712547 100644 --- a/layouts/taxonomy/author.terms.html +++ b/layouts/taxonomy/author.terms.html @@ -20,7 +20,7 @@

        {{ .Data.Plural | humanize }} of this blog

        {{ with index $.Site.Data.authors $value.Name }} - + {{ .name }} avatar {{ .name }} diff --git a/layouts/taxonomy/category.terms.html b/layouts/taxonomy/category.terms.html index b2170f91..c817cd2c 100644 --- a/layouts/taxonomy/category.terms.html +++ b/layouts/taxonomy/category.terms.html @@ -20,11 +20,11 @@

        {{ .Data.Plural | humanize }}

        From 31b94515b50915714cb7412d69baae2c7908d9be Mon Sep 17 00:00:00 2001 From: Salvatore Cordiano Date: Sun, 20 Dec 2020 11:23:00 +0100 Subject: [PATCH 25/39] Fix post preview image --- layouts/partials/header.html | 19 +++++++++++++++---- layouts/partials/twitter_cards.html | 4 ++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 6dfd3bb8..34f30f01 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -36,10 +36,21 @@ {{ partial "twitter_cards" . }} {{ template "_internal/opengraph.html" . }} - - - - + + {{ if .IsPage }} + {{ with .Params.twitterImage }} + + {{ else }} + {{ with .Site.Params.openGraphImage }} + + {{ end }} + {{ end }} + {{ else }} + {{ with .Site.Params.openGraphImage }} + + {{ end }} + {{ end }} + {{ template "_internal/schema.html" . }} {{ template "_internal/google_news.html" . }} diff --git a/layouts/partials/twitter_cards.html b/layouts/partials/twitter_cards.html index d814d4b3..efef75db 100644 --- a/layouts/partials/twitter_cards.html +++ b/layouts/partials/twitter_cards.html @@ -5,10 +5,10 @@ {{ else }} - {{ with .Params.twitterimage }} + {{ with .Params.twitterImage }} {{ else }} - + {{ end }} {{ end }} From 606eb9684d59751c9bbefe0c073ae13b39757278 Mon Sep 17 00:00:00 2001 From: Matteo Garza Date: Thu, 19 Oct 2023 17:20:34 +0200 Subject: [PATCH 26/39] fix standard preview on X (Twitter) --- layouts/partials/twitter_cards.html | 31 +++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/layouts/partials/twitter_cards.html b/layouts/partials/twitter_cards.html index efef75db..a406bde8 100644 --- a/layouts/partials/twitter_cards.html +++ b/layouts/partials/twitter_cards.html @@ -1,23 +1,20 @@ -{{ if .IsPage }} - {{ with .Params.twitterlargeimage }} - - + +{{ with .Params.twitterlargeimage }} + + +{{ else }} + {{ with .Params.twitterImage }} {{ else }} - - {{ with .Params.twitterImage }} - - {{ else }} - - {{ end }} + {{ end }} - - - - {{ range .Params.authors }} - {{ with index $.Site.Data.authors . }} - {{ with .twitter }}{{ end }} - {{ end }} +{{ end }} + + + +{{ range .Params.authors }} + {{ with index $.Site.Data.authors . }} + {{ with .twitter }}{{ end }} {{ end }} {{ end }} From 4adcbb0d8ed8fc51a0095934e2770d4d6710ebd4 Mon Sep 17 00:00:00 2001 From: Matteo Garza Date: Fri, 20 Oct 2023 11:38:12 +0200 Subject: [PATCH 27/39] fix preview on Telegram --- layouts/partials/twitter_cards.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/twitter_cards.html b/layouts/partials/twitter_cards.html index a406bde8..0e821044 100644 --- a/layouts/partials/twitter_cards.html +++ b/layouts/partials/twitter_cards.html @@ -1,12 +1,12 @@ {{ with .Params.twitterlargeimage }} - + {{ else }} {{ with .Params.twitterImage }} - + {{ else }} - + {{ end }} {{ end }} From 451b25f9867fbdde3f29f82c6fbe2d7b67b6c5ab Mon Sep 17 00:00:00 2001 From: Matteo Garza Date: Thu, 4 Jan 2024 00:54:01 +0100 Subject: [PATCH 28/39] update twitter to x.com, update fontawesome --- README.md | 2 +- exampleSite/content/about/_index.md | 2 +- exampleSite/content/blog/goisforlovers.md | 2 +- layouts/404.html | 6 +++++- layouts/503.html | 2 +- layouts/maintenance.html | 3 +-- layouts/partials/header.html | 2 +- layouts/partials/share-links.html | 4 ++-- layouts/partials/social.html | 2 +- static/css/main.css | 2 +- 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6aabc9ca..0c449cda 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ Credit: [jpescador] Hugo Future Imperfect was ported by [Julio Pescador](https://jpescador.com). Extra features implemented by the [project contributors](https://github.com/jpescador/hugo-future-imperfect/graphs/contributors). -Send Julio Pescador a tweet [@julio_pescador](https://twitter.com/julio_pescador), +Send Julio Pescador a tweet [@julio_pescador](https://x.com/julio_pescador), if you like the theme and are using it for your own personal use. ## License diff --git a/exampleSite/content/about/_index.md b/exampleSite/content/about/_index.md index 728344bb..b3ccf3a4 100644 --- a/exampleSite/content/about/_index.md +++ b/exampleSite/content/about/_index.md @@ -24,6 +24,6 @@ Some fun facts about [Hugo](http://gohugo.io/): * Primarily developed by [spf13](http://spf13.com/) on the train while commuting to and from Manhattan. * Coded in [Vim](http://vim.org) using [spf13-vim](http://vim.spf13.com/) -Have questions or suggestions? Feel free to [open an issue on GitHub](https://github.com/spf13/hugo/issues/new) or [ask me on Twitter](https://twitter.com/spf13). +Have questions or suggestions? Feel free to [open an issue on GitHub](https://github.com/spf13/hugo/issues/new) or [ask me on Twitter](https://x.com/spf13). Thanks for reading! diff --git a/exampleSite/content/blog/goisforlovers.md b/exampleSite/content/blog/goisforlovers.md index 56bdd852..c2d63c51 100644 --- a/exampleSite/content/blog/goisforlovers.md +++ b/exampleSite/content/blog/goisforlovers.md @@ -322,7 +322,7 @@ and skips the block if the variable is absent: ``` {{with .Site.Params.TwitterUser}}{{end}} diff --git a/layouts/404.html b/layouts/404.html index 0f999965..a73613d6 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -4,7 +4,11 @@ - +