From 941642aee876a97dbb79666d8fabaa2b1feb9ff5 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sun, 20 Mar 2022 00:38:25 +0530 Subject: Theme changes --- themes/terminal/layouts/404.html | 10 +++ themes/terminal/layouts/_default/baseof.html | 27 ++++++++ themes/terminal/layouts/_default/index.html | 65 ++++++++++++++++++ themes/terminal/layouts/_default/list.html | 55 ++++++++++++++++ themes/terminal/layouts/_default/rss.xml | 40 ++++++++++++ themes/terminal/layouts/_default/single.html | 54 +++++++++++++++ themes/terminal/layouts/_default/terms.html | 17 +++++ themes/terminal/layouts/partials/comments.html | 8 +++ themes/terminal/layouts/partials/cover.html | 24 +++++++ .../terminal/layouts/partials/extended_footer.html | 4 ++ .../terminal/layouts/partials/extended_head.html | 4 ++ themes/terminal/layouts/partials/footer.html | 22 +++++++ themes/terminal/layouts/partials/head.html | 76 ++++++++++++++++++++++ themes/terminal/layouts/partials/header.html | 13 ++++ themes/terminal/layouts/partials/logo.html | 5 ++ themes/terminal/layouts/partials/menu.html | 60 +++++++++++++++++ themes/terminal/layouts/partials/pagination.html | 20 ++++++ .../layouts/partials/posts_pagination.html | 26 ++++++++ themes/terminal/layouts/shortcodes/code.html | 15 +++++ themes/terminal/layouts/shortcodes/figure.html | 8 +++ themes/terminal/layouts/shortcodes/image.html | 3 + themes/terminal/layouts/shortcodes/prismjs.html | 25 +++++++ 22 files changed, 581 insertions(+) create mode 100644 themes/terminal/layouts/404.html create mode 100644 themes/terminal/layouts/_default/baseof.html create mode 100644 themes/terminal/layouts/_default/index.html create mode 100644 themes/terminal/layouts/_default/list.html create mode 100644 themes/terminal/layouts/_default/rss.xml create mode 100644 themes/terminal/layouts/_default/single.html create mode 100644 themes/terminal/layouts/_default/terms.html create mode 100644 themes/terminal/layouts/partials/comments.html create mode 100644 themes/terminal/layouts/partials/cover.html create mode 100644 themes/terminal/layouts/partials/extended_footer.html create mode 100644 themes/terminal/layouts/partials/extended_head.html create mode 100644 themes/terminal/layouts/partials/footer.html create mode 100644 themes/terminal/layouts/partials/head.html create mode 100644 themes/terminal/layouts/partials/header.html create mode 100644 themes/terminal/layouts/partials/logo.html create mode 100644 themes/terminal/layouts/partials/menu.html create mode 100644 themes/terminal/layouts/partials/pagination.html create mode 100644 themes/terminal/layouts/partials/posts_pagination.html create mode 100644 themes/terminal/layouts/shortcodes/code.html create mode 100644 themes/terminal/layouts/shortcodes/figure.html create mode 100644 themes/terminal/layouts/shortcodes/image.html create mode 100644 themes/terminal/layouts/shortcodes/prismjs.html (limited to 'themes/terminal/layouts') diff --git a/themes/terminal/layouts/404.html b/themes/terminal/layouts/404.html new file mode 100644 index 0000000..e680954 --- /dev/null +++ b/themes/terminal/layouts/404.html @@ -0,0 +1,10 @@ +{{ define "main" }} +
+

404 — {{ $.Site.Params.missingContentMessage | default "Page not found..." }}

+ +
+ {{ $.Site.Params.missingBackButtonLabel | default "Back to home page" }} → +
+ +
+{{ end }} 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 @@ + + + + {{ block "title" . }} + {{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} :: {{ $.Site.Title }}{{ end }} + {{ end }} + {{ partial "head.html" . }} + + +{{ $container := cond ($.Site.Params.FullWidthTheme | default false) "container full" (cond ($.Site.Params.CenterTheme | default false) "container center" "container") }} + +
+ + {{ partial "header.html" . }} + +
+ {{ block "main" . }} + {{ end }} +
+ + {{ block "footer" . }} + {{ partial "footer.html" . }} + {{ end }} +
+ + + 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 }} +
+ {{ .Content }} +
+ {{ end }} +
+ {{ $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 }} +
+

+ {{ .Title | markdownify }} +

