Permalink
Browse files

Generalise title+description in templates

The base now owns adding titles and descriptions to the content with the exception of the photo section. Hopefuly this can be consolidated in the future.
  • Loading branch information...
TheBiggerGuy committed Sep 21, 2018
1 parent 2e3f57a commit 4023c61d7cd859b748d7293eeed0936ed591d2cc
@@ -4,8 +4,10 @@ description: "About Guy Taylor"
date: 2018-08-24T17:09:43+01:00
menu: "Main"

---
hideTitle: true
hideDescription: true

---

<style type="text/css">
#head-shot-container {
@@ -44,4 +46,3 @@ menu: "Main"
<p>In tech I am interested in communications, security and anything that is actually interesting.</p>
</div>
</div>

@@ -1,6 +1,6 @@
---
title: "Contributions"
description: "Some of the work or commits I've publicly done."
description: "Some of my public work and commits"
date: 2018-08-27T14:08:22+01:00
menu: "Main"

@@ -1,8 +1,7 @@
---
title: "Photography"
description: "Highlights of Guy's photography"
date: 2018-08-27T14:08:22+01:00
menu: "Main"

---

Home of Guy's photography
@@ -41,7 +41,17 @@
{{- block "hero" . }}{{- end }}
{{ "<!-- end hero -->" | safeHTML }}


<div class="container">
{{ "<!-- Start header -->" | safeHTML }}
{{- block "header" . }}
<header>
{{ if .Title}}{{ if not .Params.hideTitle }}<h1>{{ .Title }}</h1>{{ end }}{{ end }}
{{ if .Description }}{{ if not .Params.hideDescription }}<h2>{{ .Description }}</h2>{{ end }}{{ end }}
</header>
{{- end }}
{{ "<!-- End header -->" | safeHTML }}

{{ "<!-- Start main -->" | safeHTML }}
{{- block "main" . }}{{- end }}
{{ "<!-- End main -->" | safeHTML }}
@@ -1,12 +1,7 @@
{{ define "main" }}
<main>
<article>
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
</article>
{{ "<!-- Start single main -->" | safeHTML }}
{{ .Content }}
{{ "<!-- End single main -->" | safeHTML }}
<ul>
<!-- Ranges through content/post/*.md -->
{{ range .Pages }}
@@ -15,5 +10,4 @@ <h1>{{.Title}}</h1>
</li>
{{ end }}
</ul>
</main>
{{ end }}
@@ -1,7 +1,6 @@
{{ define "main" }}
{{ "<!-- Start contributions main -->" | safeHTML }}

<h1>{{ .Title }}</h1>
<div class="mx-auto">
{{ if .Params.LogoIcon }}
<div class="py-3">
@@ -10,7 +9,6 @@ <h1>{{ .Title }}</h1>
{{ else }}
<img class="img-fluid" style="max-height: 128px; max-width: 128px;" src="{{ .Params.Logo }}" alt="{{ .Title }} Icon">
{{ end }}
<p>{{ .Description }}</p>
</div>

{{ .Content }}
@@ -1,7 +1,13 @@
{{ define "header" }}
<header>
{{ if .Title}}{{ if not .Params.hideTitle }}<h1>{{ .Title }}</h1>{{ end }}{{ end }}
{{ if .Description }}{{ if .Params.showDescription }}<h2>{{ .Description }}</h2>{{ end }}{{ end }}
</header>
{{ end }}

{{ define "main" }}
{{ "<!-- Start photography main -->" | safeHTML }}

<h1>{{ .Title }}</h1>
<div class="mx-auto">

{{ $photo_id := -1 }}
@@ -1,9 +1,4 @@
{{ define "main" }}
<header>
<h1>{{ .Title }}</h1>
{{ if .Description }}<h2>{{ .Description }}</h2>{{ end }}
</header>

<div class="container">
{{ .Content }}
</div>
@@ -1,8 +1,4 @@
{{ define "main" }}
<header>
<h1>{{ .Title }}</h1>
</header>

<div class="container">
{{ .Content }}
</div>

0 comments on commit 4023c61

Please sign in to comment.