Skip to content
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
12 changes: 10 additions & 2 deletions doc/content/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,16 @@ The first post from `/content/en/news` will be highlighted on the
front page. If you don't want that, remove the `/content/en/news`
folder.

By default, news items link to the `/news` category page (which lists all news items).
You can override that by setting `newsLink` in the preamble of any news post.
By default, news items link to the `/news` category page (which lists
all news items). You can override that by setting `newsLink` in the
preamble of any news post.

### Single page news

If you prefer to list all your news items on one page, you may do so
in `/news.md`, instead of adding posts to `/news`. Set the
`newsHeader` parameter in the preamble of that document to populate
the banner on the front page.

## Team gallery

Expand Down
8 changes: 5 additions & 3 deletions layouts/partials/news.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{ range first 1 (where .Site.RegularPages "Section" "news") }}
{{ range first 1 (or (where .Site.RegularPages "Section" "news") (slice (.Site.GetPage "news"))) }}
{{ $newsLink := default "/news" .Params.newsLink }}
{{ $newsHeader := default .Title .Params.newsHeader }}
{{ $date := .Date.Format "2006-01-02" }}
<div class="news-container">
<div class="news-title"><a href="{{ relURL $newsLink }}"> {{ .Title }}</a></div>
<div class="news-date"><a href="{{ relURL $newsLink }}">{{ .Date.Format "2006-01-02" }}</a></div>
<div class="news-title"><a href="{{ relURL $newsLink }}"> {{ $newsHeader }}</a></div>
<div class="news-date"><a href="{{ relURL $newsLink }}">{{ $date }}</a></div>
</div>
{{ end }}