Rework menu categories
parent
9c486c8331
commit
526ba6d991
|
@ -31,9 +31,3 @@ privacy:
|
||||||
|
|
||||||
theme:
|
theme:
|
||||||
- chosto
|
- chosto
|
||||||
|
|
||||||
menu:
|
|
||||||
main:
|
|
||||||
- identifier: categories
|
|
||||||
name: Catégories
|
|
||||||
url: /categories/
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
{{- partial "header.html" . -}}
|
{{- partial "header.html" . -}}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{{- block "main" . }}{{- end }}
|
{{- block "main" . }}{{- end }}
|
||||||
{{- partial "about.html" . -}}
|
|
||||||
</div>
|
</div>
|
||||||
{{- partial "footer.html" . -}}
|
{{- partial "footer.html" . -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<article class="post">
|
<article class="block">
|
||||||
<header>
|
<header>
|
||||||
<h2><a href='{{ .Permalink }}'> {{ .Title }}</a> </h2>
|
<h2><a href='{{ .Permalink }}'> {{ .Title }}</a> </h2>
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main>
|
||||||
|
{{ with .Content }}
|
||||||
<div>
|
<div>
|
||||||
<!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
|
{{ . }}
|
||||||
{{ .Content }}
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
{{ end }}
|
||||||
{{ range .Paginator.Pages }}
|
{{ range .Paginator.Pages }}
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- partial "pagination.html" . -}}
|
{{- partial "pagination.html" . -}}
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -5,6 +5,13 @@
|
||||||
{{ with .Params.subtitle }}
|
{{ with .Params.subtitle }}
|
||||||
<p class="subtitle">{{ . }}</p>
|
<p class="subtitle">{{ . }}</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ with .Params.categories }}
|
||||||
|
<div class="tags colums is-centered is-rounded">
|
||||||
|
{{ range . }}
|
||||||
|
<span class="tag is-large mx-2"><a href="{{ "categories" | absURL }}/{{ . | urlize }}">{{ . }}</a></span>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<li>
|
<div class="block">
|
||||||
<a href="{{.Permalink}}">
|
<a href="{{.Permalink}}">
|
||||||
<time class="post-date" datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
|
<time class="post-date" datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
|
||||||
{{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }}
|
{{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }}
|
||||||
|
@ -28,4 +28,4 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ .Title }}
|
{{ .Title }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</div>
|
||||||
|
|
|
@ -12,11 +12,24 @@
|
||||||
<div id="navbar" class="navbar-menu">
|
<div id="navbar" class="navbar-menu">
|
||||||
<div class="navbar-start">
|
<div class="navbar-start">
|
||||||
<a class="navbar-item {{ if eq .Permalink .Site.Home.Permalink }}is-active is-tab{{ end }}" href="{{ .Site.Home.Permalink }}">Accueil</a>
|
<a class="navbar-item {{ if eq .Permalink .Site.Home.Permalink }}is-active is-tab{{ end }}" href="{{ .Site.Home.Permalink }}">Accueil</a>
|
||||||
|
<div class="navbar-item has-dropdown is-hoverable">
|
||||||
|
<a class="navbar-link">
|
||||||
|
Catégories
|
||||||
|
</a>
|
||||||
|
<div class="navbar-dropdown">
|
||||||
|
{{ range $key, $value := .Site.Taxonomies.categories }}
|
||||||
|
<a class="navbar-item" href="{{ .Page.Permalink }}">
|
||||||
|
{{ $key | humanize }}
|
||||||
|
<span class="tag ml-2 is-rounded">{{ len . }}</span>
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{ $currentPage := . }}
|
{{ $currentPage := . }}
|
||||||
{{ range .Site.Menus.main }}
|
{{ range .Site.Menus.main }}
|
||||||
{{ if .HasChildren }}
|
{{ if .HasChildren }}
|
||||||
<div class="navbar-item has-dropdown is-hoverable {{ if $currentPage.HasMenuCurrent "main" . }}is-active is-tab{{ end }}">
|
<div class="navbar-item has-dropdown is-hoverable {{ if $currentPage.HasMenuCurrent "main" . }}is-active is-tab{{ end }}">
|
||||||
<a href="#" class="navbar-link">
|
<a class="navbar-link">
|
||||||
{{ .Pre }}
|
{{ .Pre }}
|
||||||
<span>{{ .Name }}</span>
|
<span>{{ .Name }}</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -31,7 +44,9 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-end"><!-- See later to differentiate --></div>
|
<div class="navbar-end">
|
||||||
|
<!-- See later to differentiate -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -1,60 +1,59 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<div class="container">
|
<div class="columns mt-5 is-variable is-6">
|
||||||
<aside>
|
|
||||||
<div>
|
|
||||||
<section>
|
|
||||||
<time class="post-date" datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
|
|
||||||
Article publié le {{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }} (dernière modification le {{ .Lastmod.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Lastmod.Month) }} {{ .Lastmod.Year }})
|
|
||||||
</time>
|
|
||||||
<h4>{{ .FuzzyWordCount }} mots </h4>
|
|
||||||
</section>
|
|
||||||
{{ with .Params.categories }}
|
|
||||||
<ul>
|
|
||||||
{{ range . }}
|
|
||||||
<li><a href="{{ "categories" | absURL }}/{{ . | urlize }}">{{ . }}</a> </li>
|
|
||||||
{{ end }}
|
|
||||||
</ul>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
||||||
<!--
|
<!--
|
||||||
If the current blog post belongs to a case, we will add a side menu
|
If the current blog post belongs to a case, we will add a side menu
|
||||||
with all other blog posts belonging to that case, emphasis to the current.
|
with all other blog posts belonging to that case, emphasis to the current.
|
||||||
-->
|
-->
|
||||||
{{ with .CurrentSection.Params.Title }}
|
{{ with .CurrentSection.Params.Title }}
|
||||||
<aside class="menu">
|
<aside class="menu box column is-3">
|
||||||
<p class="menu-label">
|
<p class="menu-label">
|
||||||
Dans le dossier « {{ . }} »...
|
Dans le dossier « {{ . }} »...
|
||||||
</p>
|
</p>
|
||||||
<ul class="menu-list">
|
<div class="menu-list">
|
||||||
{{ $posts := (where $.Site.RegularPages "CurrentSection.Params.Code" "==" $.CurrentSection.Params.Code )}}
|
{{ $posts := (where $.Site.RegularPages "CurrentSection.Params.Code" "==" $.CurrentSection.Params.Code )}}
|
||||||
{{ $postsSorted := (sort $posts "Date" )}}
|
{{ $postsSorted := (sort $posts "Date" )}}
|
||||||
{{ range $postsSorted }}
|
{{ range $postsSorted }}
|
||||||
<li><a
|
<a {{ if eq $.Title .Title }} class="is-active" {{ end }} href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
{{ if eq $.Title .Title }}
|
|
||||||
class="is-active"
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
href="{{ .Permalink }}">{{ .Title }}</a></li>
|
</div>
|
||||||
{{ end }}
|
|
||||||
</ul>
|
|
||||||
</aside>
|
</aside>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
<section class="column is-7">
|
||||||
|
<aside>
|
||||||
|
<div>
|
||||||
<section>
|
<section>
|
||||||
|
<time class="post-date" datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
|
||||||
|
Article publié le {{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }} (dernière modification le {{ .Lastmod.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Lastmod.Month) }}
|
||||||
|
{{ .Lastmod.Year }})
|
||||||
|
</time>
|
||||||
|
<h4>{{ .FuzzyWordCount }} mots </h4>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
<div>
|
<div>
|
||||||
<article>
|
<article>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
<aside class="container level my-5">
|
||||||
<aside>
|
<div class="level-left">
|
||||||
<div>
|
|
||||||
{{ with .PrevInSection }}
|
{{ with .PrevInSection }}
|
||||||
<a class="previous" href="{{ .Permalink }}"> {{ .Title }}</a>
|
<div class="level-item">
|
||||||
|
<a class="button is-info" href="{{ .Permalink }}">«« {{ .Title }}</a>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
<div class="level-right">
|
||||||
{{ with .NextInSection }}
|
{{ with .NextInSection }}
|
||||||
<a class="next" href="{{ .Permalink }}"> {{ .Title }}</a>
|
<div class="level-item">
|
||||||
|
<a class="button is-info" href="{{ .Permalink }}">{{ .Title }} »»</a>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
</section>
|
||||||
|
<aside class="column is-3">
|
||||||
|
{{- partial "about.html" . -}}
|
||||||
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -5,6 +5,5 @@
|
||||||
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> {{ .Count }}</li>
|
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> {{ .Count }}</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{- partial "pagination.html" . -}}
|
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
</article>
|
</article>
|
||||||
<ul>
|
<ul>
|
||||||
<!-- Ranges through the term pages -->
|
<!-- Ranges through the term pages -->
|
||||||
{{ range .Pages }}
|
{{ range .Paginator.Pages }}
|
||||||
{{- partial "listitem.html" . -}}
|
{{- partial "listitem.html" . -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue