refactor: .Site.x to site.x

This commit is contained in:
George Cushen committed 2019-05-01 23:36:59 +01:00
1 parent f147c6a7fa
commit d664b4bcba
19 files changed
+104 -104

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
<h1>{{ i18n "page_not_found" }}</h1>
<p>{{ i18n "404_recommendations" }}</p>
{{ $query := .Site.RegularPages }}
{{ $query := site.RegularPages }}
{{ $count := len $query }}
{{ if gt $count 0 }}
<h2>{{ i18n "user_profile_latest" }}</h2>
+2 -2
View File
@@ -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 }}
<div class="article-widget">
<div class="hr-light"></div>
@@ -29,7 +29,7 @@
{{ end }}
{{ end }}
{{ if .Site.Params.section_pager }}
{{ if site.Params.section_pager }}
<div class="article-widget">
{{ partial "section_pager.html" . }}
</div>
+2 -2
View File
@@ -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) -}}
+1 -1
View File
@@ -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)) }}
<section id="comments">
{{ template "_internal/disqus.html" . }}
</section>
+2 -2
View File
@@ -1,4 +1,4 @@
{{ if .Site.Params.privacy_pack }}
{{ if site.Params.privacy_pack }}
{{ $scr := .Scratch }}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
@@ -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 }}
}
})});
</script>
+6 -6
View File
@@ -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 -}}
+2 -2
View File
@@ -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 @@
</form>
<nav class="collapse docs-links" id="docs-nav">
{{ with (index .Site.Menus $menu_name) }}
{{ with (index site.Menus $menu_name) }}
{{ range (index site.Menus $menu_name).ByWeight }}
<div class="docs-toc-item{{ if $current_page.IsMenuCurrent $menu_name . }} active{{ end }}">
<a class="docs-toc-link" {{ if .URL }}href="{{ .URL }}"{{else if .HasChildren }}href="{{ (index .Children 0).URL }}"{{end}}>{{ .Name }}</a>
+18 -18
View File
@@ -1,13 +1,13 @@
{{ $scr := $.Scratch }}
{{/* Config LaTeX math rendering. */}}
{{ if or .Params.math .Site.Params.math }}
{{ if or .Params.math site.Params.math }}
{{ $mathjax_config := resources.Get "js/mathjax-config.js" }}
<script src="{{ $mathjax_config.RelPermalink }}"></script>
{{ end }}
{{/* Attempt to load local vendor JS, otherwise load from CDN. */}}
{{ $js := .Site.Data.assets.js }}
{{ $js := site.Data.assets.js }}
{{ if not ($scr.Get "use_cdn") }}
<script src="{{ printf "/js/vendor/%s" ($scr.Get "vendor_js_filename") | relURL }}"></script>
{{ else }}
@@ -19,31 +19,31 @@
{{ if $.Scratch.Get "highlight_enabled" }}
{{ $v := $js.highlight.version }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.highlight.url $v) $js.highlight.sri | safeHTML }}
{{ range .Site.Params.highlight_languages }}
{{ range site.Params.highlight_languages }}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/{{ $v }}/languages/{{ . }}.min.js"></script>
{{ end }}
{{ end }}
{{/* LaTeX math rendering. */}}
{{ if or .Params.math .Site.Params.math }}
{{ if or .Params.math site.Params.math }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\" async></script>" (printf $js.mathJax.url $js.mathJax.version) $js.mathJax.sri | safeHTML }}
{{ end }}
{{ end }}
{{/* Maps JS. */}}
{{ if eq .Site.Params.map 1 }}
<script async defer src="//maps.googleapis.com/maps/api/js?key={{ .Site.Params.map_api_key }}"></script>
{{ if eq site.Params.map 1 }}
<script async defer src="//maps.googleapis.com/maps/api/js?key={{ site.Params.map_api_key }}"></script>
{{ if ($scr.Get "use_cdn") }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.gmaps.url $js.gmaps.version) $js.gmaps.sri | safeHTML }}
{{ end }}
{{ else if and (or (eq .Site.Params.map 2) (eq .Site.Params.map 3)) ($scr.Get "use_cdn") }}
{{ else if and (or (eq site.Params.map 2) (eq site.Params.map 3)) ($scr.Get "use_cdn") }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.leaflet.url $js.leaflet.version) $js.leaflet.sri | safeHTML }}
{{ end }}
{{/* Comments JS. */}}
{{ $comments_enabled := and site.DisqusShortname (not (or site.Params.disable_comments $.Params.disable_comments)) }}
{{ if and $comments_enabled (site.Params.comment_count | default true) }}
<script id="dsq-count-scr" src="//{{ .Site.DisqusShortname }}.disqus.com/count.js" async></script>
<script id="dsq-count-scr" src="//{{ site.DisqusShortname }}.disqus.com/count.js" async></script>
{{ end }}
{{/* Initialise code highlighting. */}}
@@ -51,7 +51,7 @@
<script>hljs.initHighlightingOnLoad();</script>
{{ end }}
{{ if ne .Site.Params.search.engine 0 }}
{{ if ne site.Params.search.engine 0 }}
{{/* Configure search engine. */}}
<script>
const search_index_filename = {{ "/index.json" | relLangURL }};
@@ -106,27 +106,27 @@
{{ end }}
{{/* Fuse search engine. */}}
{{ if and (eq .Site.Params.search.engine 1) ($scr.Get "use_cdn") }}
{{ if and (eq site.Params.search.engine 1) ($scr.Get "use_cdn") }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.fuse.url $js.fuse.version) $js.fuse.sri | safeHTML }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.mark.url $js.mark.version) $js.mark.sri | safeHTML }}
{{ end }}
{{/* Algolia search engine. */}}
{{ if eq .Site.Params.search.engine 2 }}
{{ if eq site.Params.search.engine 2 }}
{{ if ($scr.Get "use_cdn") }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.instantsearch.url $js.instantsearch.version) $js.instantsearch.sri | safeHTML }}
{{ end }}
<script>
const algoliaConfig = {
appId: {{ .Site.Params.search.algolia.app_id }},
apiKey: {{ .Site.Params.search.algolia.api_key }},
indexName: {{ .Site.Params.search.algolia.index_name }},
poweredBy: {{ .Site.Params.search.algolia.show_logo | default false }}
appId: {{ site.Params.search.algolia.app_id }},
apiKey: {{ site.Params.search.algolia.api_key }},
indexName: {{ site.Params.search.algolia.index_name }},
poweredBy: {{ site.Params.search.algolia.show_logo | default false }}
};
</script>
{{ end }}
{{ $js_comment := printf "/* Source Themes Academic v%s | https://sourcethemes.com/academic/ */\n" .Site.Data.academic.version }}
{{ $js_comment := printf "/* Source Themes Academic v%s | https://sourcethemes.com/academic/ */\n" site.Data.academic.version }}
{{ $js_bundle_head := $js_comment | resources.FromString "js/bundle-head.js" }}
{{ $js_linebreak := "\n" | resources.FromString "js/linebreak.js" }}{{/* Fix no line break after Bootstrap JS causing error. */}}
{{ $js_academic := resources.Get "js/academic.js" }}
@@ -134,12 +134,12 @@
{{ $js_algolia_search := resources.Get "js/algolia-search.js" }}
{{ $js_bootstrap := resources.Get "js/vendor/bootstrap.min.js" }}
{{ $js_bundle := slice $js_bootstrap $js_linebreak $js_academic }}
{{ if eq .Site.Params.search.engine 1 }}
{{ if eq site.Params.search.engine 1 }}
{{ $js_bundle = $js_bundle | append $js_academic_search }}
{{ else if eq site.Params.search.engine 2 }}
{{ $js_bundle = $js_bundle | append $js_algolia_search }}
{{ end }}
{{ range .Site.Params.plugins_js }}
{{ range site.Params.plugins_js }}
{{ $js_bundle = $js_bundle | append (resources.Get (printf "js/%s.js" .)) }}
{{ end }}
{{ $js_bundle := $js_bundle | resources.Concat "js/academic-bundle-pre.js" | minify }}
+2 -2
View File
@@ -1,12 +1,12 @@
<footer class="site-footer">
{{ with .Site.GetPage "privacy.md" }}
{{ with site.GetPage "privacy.md" }}
<p class="powered-by">
{{ printf "<a href=\"%s\">%s</a>" .RelPermalink .Title | safeHTML }}
</p>
{{ end }}
<p class="powered-by">
{{ with .Site.Copyright }}{{ replace . "{year}" now.Year | markdownify}} &middot; {{ end }}
{{ with site.Copyright }}{{ replace . "{year}" now.Year | markdownify}} &middot; {{ end }}
Powered by the
<a href="https://sourcethemes.com/academic/" target="_blank" rel="noopener">Academic theme</a> for
+28 -28
View File
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode | default "en-us" }}">
<html lang="{{ site.LanguageCode | default "en-us" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Source Themes Academic {{ .Site.Data.academic.version }}">
<meta name="generator" content="Source Themes Academic {{ site.Data.academic.version }}">
{{ $scr := .Scratch }}
@@ -30,8 +30,8 @@
{{ $desc = .Params.abstract }}
{{ else if .IsPage }}
{{ $desc = .Summary }}
{{ else if .Site.Params.description }}
{{ $desc = .Site.Params.description }}
{{ else if site.Params.description }}
{{ $desc = site.Params.description }}
{{ else }}
{{ $desc = $superuser_role }}
{{ end }}
@@ -40,11 +40,11 @@
{{ range .Translations }}
<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}">
{{ end }}
<link rel="alternate" hreflang="{{ .Site.LanguageCode | default "en-us" }}" href="{{ .Permalink }}">
<link rel="alternate" hreflang="{{ site.LanguageCode | default "en-us" }}" href="{{ .Permalink }}">
{{ partial "css/parse_theme.css" . }}
{{ $css := .Site.Data.assets.css }}
{{ $js := .Site.Data.assets.js }}
{{ $css := site.Data.assets.css }}
{{ $js := site.Data.assets.js }}
{{ if ne ($scr.Get "primary") "#fff" }}
<meta name="theme-color" content="{{ $scr.Get "primary" }}">
{{ end }}
@@ -61,17 +61,17 @@
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.fontAwesome.url $css.fontAwesome.version) $css.fontAwesome.sri | safeHTML }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.fancybox.url $css.fancybox.version) $css.fancybox.sri | safeHTML }}
{{/* Default to enabling highlighting, but allow the user to override it in .Params or .Site.Params.
{{/* Default to enabling highlighting, but allow the user to override it in .Params or site.Params.
Use $scr to store "highlight_enabled", so that we can read it again in footer.html. */}}
{{ $scr.Set "highlight_enabled" true }}
{{ if isset .Params "highlight" }}
{{ $scr.Set "highlight_enabled" .Params.highlight }}
{{ else if isset .Site.Params "highlight" }}
{{ $scr.Set "highlight_enabled" .Site.Params.highlight }}
{{ else if isset site.Params "highlight" }}
{{ $scr.Set "highlight_enabled" site.Params.highlight }}
{{ end }}
{{ if ($scr.Get "highlight_enabled") }}
{{ $v := $css.highlight.version }}
{{ with .Site.Params.highlight_style }}
{{ with site.Params.highlight_style }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" crossorigin=\"anonymous\" title=\"hl-light\">" (printf $css.highlight.url $css.highlight.version .) | safeHTML }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" crossorigin=\"anonymous\" title=\"hl-dark\" disabled>" (printf $css.highlight.url $css.highlight.version .) | safeHTML }}
{{ else }}
@@ -85,11 +85,11 @@
{{ end }}
{{ end }}
{{ if or (eq .Site.Params.map 2) (eq .Site.Params.map 3) }}
{{ if or (eq site.Params.map 2) (eq site.Params.map 3) }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.leaflet.url $css.leaflet.version) $css.leaflet.sri | safeHTML }}
{{ end }}
{{ if eq .Site.Params.search.engine 2 }}
{{ if eq site.Params.search.engine 2 }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.instantsearch.url $css.instantsearch.version) $css.instantsearch.sri | safeHTML }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.instantsearchTheme.url $css.instantsearchTheme.version) $css.instantsearchTheme.sri | safeHTML }}
{{ end }}
@@ -106,11 +106,11 @@
{{ $style := $sass_template | resources.ExecuteAsTemplate "main_parsed.scss" . | toCSS $css_options | minify | fingerprint "md5" }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ if .Site.Params.plugins_css }}
{{ $css_comment := printf "/* Source Themes Academic v%s | https://sourcethemes.com/academic/ */\n" .Site.Data.academic.version }}
{{ if site.Params.plugins_css }}
{{ $css_comment := printf "/* Source Themes Academic v%s | https://sourcethemes.com/academic/ */\n" site.Data.academic.version }}
{{ $css_bundle_head := $css_comment | resources.FromString "css/bundle-head.css" }}
{{ $css_bundle := slice }}
{{ range .Site.Params.plugins_css }}
{{ range site.Params.plugins_css }}
{{ $css_bundle = $css_bundle | append (resources.Get (printf "css/%s.css" .)) }}
{{ end }}
{{ $css_bundle := $css_bundle | resources.Concat "css/academic-bundle-pre.css" | minify }}
@@ -118,12 +118,12 @@
<link rel="stylesheet" href="{{ $css_bundle.RelPermalink }}">
{{ end }}
{{ if not .Site.IsServer }}
{{ if .Site.GoogleAnalytics }}
{{ if not site.IsServer }}
{{ if site.GoogleAnalytics }}
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '{{ .Site.GoogleAnalytics }}', 'auto');
{{ if .Site.Params.privacy_pack }}ga('set', 'anonymizeIp', true);{{ end }}
ga('create', '{{ site.GoogleAnalytics }}', 'auto');
{{ if site.Params.privacy_pack }}ga('set', 'anonymizeIp', true);{{ end }}
ga('require', 'eventTracker');
ga('require', 'outboundLinkTracker');
ga('require', 'urlChangeTracker');
@@ -154,9 +154,9 @@
{{ $og_image = $featured_image.Permalink }}
{{ else if .Params.header.image }}
{{ $og_image = printf "img/%s" .Params.header.image | absURL }}
{{ else if .Site.Params.sharing_image }}
{{ $og_image = printf "img/%s" .Site.Params.sharing_image | absURL }}
{{ else if .Site.Params.avatar }}
{{ else if site.Params.sharing_image }}
{{ $og_image = printf "img/%s" site.Params.sharing_image | absURL }}
{{ else if site.Params.avatar }}
{{ $og_image = (printf "img/%s" site.Params.avatar) | absURL }}
{{ $twitter_card = "summary" }}
{{ else }}
@@ -164,16 +164,16 @@
{{ $twitter_card = "summary" }}
{{ end }}
<meta property="twitter:card" content="{{ $twitter_card }}">
{{ with .Site.Params.twitter }}
{{ with site.Params.twitter }}
<meta property="twitter:site" content="@{{ . }}">
<meta property="twitter:creator" content="@{{ . }}">
{{ end }}
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:site_name" content="{{ site.Title }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:title" content="{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}">
<meta property="og:title" content="{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}">
<meta property="og:description" content="{{ $desc }}">
{{- with $og_image }}<meta property="og:image" content="{{ . }}">{{end}}
<meta property="og:locale" content="{{ .Site.LanguageCode | default "en-us" }}">
<meta property="og:locale" content="{{ site.LanguageCode | default "en-us" }}">
{{ if .IsPage }}
{{ if not .PublishDate.IsZero }}<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}">
{{ else if not .Date.IsZero }}<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}">{{ end }}
@@ -185,7 +185,7 @@
{{ partial "cookie_consent" . }}
{{ partial "head_custom" . }}
<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}</title>
</head>
<body id="top" data-spy="scroll" data-target="{{ if or .IsHome .Params.widgets }}#navbar-main{{ else }}#TableOfContents{{ end }}" data-offset="71" {{ if not ($scr.Get "light") }}class="dark"{{ end }}>
+12 -12
View File
@@ -3,13 +3,13 @@
<!-- Brand and toggle get grouped for better mobile display -->
<a class="navbar-brand" href="{{ "/" | relLangURL }}">
{{- if .Site.Params.logo -}}
<img src="{{ printf "/img/%s" .Site.Params.logo | relURL }}" alt="{{ .Site.Title }}">
{{- if site.Params.logo -}}
<img src="{{ printf "/img/%s" site.Params.logo | relURL }}" alt="{{ site.Title }}">
{{- else -}}
{{- .Site.Title -}}
{{- site.Title -}}
{{- end -}}
</a>
{{ if or .Site.Menus.main .IsTranslated }}
{{ if or site.Menus.main .IsTranslated }}
<button type="button" class="navbar-toggler" data-toggle="collapse"
data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="{{ i18n "toggle_navigation" }}">
<span><i class="fas fa-bars"></i></span>
@@ -20,9 +20,9 @@
<div class="collapse navbar-collapse" id="navbar">
<!-- Left Nav Bar -->
{{ $align_right := .Site.Params.menu_align_right | default true }}
{{ $align_right := site.Params.menu_align_right | default true }}
<ul class="navbar-nav {{ if $align_right }}ml-auto{{ else }}mr-auto{{ end }}">
{{ range .Site.Menus.main }}
{{ range site.Menus.main }}
{{ if .HasChildren }}
<li class="nav-item dropdown">
@@ -66,12 +66,12 @@
{{ end }}
{{ end }}
{{ if not $align_right | and (.IsTranslated | or .Site.Menus.main_right | or .Site.Params.search.engine | or .Site.Params.day_night) }}
{{ if not $align_right | and (.IsTranslated | or site.Menus.main_right | or site.Params.search.engine | or site.Params.day_night) }}
</ul>
<ul class="navbar-nav ml-auto">
{{ end }}
{{ range .Site.Menus.main_right }}
{{ range site.Menus.main_right }}
{{/* Set target for link. */}}
{{ $.Scratch.Set "target" "" }}
@@ -91,7 +91,7 @@
{{ end }}
{{ if .Site.Params.search.engine }}
{{ if site.Params.search.engine }}
<li class="nav-item">
<a class="nav-link js-search" href="#"><i class="fas fa-search" aria-hidden="true"></i></a>
</li>
@@ -101,13 +101,13 @@
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true">
<i class="fas fa-globe" aria-hidden="true"></i>
<span>{{ index .Site.Data.i18n.languages .Lang }}</span>
<span>{{ index site.Data.i18n.languages .Lang }}</span>
</a>
<ul class="dropdown-menu">
{{ range .Translations }}
<li class="dropdown-item my-0 py-0 mx-0 px-0">
<a href="{{ .Permalink }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}>
<span>{{ index .Site.Data.i18n.languages .Lang }}</span>
<span>{{ index site.Data.i18n.languages .Lang }}</span>
</a>
</li>
{{ end }}
@@ -115,7 +115,7 @@
</li>
{{ end }}
{{ if .Site.Params.day_night }}
{{ if site.Params.day_night }}
<li class="nav-item">
<a class="nav-link js-dark-toggle" href="#"><i class="fas fa-moon" aria-hidden="true"></i></a>
</li>
+1 -1
View File
@@ -1,4 +1,4 @@
{{ if not (or (eq .Site.Params.profile false) (eq .Params.profile false)) }}
{{ if not (or (eq site.Params.profile false) (eq .Params.profile false)) }}
{{/* Display superuser if superuser exists and page authors are not explicitly specified. */}}
{{/* Otherwise, display first author if a profile for them exists. */}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{ if and .Site.Params.sharing (ne .Params.share false) }}
{{ if and site.Params.sharing (ne .Params.share false) }}
<div class="share-box" aria-hidden="true">
<ul class="share">
<li>
+11 -11
View File
@@ -17,14 +17,14 @@
{{ $page := . }}
{{ $project := .File.ContentBaseName }}
{{ $items := where (where .Site.RegularPages "Type" "post") ".Params.projects" "intersect" (slice $project) }}
{{ $items := where (where site.RegularPages "Type" "post") ".Params.projects" "intersect" (slice $project) }}
{{ $count := len $items }}
{{ if ge $count 1 }}
<h2>{{ (i18n "posts") }}</h2>
{{ range $items }}
{{ if eq $page.Site.Params.projects.post_view 1 }}
{{ if eq site.Params.projects.post_view 1 }}
{{ partial "li_list" . }}
{{ else if eq $page.Site.Params.projects.post_view 3 }}
{{ else if eq site.Params.projects.post_view 3 }}
{{ partial "li_card" . }}
{{ else }}
{{ partial "li_compact" . }}
@@ -32,16 +32,16 @@
{{ end }}
{{ end }}
{{ $items := where (where .Site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
{{ $items := where (where site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
{{ $pubs_len := len $items }}
{{ if ge $pubs_len 1 }}
<h2>{{ (i18n "publications") }}</h2>
{{ range $items }}
{{ if eq $page.Site.Params.projects.publication_view 1 }}
{{ if eq site.Params.projects.publication_view 1 }}
{{ partial "li_list" . }}
{{ else if eq $page.Site.Params.projects.publication_view 3 }}
{{ else if eq site.Params.projects.publication_view 3 }}
{{ partial "li_card" . }}
{{ else if eq $page.Site.Params.projects.publication_view 4 }}
{{ else if eq site.Params.projects.publication_view 4 }}
{{ partial "li_citation" . }}
{{ else }}
{{ partial "li_compact" . }}
@@ -49,14 +49,14 @@
{{ end }}
{{ end }}
{{ $items := where (where .Site.RegularPages "Type" "talk") ".Params.projects" "intersect" (slice $project) }}
{{ $items := where (where site.RegularPages "Type" "talk") ".Params.projects" "intersect" (slice $project) }}
{{ $talks_len := len $items }}
{{ if ge $talks_len 1 }}
<h2>{{ (i18n "talks") }}</h2>
{{ range $items }}
{{ if eq $page.Site.Params.projects.talk_view 1 }}
{{ if eq site.Params.projects.talk_view 1 }}
{{ partial "li_list" . }}
{{ else if eq $page.Site.Params.projects.talk_view 3 }}
{{ else if eq site.Params.projects.talk_view 3 }}
{{ partial "li_card" . }}
{{ else }}
{{ partial "li_compact" . }}
@@ -67,7 +67,7 @@
</div>
</article>
{{ if .Site.Params.section_pager }}
{{ if site.Params.section_pager }}
<div class="article-container article-widget">
{{ partial "section_pager.html" . }}
</div>
+1 -1
View File
@@ -57,7 +57,7 @@
</div>
</div>
{{ if .Site.Params.section_pager }}
{{ if site.Params.section_pager }}
<div class="article-container article-widget">
{{ partial "section_pager.html" . }}
</div>
+8 -8
View File
@@ -1,19 +1,19 @@
{{/* Generate RSS with full page content rather than just summary. */}}
{{- $pages := .Data.Pages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- $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>
<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>Source Themes Academic (https://sourcethemes.com/academic/)</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 }}
<description>Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ site.Title }}</description>
<generator>Source Themes Academic (https://sourcethemes.com/academic/)</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" }}
@@ -24,7 +24,7 @@
<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}}
{{ with site.Author.email }}<author>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
+1 -1
View File
@@ -26,7 +26,7 @@
<select class="pub-filters pubtype-select form-control form-control-sm" data-filter-group="pubtype">
<option value="*">{{ i18n "publication_type" }}</option>
{{ partial "pub_types.html" $ }}
{{ range $index, $taxonomy := .Site.Taxonomies.publication_types }}
{{ range $index, $taxonomy := site.Taxonomies.publication_types }}
<option value=".pubtype-{{ (int $index) }}">
{{ $pub_types := $.Scratch.Get "pub_types" }}
{{ index $pub_types (int $index) }}
+4 -4
View File
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode | default "en-us" }}">
<html lang="{{ site.LanguageCode | default "en-us" }}">
<head>
{{ $css := .Site.Data.assets.css }}
{{ $css := site.Data.assets.css }}
{{ $cdn_url_reveal := "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.8.0" }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Source Themes Academic {{ .Site.Data.academic.version }}">
<meta name="generator" content="Source Themes Academic {{ site.Data.academic.version }}">
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}">
<link rel="icon" type="image/png" href="{{ "/img/icon.png" | relURL }}">
@@ -15,7 +15,7 @@
<link rel="canonical" href="{{ .Permalink }}">
<title>{{ .Title }} | {{ .Site.Title }}</title>
<title>{{ .Title }} | {{ site.Title }}</title>
<link rel="stylesheet" href="{{ $cdn_url_reveal }}/css/reveal.min.css">
{{- $theme := $.Param "slides.theme" | default "black" -}}
+1 -1
View File
@@ -78,7 +78,7 @@
</div>
</div>
{{ if .Site.Params.section_pager }}
{{ if site.Params.section_pager }}
<div class="article-container article-widget">
{{ partial "section_pager.html" . }}
</div>