+ + + {{ if .Params.tags }} + + {{ end }} + + + {{ partial "cover.html" . }} + + +
+ {{ if .Params.showFullContent }} + {{ .Content }} + {{ else if .Description }} + {{ .Description | markdownify }} + {{ else }} + {{ .Summary | markdownify }} + {{ end }} +
+ + {{ if not .Params.showFullContent }} +
+ {{ $.Site.Params.ReadMore }} → +
+ {{ end }} +
+ {{ end }} + {{ partial "pagination.html" . }} +
+{{ 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 }} +
+ {{ . }} +
+ {{ end }} +
+ {{ range .Paginator.Pages }} +
+

+ {{ .Title | markdownify }} +

+ + + {{ if .Params.tags }} + + {{ end }} + + {{ partial "cover.html" . }} + + +
+ {{ if .Params.showFullContent }} + {{ .Content }} + {{ else if .Description }} + {{ .Description | markdownify }} + {{ else }} + {{ .Summary | markdownify }} + {{ end }} +
+ + {{ if not .Params.showFullContent }} +
+ {{ $.Site.Params.ReadMore }} → +
+ {{ end }} +
+ {{ end }} + {{ partial "pagination.html" . }} +
+{{ 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 "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Summary | html }} + {{ .Content | html }} + + {{ end }} + + 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" }} +
+

+ {{ .Title | markdownify }}

+
+ {{ if .Params.Date }} + + {{ end }} + {{ with .Params.Author }} + + {{ end }} + {{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }} + :: {{ .ReadingTime }} min read ({{ .WordCount }} words) + {{ end }} +
+ + {{ if .Params.tags }} + + {{ range .Params.tags }} + #{{ . }}  + {{ end }} + + {{ end }} + {{ partial "cover.html" . }} + + {{ if (.Params.Toc | default .Site.Params.Toc) }} +
+

+ {{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }} +

