Start to add some style and navbar
parent
6a520b937e
commit
37834a6df6
|
@ -1,5 +1,4 @@
|
|||
---
|
||||
title: Billets à la mer
|
||||
subtitle: Pensées d'un ingénieur qui voulait être vivant
|
||||
menu: main
|
||||
---
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{- partial "head.html" . -}}
|
||||
<body>
|
||||
<body class="has-navbar-fixed-top">
|
||||
<div class="content">
|
||||
{{- partial "navbar.html" . -}}
|
||||
{{- partial "header.html" . -}}
|
||||
<div class="content">
|
||||
<div class="container">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</div>
|
||||
{{- partial "about.html" . -}}
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{{ range .Paginator.Pages }}
|
||||
{{ .Render "summary" }}
|
||||
{{ end }}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
{{- partial "pagination.html" . -}}
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
<footer>
|
||||
Quentin Duchemin
|
||||
<footer class="footer">
|
||||
<div class="level">
|
||||
<div class="level-left">
|
||||
<div class="level-item">
|
||||
Conçu avec <a href="https://gohugo.io/">Hugo</a> et <a href="https://bulma.io">Bulma</a>.
|
||||
</div>
|
||||
<div class="level-item">
|
||||
<a href="https://git.chosto.me/Chosto/blog">Sources du blog</a>.
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-right">
|
||||
Tout le contenu du blog est disponible sous licence <a href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0.</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<header>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<section class="hero is-primary is-medium">
|
||||
<div class="hero-body has-text-centered">
|
||||
<p class="title">{{ .Title }}</p>
|
||||
{{ with .Params.subtitle }}
|
||||
<h2>{{ . }}</h2>
|
||||
<p class="subtitle">{{ . }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
</header>
|
||||
|
|
|
@ -1,29 +1,37 @@
|
|||
<nav class="menu">
|
||||
<ul>
|
||||
<nav class="navbar is-fixed-top is-transparent" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item" href="{{ .Site.Home.Permalink }}">
|
||||
<img src="https://bulma.io/images/placeholders/128x128.png">
|
||||
</a>
|
||||
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbar">
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<div id="navbar" class="navbar-menu">
|
||||
<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>
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if .HasChildren }}
|
||||
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
|
||||
<a href="#">
|
||||
<div class="navbar-item has-dropdown is-hoverable {{ if $currentPage.HasMenuCurrent "main" . }}is-active is-tab{{ end }}">
|
||||
<a href="#" class="navbar-link">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<ul class="sub-menu">
|
||||
<div class="navbar-dropdown">
|
||||
{{ range .Children }}
|
||||
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
<a class="navbar-item {{ if $currentPage.IsMenuCurrent "main" . }}is-active is-tab{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<a class="navbar-item {{ if $currentPage.IsMenuCurrent "main" . }}is-active is-tab{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navbar-end"><!-- See later to differentiate --></div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
{{ $pag := $.Paginator }}
|
||||
{{ if gt $pag.TotalPages 1 -}}
|
||||
<ul class="pagination">
|
||||
{{ with $pag.First -}}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" class="page-link" aria-label="First"><span aria-hidden="true">««</span></a>
|
||||
</li>
|
||||
{{ end -}}
|
||||
<li class="page-item{{ if not $pag.HasPrev }} disabled{{ end }}">
|
||||
<a {{ if $pag.HasPrev }}href="{{ $pag.Prev.URL }}"{{ end }} class="page-link" aria-label="Previous"><span aria-hidden="true">«</span></a>
|
||||
</li>
|
||||
{{- $ellipsed := false -}}
|
||||
{{- $shouldEllipse := false -}}
|
||||
{{- range $pag.Pagers -}}
|
||||
{{- $right := sub .TotalPages .PageNumber -}}
|
||||
{{- $showNumber := or (le .PageNumber 3) (eq $right 0) -}}
|
||||
{{- $showNumber := or $showNumber (le .TotalPages 5) -}}{{/* Issue #7523 */}}
|
||||
{{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) -}}
|
||||
{{- if $showNumber -}}
|
||||
{{- $ellipsed = false -}}
|
||||
{{- $shouldEllipse = false -}}
|
||||
{{- else -}}
|
||||
{{- $shouldEllipse = not $ellipsed -}}
|
||||
{{- $ellipsed = true -}}
|
||||
{{- end -}}
|
||||
{{- if $showNumber }}
|
||||
<li class="page-item{{ if eq . $pag }} active{{ end }}">
|
||||
<a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a>
|
||||
</li>
|
||||
{{- else if $shouldEllipse }}
|
||||
<li class="page-item disabled">
|
||||
<span aria-hidden="true"> … </span>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
<li class="page-item{{ if not $pag.HasNext }} disabled{{ end }}">
|
||||
<a {{ if $pag.HasNext }}href="{{ $pag.Next.URL }}"{{ end }} class="page-link" aria-label="Next"><span aria-hidden="true">»</span></a>
|
||||
</li>
|
||||
{{- with $pag.Last }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" class="page-link" aria-label="Last"><span aria-hidden="true">»»</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{ end }}
|
|
@ -7,8 +7,9 @@
|
|||
<ul>
|
||||
<!-- Ranges through content/posts/*.md -->
|
||||
{{ range .Site.RegularPages }}
|
||||
{{- partial "list.html" . -}}
|
||||
{{- partial "listitem.html" . -}}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{- partial "pagination.html" . -}}
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{{ define "main" }}
|
||||
<aside>
|
||||
<div class="container">
|
||||
<aside>
|
||||
<div>
|
||||
<section>
|
||||
<time class="post-date" datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
|
||||
|
@ -15,13 +16,13 @@
|
|||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
</aside>
|
||||
<!--
|
||||
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 .CurrentSection.Params.Title }}
|
||||
<aside class="menu">
|
||||
</aside>
|
||||
<!--
|
||||
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 .CurrentSection.Params.Title }}
|
||||
<aside class="menu">
|
||||
<p class="menu-label">
|
||||
Dans le dossier « {{ . }} »...
|
||||
</p>
|
||||
|
@ -36,17 +37,16 @@ with all other blog posts belonging to that case, emphasis to the current.
|
|||
href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</aside>
|
||||
{{ end }}
|
||||
<section>
|
||||
<h1>{{ .Title }}</h1>
|
||||
</aside>
|
||||
{{ end }}
|
||||
<section>
|
||||
<div>
|
||||
<article>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
<aside>
|
||||
</section>
|
||||
<aside>
|
||||
<div>
|
||||
{{ with .PrevInSection }}
|
||||
<a class="previous" href="{{ .Permalink }}"> {{ .Title }}</a>
|
||||
|
@ -55,5 +55,6 @@ with all other blog posts belonging to that case, emphasis to the current.
|
|||
<a class="next" href="{{ .Permalink }}"> {{ .Title }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</aside>
|
||||
</aside>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> {{ .Count }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{- partial "pagination.html" . -}}
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
<ul>
|
||||
<!-- Ranges through the term pages -->
|
||||
{{ range .Pages }}
|
||||
{{- partial "list.html" . -}}
|
||||
{{- partial "listitem.html" . -}}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{- partial "pagination.html" . -}}
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue