From 6c206f713f5dc382409b2101e4d3ebcfcb383db7 Mon Sep 17 00:00:00 2001 From: Erik Osterman Date: Wed, 16 May 2018 17:47:39 -0700 Subject: [PATCH] Use hugo related content --- config.toml | 30 ++++++++++++++++++++ layouts/partials/flex/body-aftercontent.html | 15 +--------- layouts/partials/related.html | 11 +++++++ static/css/custom.css | 26 +++++++---------- 4 files changed, 53 insertions(+), 29 deletions(-) create mode 100644 layouts/partials/related.html diff --git a/config.toml b/config.toml index 3f055db0f..8693112d4 100644 --- a/config.toml +++ b/config.toml @@ -106,3 +106,33 @@ name = " " url = "/documentation/contact-us/" identifier = "nav-contact-us" weight = 70 + + +[related] + +# Only include matches with rank >= threshold. This is a normalized rank between 0 and 100. +threshold = 60 + +# To get stable "See also" sections we, by default, exclude newer related pages. (set to false) +includeNewer = true + +# Will lower case keywords in both queries and in the indexes. +toLower = true + +[[related.indices]] +name = "keywords" +weight = 150 + +[[related.indices]] +name = "author" +toLower = true +weight = 30 + +[[related.indices]] +name = "tags" +weight = 100 + +[[related.indices]] +name = "date" +weight = 10 +pattern = "2006" diff --git a/layouts/partials/flex/body-aftercontent.html b/layouts/partials/flex/body-aftercontent.html index 948d29c66..c6843a40b 100755 --- a/layouts/partials/flex/body-aftercontent.html +++ b/layouts/partials/flex/body-aftercontent.html @@ -1,5 +1,5 @@ {{if not .IsHome}} - + {{ partial "related.html" . }} {{end}} {{if not .IsHome}} @@ -30,19 +30,6 @@

Table of Contents

-
-{{ $footer := print "_footer." .Lang }} -{{ range where .Site.Pages "Source.BaseFileName" $footer }} - {{ .Content }} -{{else}} - {{ if .Site.GetPage "page" "_footer.md" }} - {{(.Site.GetPage "page" "_footer.md").Content}} - {{else}} - {{ T "create-footer-md" }} - {{end}} -{{end}} -
- {{with .Params.LastModifierDisplayName}}
{{ . }} diff --git a/layouts/partials/related.html b/layouts/partials/related.html new file mode 100644 index 000000000..4e06c17ba --- /dev/null +++ b/layouts/partials/related.html @@ -0,0 +1,11 @@ +{{ $related := .Site.RegularPages.Related . | first 5 }} +{{ with $related }} + +{{ end }} diff --git a/static/css/custom.css b/static/css/custom.css index a3042d147..b8c6e250f 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -347,7 +347,7 @@ aside#right-sidebar nav > ul { } aside#right-sidebar nav > ul ul { - list-style: none; + list-style: none; margin-left: 15px; } @@ -811,26 +811,21 @@ div.landing-description { display: none; } -.addthis_relatedposts_inline { - width: 717px; -} -.addthis_relatedposts_inline .at4-recommended .at4-recommended-item { - border: 0px; -} -.addthis-smartlayers .at4-recommended.at-inline .at-h3.at-recommended-label { - color: #555; - font-size: 23px; - font-weight: 600; +#related h4 { + color: #555; + font-size: 23px; + font-weight: bold; } -.addthis-smartlayers .at4-recommended.at-medium .at4-recommended-item { - width: 200px; +#related ul { + list-style-type: none; + line-height: 1.6em; } -.addthis-smartlayers .at4-recommended.at-medium .at4-recommended-item .at4-recommended-item-caption .at-h4 { - font-size: 1em; +#related i { + margin-right: 10px; } div.calendly-badge-widget { @@ -950,6 +945,7 @@ body > footer .footline .tags { body > footer .footline .tags, body > footer .footline .copyright { display: inline-block; float: left; + line-height: 2.2em; } footer .footline .date {