diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-01 11:56:29 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-01 11:56:29 +0200 |
| commit | 4c3f5c2b8c890be8798d1bf25205d8249fe8faec (patch) | |
| tree | c8ca654c9e87420b565a2ba976e0a0adfbc8775f /layouts | |
| parent | a135e9bc110cb3337101e7e9d6d29c391430b0fc (diff) | |
| download | gohugo-theme-ed-4c3f5c2b8c890be8798d1bf25205d8249fe8faec.tar.gz | |
Use site function instead of .Site or $.Site
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/baseof.html | 6 | ||||
| -rw-r--r-- | layouts/index.html | 2 | ||||
| -rw-r--r-- | layouts/partials/head.html | 6 | ||||
| -rw-r--r-- | layouts/partials/sidebar.html | 8 |
4 files changed, 11 insertions, 11 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 9ba6cf0..98a05bf 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,14 +1,14 @@ <!DOCTYPE html> <html lang="{{ site.LanguageCode | default site.Language.Lang }}" {{- with partialCached "func/GetLanguageDirection" "GetLanguageDirection" }} dir="{{ . }}" {{- end }}> {{- partial "head.html" . -}} - <body class="theme-base-{{ .Site.Params.color_scheme }}"> + <body class="theme-base-{{ site.Params.color_scheme }}"> {{ if .Params.toc }}{{ partial "sidebar-toc.html" . }}{{ else }}{{ partial "sidebar.html" . }}{{ end }} <div class="wrap"> <header class="masthead"> <div class="container"> <h3 class="masthead-title"> - <a href="{{ .Site.Home.RelPermalink }}" title="Home">{{ .Site.Title }}</a> - <br><small>{{ .Site.Params.tagline }}</small> + <a href="{{ site.Home.RelPermalink }}" title="Home">{{ site.Title }}</a> + <br><small>{{ site.Params.tagline }}</small> </h3> </div> </header> diff --git a/layouts/index.html b/layouts/index.html index 16d16c7..e051c4d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -9,7 +9,7 @@ <div class="toc"> <h2>Latest Publications</h2> <ul class="texts"> - {{ range first 10 (where .Site.RegularPages "Section" "!=" "" ) }} + {{ range first 10 (where site.RegularPages "Section" "!=" "" ) }} <li class="text-title"> <a href="{{ .Permalink }}">{{ .Title }}</a> </li> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 5c76d9f..f4303e1 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -2,7 +2,7 @@ <head prefix="og: http://ogp.me/ns#; dc: http://purl.org/dc/terms/#"> {{- $description := print .Params.Description -}} {{- if or .IsHome (eq .Params.Description "") (not .Params.Description) -}} - {{ $description = .Site.Params.Description }} + {{ $description = site.Params.Description }} {{- end -}} <meta charset="utf-8"> @@ -11,7 +11,7 @@ <link rel="canonical" href="{{ .Permalink }}"> - <title>{{ block "title" . }}{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Params.Title }}{{ . }} - {{ end }}{{ .Site.Title }}{{ end }}{{ end }}</title> + <title>{{ block "title" . }}{{ if .IsHome }}{{ site.Title }}{{ else }}{{ with .Params.Title }}{{ . }} - {{ end }}{{ site.Title }}{{ end }}{{ end }}</title> <meta name="description" content="{{ $description }}"> <meta name="author" content="{{ (partial "author.html" . ) }}"> {{ hugo.Generator }} @@ -23,7 +23,7 @@ {{- if .Params.editor }}<meta property="dc:contributor" content="{{ .Params.editor }}">{{ end }} {{- if .Params.date }}<meta property="dc:date" content="{{ .Params.date }}">{{ end }} {{- if .Params.rights }}<meta property="dc:rights" content="{{ .Params.rights }}">{{ end }} - <meta property="dc:source" content="{{ if .Params.source }}{{ .Params.source }}{{ else }}{{ .Site.Title }}{{ end }}"> + <meta property="dc:source" content="{{ if .Params.source }}{{ .Params.source }}{{ else }}{{ site.Title }}{{ end }}"> {{- /* Misc */}} {{template "partials/templates/opengraph.html" . }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 8178537..70f0b81 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -4,15 +4,15 @@ <!-- Toggleable sidebar --> <aside class="sidebar" id="sidebar"> <div class="sidebar-item"> - <p>{{- .Site.Params.Description -}}</p> + <p>{{- site.Params.Description -}}</p> </div> <nav class="sidebar-nav"> - <a class="sidebar-nav-item{{- if .IsHome }} active{{ end -}}" href="{{ .Site.Home.RelPermalink }}">Home</a> + <a class="sidebar-nav-item{{- if .IsHome }} active{{ end -}}" href="{{ site.Home.RelPermalink }}">Home</a> {{- $current := . }} {{- /* TODO: Render items dynamically */}} - {{- range .Site.Menus.nav }} + {{- range site.Menus.nav }} {{- $active := or ($current.IsMenuCurrent "nav" .) ($current.HasMenuCurrent "nav" .) }} {{- $active = or $active (eq .Name $current.Title) }} <a class="sidebar-nav-item {{ if $active }}active{{ end }}" href="{{ .URL }}"> @@ -21,7 +21,7 @@ </a> {{- end -}} {{/* TODO: Add hypothesis support */}} - <a class="sidebar-nav-item" href="{{ .Site.Params.github_url }}" target="_blank">GitHub project</a> + <a class="sidebar-nav-item" href="{{ site.Params.github_url }}" target="_blank">GitHub project</a> </nav> <div class="sidebar-item"> |
