Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hugo related content #63

Merged
merged 1 commit into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,33 @@ name = "<i class='fa fa-envelope'></i> <label>Contact Us</label>"
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"
15 changes: 1 addition & 14 deletions layouts/partials/flex/body-aftercontent.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{if not .IsHome}}
<div class="addthis_relatedposts_inline"></div>
{{ partial "related.html" . }}
{{end}}

{{if not .IsHome}}
Expand Down Expand Up @@ -30,19 +30,6 @@ <h3><i class="fa fa-align-left"></i>Table of Contents</h3>

<div class="copyright"> © {{ now.Format "2006"}} Cloud Posse, LLC. <a rel="license" href="/license/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a></div>

<div class="custom">
{{ $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}}
</div>

{{with .Params.LastModifierDisplayName}}
<div class="author">
<i class='fa fa-user'></i> <a href="mailto:{{ $.Params.LastModifierEmail }}">{{ . }}</a>
Expand Down
11 changes: 11 additions & 0 deletions layouts/partials/related.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<div id="related">
<h4>See Also</h4>
<ul>
{{ range . }}
<li><i class="fa fa-chevron-right"></i><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</div>
{{ end }}
26 changes: 11 additions & 15 deletions static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ aside#right-sidebar nav > ul {
}

aside#right-sidebar nav > ul ul {
list-style: none;
list-style: none;
margin-left: 15px;
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down