+ {{ .TableOfContents }} +
+ {{ end }} + +
+ {{- with .Content -}} +
+ {{ . | replaceRE "()" `${1} ${3}` | safeHTML }} +
+ {{- end -}} +
+ + {{ if eq .Type $.Site.Params.contentTypeName }} + {{ partial "posts_pagination.html" . }} + {{ end }} + + {{ partial "comments.html" . }} +
+{{ 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" }} +
+

{{ .Title }}

+ +
+{{ end }} diff --git a/themes/terminal/layouts/partials/comments.html b/themes/terminal/layouts/partials/comments.html new file mode 100644 index 0000000..64f5a64 --- /dev/null +++ b/themes/terminal/layouts/partials/comments.html @@ -0,0 +1,8 @@ + diff --git a/themes/terminal/layouts/partials/cover.html b/themes/terminal/layouts/partials/cover.html new file mode 100644 index 0000000..ea562ea --- /dev/null +++ b/themes/terminal/layouts/partials/cover.html @@ -0,0 +1,24 @@ +{{- $cover := false -}} +{{- $autoCover := default $.Site.Params.autoCover false }} + +{{- if index .Params "cover" -}} + {{- if .Resources.GetMatch .Params.Cover }} + {{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}} + {{- else -}} + {{- $cover = absURL .Params.Cover -}} + {{- end -}} +{{- else if $.Site.Params.AutoCover -}} + {{- if (not .Params.Cover) -}} + {{- if .Resources.GetMatch "cover.*" -}} + {{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{if $cover -}} + + {{ .Title | plainify | default +{{- end }} diff --git a/themes/terminal/layouts/partials/extended_footer.html b/themes/terminal/layouts/partials/extended_footer.html new file mode 100644 index 0000000..1ef9361 --- /dev/null +++ b/themes/terminal/layouts/partials/extended_footer.html @@ -0,0 +1,4 @@ + diff --git a/themes/terminal/layouts/partials/extended_head.html b/themes/terminal/layouts/partials/extended_head.html new file mode 100644 index 0000000..69baf1f --- /dev/null +++ b/themes/terminal/layouts/partials/extended_head.html @@ -0,0 +1,4 @@ + diff --git a/themes/terminal/layouts/partials/footer.html b/themes/terminal/layouts/partials/footer.html new file mode 100644 index 0000000..e2588eb --- /dev/null +++ b/themes/terminal/layouts/partials/footer.html @@ -0,0 +1,22 @@ + + + + + +{{ if $.Site.Params.showLanguageSelector }} + +{{ end }} + + +{{ partial "extended_footer.html" . }} diff --git a/themes/terminal/layouts/partials/head.html b/themes/terminal/layouts/partials/head.html new file mode 100644 index 0000000..48f2d28 --- /dev/null +++ b/themes/terminal/layouts/partials/head.html @@ -0,0 +1,76 @@ + + + + + + + +{{ template "_internal/google_analytics.html" . }} + + + +{{ if (isset .Params "color") }} + +{{ else if and (ne $.Site.Params.ThemeColor "orange") (ne $.Site.Params.ThemeColor "color" "") }} + +{{ end }} + + +{{ if (fileExists "static/style.css") -}} + +{{- end }} + + + +{{ if isset $.Site.Params "favicon" }} + +{{ else }} + +{{ end }} + + + +{{ if (isset $.Site.Params "twitter") }} + {{ if (isset $.Site.Params.Twitter "site") }} + + {{ end }} + +{{ end }} + + + + + + + + +{{ if and (not .IsHome) (isset .Params "cover") }} + +{{ else }} + {{ if isset $.Site.Params "favicon" }} + + {{ else }} + + {{ end }} +{{ end }} + + +{{ range .Params.categories }} + +{{ end }} +{{ if isset .Params "date" }} + +{{ end }} + + +{{ with .OutputFormats.Get "RSS" }} + +{{ end }} + + +{{ with .OutputFormats.Get "json" }} + +{{ end }} + + +{{ partial "extended_head.html" . }} diff --git a/themes/terminal/layouts/partials/header.html b/themes/terminal/layouts/partials/header.html new file mode 100644 index 0000000..23214f8 --- /dev/null +++ b/themes/terminal/layouts/partials/header.html @@ -0,0 +1,13 @@ +
+
+ + {{ if len $.Site.Menus }} + + {{ end }} +
+ {{ if len $.Site.Menus }} + {{ partial "menu.html" . }} + {{ end }} +
diff --git a/themes/terminal/layouts/partials/logo.html b/themes/terminal/layouts/partials/logo.html new file mode 100644 index 0000000..8a1bf1f --- /dev/null +++ b/themes/terminal/layouts/partials/logo.html @@ -0,0 +1,5 @@ + + + diff --git a/themes/terminal/layouts/partials/menu.html b/themes/terminal/layouts/partials/menu.html new file mode 100644 index 0000000..17d39c8 --- /dev/null +++ b/themes/terminal/layouts/partials/menu.html @@ -0,0 +1,60 @@ + diff --git a/themes/terminal/layouts/partials/pagination.html b/themes/terminal/layouts/partials/pagination.html new file mode 100644 index 0000000..777a6b4 --- /dev/null +++ b/themes/terminal/layouts/partials/pagination.html @@ -0,0 +1,20 @@ + diff --git a/themes/terminal/layouts/partials/posts_pagination.html b/themes/terminal/layouts/partials/posts_pagination.html new file mode 100644 index 0000000..04951d5 --- /dev/null +++ b/themes/terminal/layouts/partials/posts_pagination.html @@ -0,0 +1,26 @@ +{{ if or .NextInSection .PrevInSection }} + +{{ end }} \ No newline at end of file diff --git a/themes/terminal/layouts/shortcodes/code.html b/themes/terminal/layouts/shortcodes/code.html new file mode 100644 index 0000000..8bab825 --- /dev/null +++ b/themes/terminal/layouts/shortcodes/code.html @@ -0,0 +1,15 @@ +{{ $id := delimit (shuffle (seq 1 9)) "" }} + +{{ if .Get "language" }} +
+ + +
{{ .Inner | string }}
+
+{{ else }} + {{ errorf "If you want to use the \"collapsable code\" shortcode, you need to pass a mandatory \"language\" param. The issue occured in %q (%q)" .Page.File .Page.Permalink }} +{{ end }} diff --git a/themes/terminal/layouts/shortcodes/figure.html b/themes/terminal/layouts/shortcodes/figure.html new file mode 100644 index 0000000..6642c82 --- /dev/null +++ b/themes/terminal/layouts/shortcodes/figure.html @@ -0,0 +1,8 @@ +{{ if .Get "src" }} +
+ {{ . | plainify }} + {{ if .Get "caption" }} +
{{ .Get "caption" | safeHTML }}
+ {{ end }} +
+{{ end }} diff --git a/themes/terminal/layouts/shortcodes/image.html b/themes/terminal/layouts/shortcodes/image.html new file mode 100644 index 0000000..6b2a2c0 --- /dev/null +++ b/themes/terminal/layouts/shortcodes/image.html @@ -0,0 +1,3 @@ +{{ if .Get "src" }} + {{ . | plainify }} +{{ end }} diff --git a/themes/terminal/layouts/shortcodes/prismjs.html b/themes/terminal/layouts/shortcodes/prismjs.html new file mode 100644 index 0000000..e4acffe --- /dev/null +++ b/themes/terminal/layouts/shortcodes/prismjs.html @@ -0,0 +1,25 @@ +{{ $inner := replaceRE "^\r?\n" "" .Inner | string }} +{{ if len .Params | eq 0 }} +
{{ $inner }}
+{{ else }} + {{ if .IsNamedParams }} +
{{ $inner }}
+ {{ else }} +
+      {{ $inner }}
+ {{ end }} +{{ end }} -- cgit v1.2.3