diff options
author | Hanzei <hanzei@mailbox.org> | 2018-07-23 07:00:30 +0300 |
---|---|---|
committer | Hanzei <hanzei@mailbox.org> | 2018-07-23 07:00:30 +0300 |
commit | 5121f1a8331dc94c1189a24fbe09397b608f29a1 (patch) | |
tree | de990b3f06bd6c18a1d5edd197aa44ca1b31668b | |
parent | ae99b799c8eeb44a140aede9f9aa971820590ad7 (diff) |
Replace .Site.GetPage with one parameter calls
-rw-r--r-- | layouts/blog/single.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 4 | ||||
-rw-r--r-- | layouts/partials/home/blog.html | 2 | ||||
-rw-r--r-- | layouts/partials/home/projects.html | 2 | ||||
-rw-r--r-- | layouts/partials/nav.html | 8 |
5 files changed, 9 insertions, 9 deletions
diff --git a/layouts/blog/single.html b/layouts/blog/single.html index ce801e2..5d1628b 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -1,5 +1,5 @@ {{ define "title" }} -{{ with .Site.GetPage "section" "/blog" }} +{{ with .Site.GetPage "/blog" }} <h1 class="bold-title is-1">{{ .Title }}</h1> {{ end }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index c4330c2..e192241 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -9,7 +9,7 @@ </head> <body> <div id="top"> - {{ with .Site.GetPage "page" "/home" }} + {{ with .Site.GetPage "/home" }} <div class="hero is-{{ .Site.Params.home.introHeight | default "large" }}"> <!-- Super sweet Hero body title --> <div class="hero-body"> @@ -38,7 +38,7 @@ <!-- Tell them all about it! --> {{ partial "nav.html" . }} - {{ with .Site.GetPage "page" "/home" }} + {{ with .Site.GetPage "/home" }} {{ $home := . }} {{ range sort (.Resources.ByType "page") "Params.weight" }} {{ if ne .Name "contact.md" }} diff --git a/layouts/partials/home/blog.html b/layouts/partials/home/blog.html index 1cbade0..67719bc 100644 --- a/layouts/partials/home/blog.html +++ b/layouts/partials/home/blog.html @@ -1,4 +1,4 @@ -{{ with .Site.GetPage "section" "/blog" }} +{{ with .Site.GetPage "/blog" }} <div class="section" id="{{ .Title | urlize }}"> <!-- Begin Blog container --> <div class="container"> diff --git a/layouts/partials/home/projects.html b/layouts/partials/home/projects.html index afd9e20..324573f 100644 --- a/layouts/partials/home/projects.html +++ b/layouts/partials/home/projects.html @@ -1,4 +1,4 @@ -{{ with .Site.GetPage "section" "/projects" }} +{{ with .Site.GetPage "/projects" }} <div class="section" id="{{ .Title | urlize }}"> <!-- Begin Projects container --> <div class="container"> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 65a775d..ba0f13e 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -40,7 +40,7 @@ <a class="navbar-item" href="{{ "/" | absLangURL }}">{{ i18n "nav_main" . }}</a> {{ end }} - {{ with .Site.GetPage "page" "/home" }} + {{ with .Site.GetPage "/home" }} {{ range sort (.Resources.ByType "page") "Params.weight" }} {{ if ne .Name "contact.md" }} <a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" .File.TranslationBaseName | absLangURL }}{{ end }}">{{ .Title }}</a> @@ -50,7 +50,7 @@ {{ $pageIsInProjects := eq .Page.Section "projects"}} {{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }} - {{ with .Site.GetPage "section" "/projects" }} + {{ with .Site.GetPage "/projects" }} {{ $totalProjects := (len .Pages) }} {{ $numberOfProjectsToShow := .Site.Params.home.numberOfProjectsToShow | default $totalProjects }} {{ if $isHome }} @@ -71,7 +71,7 @@ {{ $pageIsInBlog := eq .Page.Section "blog"}} {{ if not (and $pageIsInBlog (eq .Page.Kind "section")) }} - {{ with .Site.GetPage "section" "/blog" }} + {{ with .Site.GetPage "/blog" }} {{ if $isHome }} <a class="navbar-item" href="{{ printf "#%s" (.Title | urlize) }}">{{ .Title }}</a> {{ else }} @@ -86,7 +86,7 @@ {{ end }} {{ end }} - {{ with .Site.GetPage "page" "/home" }} + {{ with .Site.GetPage "/home" }} {{ with .Resources.GetMatch "contact.md" }} <a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" .File.TranslationBaseName | absLangURL }}{{ end }}">{{ .Title }}</a> {{ end }} |