Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pravin/hugo-theme-prav.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Rosenshein <leonrosn@amazon.com>2022-04-04 20:23:26 +0300
committerLeon Rosenshein <leonrosn@amazon.com>2022-04-04 20:23:26 +0300
commit9b9e91314747a2e1698afb3905dc681d1441f968 (patch)
tree421a061d3be7d5689e7e7c30640fbf76615ac013
parent8f5557675b04d2ac5bac9096e1b3cc4010defeaf (diff)
Add heading to individual articles
-rw-r--r--layouts/index.html1
-rw-r--r--layouts/partials/render_single_article.html6
2 files changed, 6 insertions, 1 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 651deef..a1f4a37 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -8,6 +8,7 @@
{{ range .Paginator.Pages }}
+ {{ .Scratch.Set "isMainPage" "true" }}
<div class="pad">
{{- partial "render_single_article.html" . -}}
</div>
diff --git a/layouts/partials/render_single_article.html b/layouts/partials/render_single_article.html
index ada6f97..b519033 100644
--- a/layouts/partials/render_single_article.html
+++ b/layouts/partials/render_single_article.html
@@ -5,7 +5,11 @@
</div>
{{ end }}
<article>
+ {{ if eq (.Scratch.Get "isMainPage") "true" -}}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
+ {{ else -}}
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ {{- end -}}
<div class="tags">
{{ range .Params.tags }}
{{ $name := . }}
@@ -13,4 +17,4 @@
{{ end }}
</div>
{{ replace .Content "<table>" "<table class='pure-table pure-table-striped'>" | safeHTML }}
-</article>
+</article> \ No newline at end of file