Handling tags
This commit is contained in:
parent
3e7f4f07d0
commit
b9020351c1
8 changed files with 84 additions and 16 deletions
|
|
@ -10,26 +10,25 @@
|
|||
post-container">
|
||||
|
||||
{{ .Content }}
|
||||
{{ partial "comments.html" . }}
|
||||
|
||||
</div>
|
||||
<!-- Sidebar Container -->
|
||||
<div class="
|
||||
col-xl-8 offset-xl-2
|
||||
col-xl-2
|
||||
col-lg-10 offset-lg-1
|
||||
sidebar-container">
|
||||
|
||||
<!-- Featured Tags -->
|
||||
{{ if .Site.Params.featured_tags }}
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<hr class="d-none d-lg-block">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
{{ $featured_condition_size := .Site.Params.featured_condition_size }}
|
||||
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
|
||||
{{ if gt (len $taxonomy.Pages) $featured_condition_size }}
|
||||
<a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
|
||||
{{ $name }}
|
||||
<a class="badge badge-pill badge-secondary" href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
|
||||
#{{ $name }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -10,15 +10,17 @@
|
|||
<div class="row">
|
||||
<div class="col-xl-8 offset-xl-2 col-lg-10 offset-lg-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
{{ range .Params.tags }}
|
||||
<a class="tag" href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" title="{{ . }}">
|
||||
{{ . }}
|
||||
<h1 class="py-2">{{ .Title }}</h1>
|
||||
{{ with .Params.subtitle }}<h2 class="subheading py-2 h4">{{ . }}</h2>{{ end }}
|
||||
{{ with .Params.tags }}
|
||||
<div class="tags py-2">
|
||||
{{ range . }}
|
||||
<a class="badge badge-pill badge-light" href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" title="{{ . }}">
|
||||
#{{ . }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<h1 class="py-2">{{ .Title }}</h1>
|
||||
<h2 class="subheading py-2 h4">{{ .Params.subtitle }}</h2>
|
||||
{{ end }}
|
||||
<span class="meta">
|
||||
Par
|
||||
{{ if .Params.author }}
|
||||
|
|
@ -94,8 +96,8 @@
|
|||
{{ $featured_condition_size := .Site.Params.featured_condition_size }}
|
||||
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
|
||||
{{ if gt (len $taxonomy.Pages) $featured_condition_size }}
|
||||
<a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
|
||||
{{ $name }}
|
||||
<a class="badge badge-pill badge-secondary" href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
|
||||
#{{ $name }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
|||
2
layouts/partials/category.html
Normal file
2
layouts/partials/category.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{{ $paginator := .Paginate (where .Data.Pages "Section" "post") }}
|
||||
{{ partial "posts.html" . }}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="row">
|
||||
<!-- USE SIDEBAR -->
|
||||
<!-- Post Container -->
|
||||
<div class="
|
||||
<div class="
|
||||
col-xl-8 offset-xl-1
|
||||
col-lg-8 offset-lg-1
|
||||
col-12
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
{{ $featured_condition_size := .Site.Params.featured_condition_size }}
|
||||
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
|
||||
{{ if gt (len $taxonomy.Pages) $featured_condition_size }}
|
||||
<a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
|
||||
{{ $name }}
|
||||
<a class="badge badge-pill badge-secondary" href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
|
||||
#{{ $name }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
|||
3
layouts/taxonomy/category.html
Normal file
3
layouts/taxonomy/category.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{{ define "main" }}
|
||||
{{ partial "category.html" . }}
|
||||
{{ end }}
|
||||
6
layouts/taxonomy/tag.html
Normal file
6
layouts/taxonomy/tag.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{{ define "main" }}
|
||||
<div class="container">
|
||||
<h2>Tag <span class="font-italic text-muted">#{{ .Data.Term }}</span></h2>
|
||||
</div>
|
||||
{{ partial "category.html" . }}
|
||||
{{ end }}
|
||||
56
layouts/taxonomy/terms.html
Normal file
56
layouts/taxonomy/terms.html
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{{ define "main" }}
|
||||
<!-- Post Content -->
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<!-- Post Container -->
|
||||
<div class="
|
||||
col-xl-7 offset-xl-1
|
||||
col-lg-10 offset-lg-1
|
||||
post-container">
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
</div>
|
||||
<!-- Sidebar Container -->
|
||||
<div class="
|
||||
col-xl-2
|
||||
col-lg-10 offset-lg-1
|
||||
sidebar-container">
|
||||
|
||||
<!-- Featured Tags -->
|
||||
{{ if .Site.Params.featured_tags }}
|
||||
<section>
|
||||
<hr class="d-block d-xl-none">
|
||||
<h5><a href="/tags/">Tags</a></h5>
|
||||
<div class="tags">
|
||||
{{ $featured_condition_size := .Site.Params.featured_condition_size }}
|
||||
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
|
||||
{{ if gt (len $taxonomy.Pages) $featured_condition_size }}
|
||||
<a class="badge badge-pill badge-secondary" href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
|
||||
#{{ $name }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
<!-- Friends Blog -->
|
||||
{{ if .Site.Params.friends }}
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
{{ range .Site.Params.friend_link }}
|
||||
<li><a target="_blank" href="{{.href}}">{{.title}}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</section>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
{{ end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue