Tags and categories are now working with custom layouts. More changes to make but its in the right direction

This commit is contained in:
James Tombleson 2022-10-01 22:15:39 -07:00
parent 6071c2d849
commit fb66080ef1
7 changed files with 74 additions and 35 deletions

View File

@ -1,6 +1,9 @@
{{ partial "header.html" . }}
{{ partial "hero.html" . }}
<h1>hi from _default/index.html</h1>
<div class="content">
{{ .Content }}
</div>

View File

@ -2,11 +2,14 @@
{{ partial "hero.html" . }}
<div class="container">
<br>
{{ range .RegularPages }}
<div class="card">
<div class="card-content">
<div class="media">
<div class="media-left">
<figure class="image is-128x128">
{{ with .Params.listthumbnail }}
@ -20,20 +23,33 @@
<a href="{{ .Permalink }}"> {{ .Title }}</a>
</p>
<p class="subtitle is-6">{{ .Params.subtitle }}</p>
{{ with .Params.tags }}
<ul id="tags">
<div class="buttons">
{{ range . }}
<span class="tag">
<button class="button">
<a href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a>
</span>
</button>
{{ end }}
</ul>
</div>
{{ end }}
{{ with .Params.categories }}
<div class="buttons">
{{ range . }}
<button class="button">
<a href="{{ "categories" | absURL }}/{{ . | urlize }}">{{ . }}</a>
</button>
{{ end }}
</div>
{{ end }}
</div>
</div>
</div>
</div>
{{ end }}
</div>
{{ partial "footer.html" . }}

View File

@ -2,8 +2,15 @@
{{ partial "hero.html" . }}
<div class="container">
<img src="{{ .Params.thumbnail }}" />
<br>
<div class="columns">
<div class="column">
<img src="{{ .Params.thumbnail }}" />
</div>
<div class="column">
<div class="content">
{{ .Content }}
</div>
@ -13,13 +20,20 @@
<br>
<h2 class="title">Tags</h2>
<div class="buttons">
{{ with .Params.tags }}
{{ range . }}
<span class="tag">
<button class="button">
<a href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a>
</span>
</button>
{{ end }}
{{ end }}
</div>
</div>
</div>
</div>

View File

@ -1,11 +0,0 @@
{{ partial "header.html" . }}
{{ partial "hero.html" . }}
<main>
<div>
<!-- ranges through each of the content files associated with a particular taxonomy term and renders the summary.html content view -->
{{ range .Pages }}
{{ .Render "tags"}}
{{ end }}
</div>
</main>

View File

@ -14,6 +14,7 @@
<div class="navbar-start">
<a class="navbar-item" href="/recipies">Recipies</a>
<a class="navbar-item" href="/tags">Tags</a>
<a class="navbar-item" href="/categories">Categories</a>
<a class="navbar-item" href="/recipies/index.xml">RSS Feed</a>
</div>
</div>

View File

@ -0,0 +1,16 @@
{{ partial "header.html" . }}
{{ partial "hero.html" . }}
<div class="container">
<br>
<div class="buttons">
{{ range .Data.Pages }}
<button class="button">
<a href="{{.RelPermalink}}">{{ .Title }}</a>
</button>
{{ end }}
</div>
</div>
{{ partial "footer.html" . }}