mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-14 00:59:43 +00:00
Replace .Site.GetPage with one parameter calls
This commit is contained in:
parent
ae99b799c8
commit
5121f1a833
5 changed files with 9 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
{{ with .Site.GetPage "section" "/blog" }}
|
{{ with .Site.GetPage "/blog" }}
|
||||||
<h1 class="bold-title is-1">{{ .Title }}</h1>
|
<h1 class="bold-title is-1">{{ .Title }}</h1>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="top">
|
<div id="top">
|
||||||
{{ with .Site.GetPage "page" "/home" }}
|
{{ with .Site.GetPage "/home" }}
|
||||||
<div class="hero is-{{ .Site.Params.home.introHeight | default "large" }}">
|
<div class="hero is-{{ .Site.Params.home.introHeight | default "large" }}">
|
||||||
<!-- Super sweet Hero body title -->
|
<!-- Super sweet Hero body title -->
|
||||||
<div class="hero-body">
|
<div class="hero-body">
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
<!-- Tell them all about it! -->
|
<!-- Tell them all about it! -->
|
||||||
{{ partial "nav.html" . }}
|
{{ partial "nav.html" . }}
|
||||||
|
|
||||||
{{ with .Site.GetPage "page" "/home" }}
|
{{ with .Site.GetPage "/home" }}
|
||||||
{{ $home := . }}
|
{{ $home := . }}
|
||||||
{{ range sort (.Resources.ByType "page") "Params.weight" }}
|
{{ range sort (.Resources.ByType "page") "Params.weight" }}
|
||||||
{{ if ne .Name "contact.md" }}
|
{{ if ne .Name "contact.md" }}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ with .Site.GetPage "section" "/blog" }}
|
{{ with .Site.GetPage "/blog" }}
|
||||||
<div class="section" id="{{ .Title | urlize }}">
|
<div class="section" id="{{ .Title | urlize }}">
|
||||||
<!-- Begin Blog container -->
|
<!-- Begin Blog container -->
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ with .Site.GetPage "section" "/projects" }}
|
{{ with .Site.GetPage "/projects" }}
|
||||||
<div class="section" id="{{ .Title | urlize }}">
|
<div class="section" id="{{ .Title | urlize }}">
|
||||||
<!-- Begin Projects container -->
|
<!-- Begin Projects container -->
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<a class="navbar-item" href="{{ "/" | absLangURL }}">{{ i18n "nav_main" . }}</a>
|
<a class="navbar-item" href="{{ "/" | absLangURL }}">{{ i18n "nav_main" . }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with .Site.GetPage "page" "/home" }}
|
{{ with .Site.GetPage "/home" }}
|
||||||
{{ range sort (.Resources.ByType "page") "Params.weight" }}
|
{{ range sort (.Resources.ByType "page") "Params.weight" }}
|
||||||
{{ if ne .Name "contact.md" }}
|
{{ if ne .Name "contact.md" }}
|
||||||
<a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" .File.TranslationBaseName | absLangURL }}{{ end }}">{{ .Title }}</a>
|
<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"}}
|
{{ $pageIsInProjects := eq .Page.Section "projects"}}
|
||||||
{{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }}
|
{{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }}
|
||||||
{{ with .Site.GetPage "section" "/projects" }}
|
{{ with .Site.GetPage "/projects" }}
|
||||||
{{ $totalProjects := (len .Pages) }}
|
{{ $totalProjects := (len .Pages) }}
|
||||||
{{ $numberOfProjectsToShow := .Site.Params.home.numberOfProjectsToShow | default $totalProjects }}
|
{{ $numberOfProjectsToShow := .Site.Params.home.numberOfProjectsToShow | default $totalProjects }}
|
||||||
{{ if $isHome }}
|
{{ if $isHome }}
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
{{ $pageIsInBlog := eq .Page.Section "blog"}}
|
{{ $pageIsInBlog := eq .Page.Section "blog"}}
|
||||||
{{ if not (and $pageIsInBlog (eq .Page.Kind "section")) }}
|
{{ if not (and $pageIsInBlog (eq .Page.Kind "section")) }}
|
||||||
{{ with .Site.GetPage "section" "/blog" }}
|
{{ with .Site.GetPage "/blog" }}
|
||||||
{{ if $isHome }}
|
{{ if $isHome }}
|
||||||
<a class="navbar-item" href="{{ printf "#%s" (.Title | urlize) }}">{{ .Title }}</a>
|
<a class="navbar-item" href="{{ printf "#%s" (.Title | urlize) }}">{{ .Title }}</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with .Site.GetPage "page" "/home" }}
|
{{ with .Site.GetPage "/home" }}
|
||||||
{{ with .Resources.GetMatch "contact.md" }}
|
{{ with .Resources.GetMatch "contact.md" }}
|
||||||
<a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" .File.TranslationBaseName | absLangURL }}{{ end }}">{{ .Title }}</a>
|
<a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" .File.TranslationBaseName | absLangURL }}{{ end }}">{{ .Title }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue