re-added scope variable to differentiate between list and single pages
This commit is contained in:
parent
f0e29bf4c5
commit
ee61489da8
|
@ -1,4 +1,4 @@
|
|||
baseURL = 'http://localhost/'
|
||||
baseURL = 'https://hugodemo.hoogi.eu/'
|
||||
languageCode = "en-us"
|
||||
DefaultContentLanguage = "en"
|
||||
title = 'This is an example site'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{{ define "main" }}
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ .Scratch.Set "scope" "list" }}
|
||||
<article>
|
||||
<header>
|
||||
<h1>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<h1>
|
||||
{{.Title}}
|
||||
<a href="{{.Permalink}}">{{.Title}}</a>
|
||||
{{ if eq (.Scratch.Get "scope") "single" }}
|
||||
{{.Title}}
|
||||
{{ else }}
|
||||
<a href="{{.Permalink}}">{{.Title}}</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
<p>
|
||||
{{ if .Date }} written {{ if .Params.Author }} by {{ .Params.Author }} {{ end }} on
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
{{ define "main" }}
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ .Scratch.Set "scope" "list" }}
|
||||
<article>
|
||||
<header>
|
||||
{{ partial "article-header.html" . }}
|
||||
</header>
|
||||
{{ if .Site.Params.useSummary }}
|
||||
{{ .Summary }}
|
||||
{{ partial "article-footer.html" . }}
|
||||
{{ else }}
|
||||
{{.Content}}
|
||||
|
||||
{{ partial "article-footer.html" . }}
|
||||
{{ end }}
|
||||
</article>
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
|
@ -2,19 +2,7 @@
|
|||
{{ .Scratch.Set "scope" "single" }}
|
||||
<article>
|
||||
<header>
|
||||
<h1>
|
||||
{{.Title}}
|
||||
</h1>
|
||||
<p>
|
||||
{{ if .Date }} written {{ if .Params.Author }} by {{ .Params.Author }} {{ end }} on
|
||||
<time>{{ .Date.Format "Jan 2, 2006" }}</time>{{ end }}
|
||||
{{ if .Params.categories }}
|
||||
in
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ $.Site.BaseURL }}categories/{{ . | urlize }}">{{ . | humanize }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ partial "article-header.html" . }}
|
||||
</header>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
|
|
Loading…
Reference in New Issue