6.5 KiB
date: 2017-09-11 title: "Hugo 0.27: Fast and Flexible Related Content!" description: "Makes it easy to add "See Also" sections etc. to your site." categories: ["Releases"] images:
- images/blog/hugo-27-poster.png
Hugo 0.27
comes with fast and flexible Related Content (3b4f17bb @bep #98). To add this to your site, put something like this in your single page template:
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<h3>See Also</h3>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
The above translates to list the five regular pages mostly related to the current page. See the Related Content Documentation for details and configuration options.
This release represents 37 contributions by 9 contributors to the main Hugo code base.
@bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @moorereason, @yihui, and @oneleaftea for their ongoing contributions.
And as always a big thanks to @digitalcraftsman for his relentless work on keeping the documentation and the themes site in pristine condition.
Many have also been busy writing and fixing the documentation in hugoDocs, which has received 44 contributions by 30 contributors. A special thanks to @bep, @sdomino, @gotgenes, and @digitalcraftsman for their work on the documentation site.
Hugo now has:
- 19464+ stars
- 455+ contributors
- 178+ themes
Notes
- We now only strip p tag in
markdownify
if there is only one paragraph. This allows blocks of paragraphs to be "markdownified" 33ae10b6 @bep #3040
Enhancements
Templates
- Add
time.Duration
andtime.ParseDuration
template funcs f4bf2141 @bep #3828 - Add
cond
(ternary) template func 0462c96a @bep #3860 - Prepare for template metrics d000cf60 @bep
- Add
strings.TrimLeft
andTrimRight
7674ad73 @moorereason - compare, hugolib, tpl: Add
Eqer
interface 08f48b91 @bep #3807 - Only strip p tag in
markdownify
if only one paragraph 33ae10b6 @bep #3040 - Cleanup
strings.TrimPrefix
andTrimSuffix
29a2da05 @moorereason
Output
Core
- Implement "related content" 3b4f17bb @bep #98
- Add
Page.Equals
f0f49ed9 @bep - Rewrite
replaceDivider
to reduce memory allocation 71ae9b45 @bep
Other
- Set up Hugo release flow on
CircleCI
d2249c50 @bep #3779 - Maintain the scroll position if possible 7231d5a8 @yihui #3824
- Add an
iFrame
title to theYouTube
shortcode 919bc921 @nraboy - Remove the theme submodule from /docs ea2cc26b @bep #3791
- Add support for multiple config files via
--config a.toml,b.toml,c.toml
0f9f73cc @jgielstra - Render task list item inside
label
for correct accessibility c8257f8b @danieka #3303 - Normalize
UniqueID
between Windows & Linux 0abdeeef @Shywim