From d664b4bcba29d04d62c30465f738811676fa20e7 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Wed, 1 May 2019 23:36:59 +0100 Subject: [PATCH] refactor: .Site.x to site.x --- layouts/404.html | 2 +- layouts/_default/single.html | 4 +- layouts/index.json | 4 +- layouts/partials/comments.html | 2 +- layouts/partials/cookie_consent.html | 4 +- layouts/partials/css/parse_theme.css | 12 +++--- layouts/partials/docs_sidebar.html | 4 +- layouts/partials/footer.html | 36 +++++++++--------- layouts/partials/footer_section.html | 4 +- layouts/partials/header.html | 56 ++++++++++++++-------------- layouts/partials/navbar.html | 24 ++++++------ layouts/partials/page_author.html | 2 +- layouts/partials/share.html | 2 +- layouts/project/single.html | 22 +++++------ layouts/publication/single.html | 2 +- layouts/rss.xml | 16 ++++---- layouts/section/publication.html | 2 +- layouts/slides/baseof.html | 8 ++-- layouts/talk/single.html | 2 +- 19 files changed, 104 insertions(+), 104 deletions(-) diff --git a/layouts/404.html b/layouts/404.html index abcafdf0..0c02ee87 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -5,7 +5,7 @@

{{ i18n "page_not_found" }}

{{ i18n "404_recommendations" }}

- {{ $query := .Site.RegularPages }} + {{ $query := site.RegularPages }} {{ $count := len $query }} {{ if gt $count 0 }}

{{ i18n "user_profile_latest" }}

diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7554c85a..720f15ca 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -15,7 +15,7 @@ {{ if ne .Type "page" }} {{ partial "page_author.html" . }} - {{ $related := .Site.RegularPages.Related . | first 5 }} + {{ $related := site.RegularPages.Related . | first 5 }} {{ with $related }}
@@ -29,7 +29,7 @@ {{ end }} {{ end }} - {{ if .Site.Params.section_pager }} + {{ if site.Params.section_pager }}
{{ partial "section_pager.html" . }}
diff --git a/layouts/index.json b/layouts/index.json index 7dde82e0..a97f11f2 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,8 +1,8 @@ {{- /* Generate the search index. */ -}} {{- $index := slice -}} -{{- $pages := .Site.RegularPages -}} +{{- $pages := site.RegularPages -}} {{- /* Add the index page of docs separately since it's not in RegularPages above. */ -}} -{{- $pages := $pages | union (where (where .Site.Pages "Kind" "section") "Type" "docs") -}} +{{- $pages := $pages | union (where (where site.Pages "Kind" "section") "Type" "docs") -}} {{- /* Add author pages to index so their bios can be searched. Hide empty `/author/` node. */ -}} {{- $pages := $pages | union (where (where site.Pages "Section" "author") "Params.name" "!=" nil) -}} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index e4a2eb90..977ec849 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,4 +1,4 @@ -{{ if and .Site.DisqusShortname (not (or .Site.Params.disable_comments .Params.disable_comments)) }} +{{ if and site.DisqusShortname (not (or site.Params.disable_comments .Params.disable_comments)) }}
{{ template "_internal/disqus.html" . }}
diff --git a/layouts/partials/cookie_consent.html b/layouts/partials/cookie_consent.html index 015adb2a..9e7536a4 100644 --- a/layouts/partials/cookie_consent.html +++ b/layouts/partials/cookie_consent.html @@ -1,4 +1,4 @@ -{{ if .Site.Params.privacy_pack }} +{{ if site.Params.privacy_pack }} {{ $scr := .Scratch }} @@ -20,7 +20,7 @@ "message": {{ i18n "cookie_message" | default "This website uses cookies to ensure you get the best experience on our website." }}, "dismiss": {{ i18n "cookie_dismiss" | default "Got it!" }}, "link": {{ i18n "cookie_learn" | default "Learn more" }}, - "href": {{ with .Site.GetPage "privacy.md" }}{{ printf "%s" .RelPermalink }}{{ else }}"https://cookies.insites.com"{{ end }} + "href": {{ with site.GetPage "privacy.md" }}{{ printf "%s" .RelPermalink }}{{ else }}"https://cookies.insites.com"{{ end }} } })}); diff --git a/layouts/partials/css/parse_theme.css b/layouts/partials/css/parse_theme.css index cda684fe..904aff97 100644 --- a/layouts/partials/css/parse_theme.css +++ b/layouts/partials/css/parse_theme.css @@ -2,9 +2,9 @@ {{- $site := $scr.Get "site" -}} {{/* Attempt to load font style specified by user. */}} -{{- $font_index := .Site.Params.font | default "default" -}} -{{ if isset .Site.Data.fonts $font_index }} - {{- $font := index .Site.Data.fonts $font_index -}} +{{- $font_index := site.Params.font | default "default" -}} +{{ if isset site.Data.fonts $font_index }} + {{- $font := index site.Data.fonts $font_index -}} {{- $scr.Set "google_fonts" $font.google_fonts -}} {{- $scr.Set "body_font" $font.body_font -}} {{- $scr.Set "heading_font" $font.heading_font -}} @@ -15,9 +15,9 @@ {{ end }} {{/* Attempt to load color theme specified by user. */}} -{{- $theme_index := .Site.Params.color_theme | default "default" -}} -{{ if isset .Site.Data.themes $theme_index }} - {{ $theme := index .Site.Data.themes $theme_index }} +{{- $theme_index := site.Params.color_theme | default "default" -}} +{{ if isset site.Data.themes $theme_index }} + {{ $theme := index site.Data.themes $theme_index }} {{- $scr.Set "light" $theme.light -}} diff --git a/layouts/partials/docs_sidebar.html b/layouts/partials/docs_sidebar.html index b293652f..4c617089 100644 --- a/layouts/partials/docs_sidebar.html +++ b/layouts/partials/docs_sidebar.html @@ -1,6 +1,6 @@ {{ $current_page := . }} {{ $menu_name := (path.Base (path.Split .Path).Dir) }} -{{ with (index .Site.Menus $menu_name) }} +{{ with (index site.Menus $menu_name) }} {{ else }} {{ errorf "Please define menu items named `[menu.%s]` in your %s front matter or define `[[menu.%s]]` in `config.toml`." $menu_name .Path $menu_name }} {{ end }} @@ -16,7 +16,7 @@