diff options
author | Baron Schwartz <xaprb@users.noreply.github.com> | 2019-01-27 03:22:29 +0300 |
---|---|---|
committer | Baron Schwartz <xaprb@users.noreply.github.com> | 2019-01-27 03:22:29 +0300 |
commit | 3152c0a37f92ccc6d36ad76143151d2a25f820ed (patch) | |
tree | f344cbfe4a22cd5ea376829a666a7b448f2a22c5 | |
parent | e83e61d1d96b8717b75d33821d686ee71428eca2 (diff) |
Add archives for #49
-rw-r--r-- | exampleSite/config.toml | 5 | ||||
-rw-r--r-- | exampleSite/content/archives/_index.md | 9 | ||||
-rw-r--r-- | exampleSite/content/other-features.md | 3 | ||||
-rw-r--r-- | layouts/_default/archives.html | 24 |
4 files changed, 40 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 15e28ed..47cdf2b 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -19,6 +19,11 @@ buildFuture = true title = "Slides" url = "/slides/" +[[menu.main]] + name = "Archives" + title = "Archives" + url = "/archives/" + [params] author = "Baron Schwartz" twitter = "xaprb" diff --git a/exampleSite/content/archives/_index.md b/exampleSite/content/archives/_index.md new file mode 100644 index 0000000..90f2c23 --- /dev/null +++ b/exampleSite/content/archives/_index.md @@ -0,0 +1,9 @@ +--- +layout: archives +url: /archives/ +title: Archives +classes: +- feature-nosubtitle +- feature-nohdr +- feature-depth +--- diff --git a/exampleSite/content/other-features.md b/exampleSite/content/other-features.md index 01a52d5..661f87d 100644 --- a/exampleSite/content/other-features.md +++ b/exampleSite/content/other-features.md @@ -39,10 +39,11 @@ Story also has support for the following, which aren't extensively documented: place to put information about your presentations, including links to videos, the location, slides, and so on. `/talks/` and `/slides/` are the only two content types for which Story has special formatting and archetypes. +- An archive listing page, which uses the `archives` layout analogously to the [search](/search-page) feature - 404 error page - Social-media meta tags to make your content look great when shared on social media sites -- Hiding content from default lists, but generating HTML pages for it +- Using `skip` to hide content from default lists, but generating HTML pages for it - Meta keywords - Font Awesome icon fonts - Custom header meta tags with any content you want diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html new file mode 100644 index 0000000..9f60f96 --- /dev/null +++ b/layouts/_default/archives.html @@ -0,0 +1,24 @@ +{{ define "title" }}Archives • {{ .Site.Title }}{{ end }} + +{{ define "main" }} +<section class="center bg-white br-3 pv1 ph4 nested-copy-line-height lh-copy f4 nested-links mw-100 measure-wide"> + {{- range $i, $p := .Site.RegularPages -}} + {{- $thisYear := $p.Date.Format "2006" }} + {{- $lastPage := $i | add -1 | index .Site.RegularPages }} + {{- if or (eq $i 0) ( ne ($lastPage.Date.Format "2006") $thisYear ) }} + <h3 class="archive-year">{{ $thisYear }}</h3> + {{- end }} + + <div> + {{ $p.Date.Format "01-02" }} + <a href="{{ $p.Permalink }}" class="no-underline dim link"> + {{- cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) -}} + </a> + </div> + {{- end -}} +</section> +{{ end }} + +{{ define "pagination" }} +<br> +{{ end }}
\ No newline at end of file |