diff --git a/config.yml b/config.yml index a9ca86f..f7f29fc 100644 --- a/config.yml +++ b/config.yml @@ -40,3 +40,13 @@ theme: - utils assetDir: static/build/ + +related: + threshold: 80 + includeNewer: false + toLower: false + indices: + - name: keywords + weight: 100 + - name: date + weight: 10 diff --git a/layouts/_default/flickr.html b/layouts/_default/flickr.html index 0f442b1..e18e7de 100644 --- a/layouts/_default/flickr.html +++ b/layouts/_default/flickr.html @@ -24,5 +24,6 @@ {{ partial "share.html" . }} + {{ partial "related-content.html" . }} {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index f704d82..faacd70 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,5 +4,6 @@ {{ partial "content.html" . }} {{ partial "share.html" . }} + {{ partial "related-content.html" . }} {{ end }} diff --git a/layouts/_default/spotify.html b/layouts/_default/spotify.html index d1d947e..aa37d74 100644 --- a/layouts/_default/spotify.html +++ b/layouts/_default/spotify.html @@ -53,5 +53,6 @@ {{ partial "share.html" . }} + {{ partial "related-content.html" . }} {{ end }} diff --git a/layouts/partials/related-content.html b/layouts/partials/related-content.html new file mode 100644 index 0000000..abffc2b --- /dev/null +++ b/layouts/partials/related-content.html @@ -0,0 +1,21 @@ +{{ if .Section }} + {{ $pages := where .Site.RegularPages "Section" .Section }} + + {{ $related := ($pages.Related .) | first 3 }} + + {{ if $related }} + {{ $col := printf "col-md-%d" (div 12 (len $related)) }} + +