diff options
author | Indrajith K L | 2022-03-20 00:38:25 +0530 |
---|---|---|
committer | Indrajith K L | 2022-03-20 00:38:25 +0530 |
commit | 941642aee876a97dbb79666d8fabaa2b1feb9ff5 (patch) | |
tree | 6147d3027127466b312eaa0b34c75966743bf547 /themes/terminal/layouts/partials | |
parent | 31fc0796a09e1c0b8acbee6ac2fbee17d525b528 (diff) | |
download | experimentsofindrajith-941642aee876a97dbb79666d8fabaa2b1feb9ff5.tar.gz experimentsofindrajith-941642aee876a97dbb79666d8fabaa2b1feb9ff5.tar.bz2 experimentsofindrajith-941642aee876a97dbb79666d8fabaa2b1feb9ff5.zip |
Theme changes
Diffstat (limited to 'themes/terminal/layouts/partials')
-rw-r--r-- | themes/terminal/layouts/partials/comments.html | 8 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/cover.html | 24 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/extended_footer.html | 4 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/extended_head.html | 4 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/footer.html | 22 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/head.html | 76 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/header.html | 13 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/logo.html | 5 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/menu.html | 60 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/pagination.html | 20 | ||||
-rw-r--r-- | themes/terminal/layouts/partials/posts_pagination.html | 26 |
11 files changed, 262 insertions, 0 deletions
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 @@ +<!-- +To add comments section, please create `layouts/partials/comments.html` in your +Hugo directory and insert: + +{{ template "_internal/disqus.html" . }} + +or whatever comment engine you want -> https://gohugo.io/content-management/comments/#readout +--> 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 -}} + <!-- Cover image found --> + <img src="{{ $cover }}" + class="post-cover" + alt="{{ .Title | plainify | default " " }}" + title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" /> +{{- 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 @@ +<!-- +To add an extended footer section, please create +`layouts/partials/extended_footer.html` in your Hugo directory. +--> 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 @@ +<!-- +To add an extended head section, please create +`layouts/partials/extended_head.html` in your Hugo directory. +--> 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 @@ +<footer class="footer"> + <div class="footer__inner"> + {{ if $.Site.Copyright }} + <div class="copyright copyright--user"> + <span>© {{ now.Year }} {{ $.Site.Copyright | safeHTML }}</span> + {{ else }} + <div class="copyright"> + <span>© {{ now.Year }} Powered by <a href="http://gohugo.io">Hugo</a></span> + {{ end }} + </div> + </div> +</footer> + +<script src="{{ "assets/main.js" | absURL }}"></script> +<script src="{{ "assets/prism.js" | absURL }}"></script> + +{{ if $.Site.Params.showLanguageSelector }} + <script src="{{ "assets/languageSelector.js" | absURL }}"></script> +{{ end }} + +<!-- Extended footer section--> +{{ 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 @@ +<meta http-equiv="content-type" content="text/html; charset=utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<meta name="description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" /> +<meta name="keywords" content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}" /> +<meta name="robots" content="noodp" /> +<link rel="canonical" href="{{ .Permalink }}" /> + +{{ template "_internal/google_analytics.html" . }} + +<!-- Theme CSS --> +<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}"> +{{ if (isset .Params "color") }} + <link rel="stylesheet" href="{{ (printf "assets/%s.css" .Params.color) | absURL }}"> +{{ else if and (ne $.Site.Params.ThemeColor "orange") (ne $.Site.Params.ThemeColor "color" "") }} + <link rel="stylesheet" href="{{ (printf "assets/%s.css" $.Site.Params.ThemeColor) | absURL }}"> +{{ end }} + +<!-- Custom CSS to override theme properties (/static/style.css) --> +{{ if (fileExists "static/style.css") -}} + <link rel="stylesheet" href="{{ "style.css" | absURL }}"> +{{- end }} + +<!-- Icons --> +<link rel="apple-touch-icon" href="{{ "img/apple-touch-icon-192x192.png" | absURL }}"> +{{ if isset $.Site.Params "favicon" }} + <link rel="shortcut icon" href="{{ $.Site.Params.favicon | absURL }}"> +{{ else }} + <link rel="shortcut icon" href="{{ printf "img/favicon/%s.png" ($.Site.Params.ThemeColor | default "orange") | absURL }}"> +{{ end }} + +<!-- Twitter Card --> +<meta name="twitter:card" content="summary" /> +{{ if (isset $.Site.Params "twitter") }} + {{ if (isset $.Site.Params.Twitter "site") }} + <meta name="twitter:site" content="{{ $.Site.Params.Twitter.site }}" /> + {{ end }} + <meta name="twitter:creator" content="{{ if .IsHome }}{{ $.Site.Params.Twitter.creator }}{{ else if isset .Params "authortwitter" }}{{ .Params.authorTwitter }}{{ else }}{{ .Params.Author }}{{ end }}" /> +{{ end }} + +<!-- OG data --> +<meta property="og:locale" content="{{ $.Site.Language.Lang }}" /> +<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> +<meta property="og:title" content="{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }}{{ end }}"> +<meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" /> +<meta property="og:url" content="{{ .Permalink }}" /> +<meta property="og:site_name" content="{{ $.Site.Title }}" /> +{{ if and (not .IsHome) (isset .Params "cover") }} + <meta property="og:image" content="{{ .Param "cover" | absURL }}"> +{{ else }} + {{ if isset $.Site.Params "favicon" }} + <meta property="og:image" content="{{ $.Site.Params.favicon | absURL }}"> + {{ else }} + <meta property="og:image" content="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}"> + {{ end }} +{{ end }} +<meta property="og:image:width" content="2048"> +<meta property="og:image:height" content="1024"> +{{ range .Params.categories }} + <meta property="article:section" content="{{ . }}" /> +{{ end }} +{{ if isset .Params "date" }} + <meta property="article:published_time" content="{{ time .Date }}" /> +{{ end }} + +<!-- RSS --> +{{ with .OutputFormats.Get "RSS" }} + <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" /> +{{ end }} + +<!-- JSON Feed --> +{{ with .OutputFormats.Get "json" }} + <link href="{{ .RelPermalink }}" rel="alternate" type="application/json" title="{{ $.Site.Title }}" /> +{{ end }} + +<!-- Extended head section--> +{{ 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 @@ +<header class="header"> + <div class="header__inner"> + <div class="header__logo"> + {{ partial "logo.html" . }} + </div> + {{ if len $.Site.Menus }} + <div class="menu-trigger">menu</div> + {{ end }} + </div> + {{ if len $.Site.Menus }} + {{ partial "menu.html" . }} + {{ end }} +</header> 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 @@ +<a href="{{ if $.Site.Params.Logo.LogoHomeLink }}{{ $.Site.Params.Logo.LogoHomeLink }}{{else}}{{ $.Site.BaseURL }}{{ end }}"> + <div class="logo"> + {{ with $.Site.Params.Logo.logoText }}{{ . }}{{ else }}Terminal{{ end }} + </div> +</a> 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 @@ +<nav class="menu"> + <ul class="menu__inner menu__inner--desktop"> + {{ if or $.Site.Params.showMenuItems ( eq .Site.Params.showMenuItems 0 ) }} + {{ range first $.Site.Params.showMenuItems $.Site.Menus.main }} + {{ if not .HasChildren }} + <li><a href="{{ .URL }}">{{ .Name }}</a></li> + {{ end }} + {{ end }} + {{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }} + <ul class="menu__sub-inner"> + <li class="menu__sub-inner-more-trigger">{{ $.Site.Params.MenuMore }} ▾</li> + + <ul class="menu__sub-inner-more hidden"> + {{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }} + {{ if not .HasChildren }} + <li><a href="{{ .URL }}">{{ .Name }}</a></li> + {{ end }} + {{ end }} + </ul> + </ul> + {{ end }} + {{ else }} + {{ range $.Site.Menus.main }} + {{ if not .HasChildren }} + <li><a href="{{ .URL }}">{{ .Name }}</a></li> + {{ end }} + {{ end }} + {{ end }} + + {{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }} + <div class="spacer"></div> + <ul class="language-selector"> + <ul class="language-selector-current"> + <li>{{ .Language.LanguageName }} ▾</li> + </ul> + <ul class="language-selector__more hidden"> + {{ range $.Site.Home.AllTranslations }} + <li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li> + {{ end }} + </ul> + </ul> + {{ end }} + </ul> + + <ul class="menu__inner menu__inner--mobile"> + {{ range $.Site.Menus.main }} + {{ if not .HasChildren }} + <li><a href="{{ .URL }}">{{ .Name }}</a></li> + {{ end }} + {{ end }} + {{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }} + <hr /> + {{ range $.Site.Home.AllTranslations }} + <li> + <a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> + </li> + {{ end }} + {{ end }} + </ul> +</nav> 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 @@ +<div class="pagination"> + <div class="pagination__buttons"> + {{ if .Paginator.HasPrev }} + <span class="button previous"> + <a href="{{ .Paginator.Prev.URL }}"> + <span class="button__icon">←</span> + <span class="button__text">{{ $.Site.Params.newerPosts | default "Newer posts" }}</span> + </a> + </span> + {{ end }} + {{ if .Paginator.HasNext }} + <span class="button next"> + <a href="{{ .Paginator.Next.URL }}"> + <span class="button__text">{{ $.Site.Params.olderPosts | default "Older posts" }}</span> + <span class="button__icon">→</span> + </a> + </span> + {{ end }} + </div> +</div> 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 }} +<div class="pagination"> + <div class="pagination__title"> + <span class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts }}</span> + <hr /> + </div> + <div class="pagination__buttons"> + {{ if .NextInSection }} + <span class="button previous"> + <a href="{{ .NextInSection.Permalink }}"> + <span class="button__icon">←</span> + <span class="button__text">{{ .NextInSection.Title }}</span> + </a> + </span> + {{ end }} + {{ if .PrevInSection }} + <span class="button next"> + <a href="{{ .PrevInSection.Permalink }}"> + <span class="button__text">{{ .PrevInSection.Title }}</span> + <span class="button__icon">→</span> + </a> + </span> + {{ end }} + </div> +</div> +{{ end }}
\ No newline at end of file |