diff options
Diffstat (limited to 'themes/hugo-xmag/layouts/_default')
| -rw-r--r-- | themes/hugo-xmag/layouts/_default/list.html | 52 | ||||
| -rw-r--r-- | themes/hugo-xmag/layouts/_default/single.html | 41 | ||||
| -rw-r--r-- | themes/hugo-xmag/layouts/_default/terms.html | 22 |
3 files changed, 115 insertions, 0 deletions
diff --git a/themes/hugo-xmag/layouts/_default/list.html b/themes/hugo-xmag/layouts/_default/list.html new file mode 100644 index 0000000..5c1ac2c --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/list.html @@ -0,0 +1,52 @@ +{{ partial "header.html" . }} + +<div class="container"> +<main class="list"> +{{ $pages := .Pages }} +{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }} +{{ $paginator := .Paginate (where $pages "Section" "!=" "") }} +{{ range $paginator.Pages }} +<section class="article-list"> + <div class="categories"> + {{ with .Params.categories }} + {{ range first 1 . }} + <a href="{{ relURL (print "/categories/" . | urlize) }}">{{ . }}</a> + {{ end }} + {{ else }} + <a>{{ default "Uncategorized" .Site.Params.text.uncategorized }}</a> + {{ end }} + </div> + <h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1> + <div class="date-author"> + {{ if .Params.author }}<span class="author">{{ partial "author_names.html" . }}</span> / {{ end }} + <span class="date">{{ .Date.Format "2006-01-02" }}</span> + </div> + <div class="summary"> + <a href="{{ .RelPermalink }}"> + {{ with .Resources.GetMatch (printf "%s" .Params.thumbnail) }} + <div class="thumbnail"><img src="{{ relURL .Permalink }}" alt="Thumbnail" /></div> + {{ else }} + {{ with .Params.thumbnail }} + <div class="thumbnail"><img src="{{ relURL .}}" alt="Thumbnail" /></div> + {{ else }} + {{ $img := findRE "<img src=\"[^\"]+\"" .Content 1 }} + {{ range $img }} + <div class="thumbnail">{{ (print . " alt=\"Thumbnail\" />") | safeHTML }}</div> + {{ end }} + {{ end }} + {{ end }} + {{ with .Description }} + {{ $.Scratch.Set "summary" (markdownify .) }} + {{ else }} + {{ $.Scratch.Set "summary" ((delimit (findRE "(<p.*?>(.|\n)*?</p>\\s*)+" .Content) "[…] ") | plainify | truncate (default 200 .Site.Params.summary_length) (default " …" .Site.Params.text.truncated ) | replaceRE "&" "&" | safeHTML) }} + {{ end }} + {{ $.Scratch.Get "summary" }} + </a> + </div> +</section> +{{ end }} +</main> +<nav>{{ template "_internal/pagination.html" . }}</nav> +</div> + +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmag/layouts/_default/single.html b/themes/hugo-xmag/layouts/_default/single.html new file mode 100644 index 0000000..173ec3b --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/single.html @@ -0,0 +1,41 @@ +{{ partial "header.html" . }} +<div class="container"> +<article> +<div class="article-meta"> + + <div class="categories"> + {{ range $i, $e := .Params.categories }} + {{ if $i }} ⊹ {{ end }}<a href="{{ relURL (print "/categories/" $e | urlize) }}">{{ $e }}</a> + {{ end }} + </div> + + <h1><span class="title">{{ .Title }}</span></h1> + + {{ if .Params.author }} + <h3 class="author">{{ partial "author_names.html" . }}</h3> + {{ end }} + + {{ with .Params.tags }} + <p>{{ default "Tags: " (index $.Site.Params.text "tags") }}{{ range $i, $e := . }}{{ if $i }}; {{ end }}<a href="{{ relURL (print "/tags/" $e | urlize) }}">{{ $e }}</a>{{ end }} + </p> + {{ end }} + {{ partial "meta.html" . }} + +</div> + +{{ if .Params.toc }} +{{ .TableOfContents }} +{{ end }} + +<main> +{{ .Content }} +</main> + +{{ partial "author.html" . }} +{{ partial "info.html" . }} +{{ partial "prev_next.html" . }} +{{ partial "comments.html" . }} +</article> +</div> + +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmag/layouts/_default/terms.html b/themes/hugo-xmag/layouts/_default/terms.html new file mode 100644 index 0000000..2f432ed --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/terms.html @@ -0,0 +1,22 @@ +{{ partial "header.html" . }} + +<div class="container"> +<article> +<main> +<h1>{{ $.Scratch.Get "Title" }}</h1> + +<ul class="terms"> + {{ range $key, $value := .Data.Terms }} + <li> + <a href="{{ (print "/" $.Data.Plural "/" $key) | relURL }}"> + {{ $key }} + </a> + ({{ len $value }}) + </li> + {{ end }} +</ul> +</main> +</article> +</div> + +{{ partial "footer.html" . }} |
