diff options
Diffstat (limited to 'themes/terminal/layouts/_default')
-rw-r--r-- | themes/terminal/layouts/_default/baseof.html | 27 | ||||
-rw-r--r-- | themes/terminal/layouts/_default/index.html | 65 | ||||
-rw-r--r-- | themes/terminal/layouts/_default/list.html | 55 | ||||
-rw-r--r-- | themes/terminal/layouts/_default/rss.xml | 40 | ||||
-rw-r--r-- | themes/terminal/layouts/_default/single.html | 54 | ||||
-rw-r--r-- | themes/terminal/layouts/_default/terms.html | 17 |
6 files changed, 258 insertions, 0 deletions
diff --git a/themes/terminal/layouts/_default/baseof.html b/themes/terminal/layouts/_default/baseof.html new file mode 100644 index 0000000..ae3b9cc --- /dev/null +++ b/themes/terminal/layouts/_default/baseof.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html lang="{{ $.Site.Language }}"> +<head> + {{ block "title" . }} + <title>{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} :: {{ $.Site.Title }}{{ end }}</title> + {{ end }} + {{ partial "head.html" . }} +</head> +<body class="{{- ( or .Params.color $.Site.Params.ThemeColor ) -}}"> +{{ $container := cond ($.Site.Params.FullWidthTheme | default false) "container full" (cond ($.Site.Params.CenterTheme | default false) "container center" "container") }} + +<div class="{{- $container -}}{{- cond ($.Site.Params.oneHeadingSize | default true) " headings--one-size" "" }}"> + + {{ partial "header.html" . }} + + <div class="content"> + {{ block "main" . }} + {{ end }} + </div> + + {{ block "footer" . }} + {{ partial "footer.html" . }} + {{ end }} +</div> + +</body> +</html> diff --git a/themes/terminal/layouts/_default/index.html b/themes/terminal/layouts/_default/index.html new file mode 100644 index 0000000..1cab615 --- /dev/null +++ b/themes/terminal/layouts/_default/index.html @@ -0,0 +1,65 @@ +{{ define "main" }} + {{ if .Content }} + <div class="index-content {{ if .Params.framed -}}framed{{- end -}}"> + {{ .Content }} + </div> + {{ end }} + <div class="posts"> + {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} + {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} + + {{ $PageContext := . }} + {{ if .IsHome }} + {{ $PageContext = .Site }} + {{ end }} + {{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} + + {{ range $paginator.Pages }} + <div class="post on-list"> + <h1 class="post-title"> + <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> + </h1> + <div class="post-meta"> + <span class="post-date"> + {{ .Date.Format "2006-01-02" }} + </span> + {{ with .Params.Author }} + <span class="post-author">:: {{ . }}</span> + {{ end }} + </div> + + {{ if .Params.tags }} + <span class="post-tags"> + {{ range .Params.tags }} + #<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}"> + {{- . -}} + </a> + {{ end }} + </span> + {{ end }} + + + {{ partial "cover.html" . }} + + + <div class="post-content"> + {{ if .Params.showFullContent }} + {{ .Content }} + {{ else if .Description }} + {{ .Description | markdownify }} + {{ else }} + {{ .Summary | markdownify }} + {{ end }} + </div> + + {{ if not .Params.showFullContent }} + <div> + <a class="read-more button" + href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a> + </div> + {{ end }} + </div> + {{ end }} + {{ partial "pagination.html" . }} + </div> +{{ end }} diff --git a/themes/terminal/layouts/_default/list.html b/themes/terminal/layouts/_default/list.html new file mode 100644 index 0000000..02f69b4 --- /dev/null +++ b/themes/terminal/layouts/_default/list.html @@ -0,0 +1,55 @@ +{{ define "main" }} + {{ with .Content }} + <div class="index-content"> + {{ . }} + </div> + {{ end }} + <div class="posts"> + {{ range .Paginator.Pages }} + <div class="post on-list"> + <h1 class="post-title"> + <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> + </h1> + <div class="post-meta"> + <span class="post-date"> + {{ .Date.Format "2006-01-02" }} + </span> + {{ with .Params.Author }} + <span class="post-author">:: {{ . }}</span> + {{ end }} + </div> + + {{ if .Params.tags }} + <span class="post-tags"> + {{ range .Params.tags }} + #<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}"> + {{- . -}} + </a> + {{ end }} + </span> + {{ end }} + + {{ partial "cover.html" . }} + + + <div class="post-content"> + {{ if .Params.showFullContent }} + {{ .Content }} + {{ else if .Description }} + {{ .Description | markdownify }} + {{ else }} + {{ .Summary | markdownify }} + {{ end }} + </div> + + {{ if not .Params.showFullContent }} + <div> + <a class="read-more button" + href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a> + </div> + {{ end }} + </div> + {{ end }} + {{ partial "pagination.html" . }} + </div> +{{ end }} diff --git a/themes/terminal/layouts/_default/rss.xml b/themes/terminal/layouts/_default/rss.xml new file mode 100644 index 0000000..65aa855 --- /dev/null +++ b/themes/terminal/layouts/_default/rss.xml @@ -0,0 +1,40 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> + <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} + <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} + <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} + <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{ .Summary | html }}</description> + <content>{{ .Content | html }}</content> + </item> + {{ end }} + </channel> +</rss> diff --git a/themes/terminal/layouts/_default/single.html b/themes/terminal/layouts/_default/single.html new file mode 100644 index 0000000..3d375ad --- /dev/null +++ b/themes/terminal/layouts/_default/single.html @@ -0,0 +1,54 @@ +{{ define "main" }} +<div class="post"> + <h1 class="post-title"> + <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> + <div class="post-meta"> + {{ if .Params.Date }} + <span class="post-date"> + {{ .Date.Format "2006-01-02" }} + {{ if $.Site.Params.showLastUpdated }} + [{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}] + {{ end }} + </span> + {{ end }} + {{ with .Params.Author }} + <span class="post-author">:: {{ . }}</span> + {{ end }} + {{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }} + <span class="post-reading-time">:: {{ .ReadingTime }} min read ({{ .WordCount }} words)</span> + {{ end }} + </div> + + {{ if .Params.tags }} + <span class="post-tags"> + {{ range .Params.tags }} + #<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a> + {{ end }} + </span> + {{ end }} + {{ partial "cover.html" . }} + + {{ if (.Params.Toc | default .Site.Params.Toc) }} + <div class="table-of-contents"> + <h2> + {{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }} + </h2> + {{ .TableOfContents }} + </div> + {{ end }} + + <div class="post-content"> + {{- with .Content -}} + <div> + {{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">⌗</a> ${3}` | safeHTML }} + </div> + {{- end -}} + </div> + + {{ if eq .Type $.Site.Params.contentTypeName }} + {{ partial "posts_pagination.html" . }} + {{ end }} + + {{ partial "comments.html" . }} +</div> +{{ end }} diff --git a/themes/terminal/layouts/_default/terms.html b/themes/terminal/layouts/_default/terms.html new file mode 100644 index 0000000..399d665 --- /dev/null +++ b/themes/terminal/layouts/_default/terms.html @@ -0,0 +1,17 @@ +{{ define "main" }} + <div class="terms"> + <h1>{{ .Title }}</h1> + <ul> + {{ $type := .Type }} + {{ range $key, $value := .Data.Terms.Alphabetical }} + {{ $name := .Name }} + {{ $count := .Count }} + {{ with $.Site.GetPage (printf "/%s/%s" $type $name) }} + <li> + <a class="terms-title" href="{{ .Permalink }}">{{ .Name }} ({{ $count }})</a> + </li> + {{ end }} + {{ end }} + </ul> + </div> +{{ end }} |