feat: Avancement dans l'architecture du site

This commit is contained in:
2020-11-23 11:31:02 +01:00
parent f1fcafd47b
commit 2ff814cd9b
47 changed files with 536 additions and 227 deletions

View File

@ -1 +1,9 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>
{{/*
S'il n'y a pas de / dans l'url d'un lien alors on ajoute le path du répertoire
*/}}
{{ $isExternalLink := strings.HasPrefix .Destination "http" }}
{{ $isTelLink := strings.HasPrefix .Destination "tel:" }}
{{ $isMailtoLink := strings.HasPrefix .Destination "mailto:" }}
{{ $hasSlash := in .Destination "/" }}
{{ $path := cond (or (or $isTelLink $isMailtoLink) $hasSlash) .Destination (path.Join "/" .Page.Dir .Destination) }}
<a href="{{ $path | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if $isExternalLink }} target="_blank" rel="noopener"{{ end }}{{ if $isTelLink }} rel="nofollow"{{ end }}>{{ .Text | safeHTML }}</a>

View File

@ -1,8 +1,15 @@
{{ define "main" }}
<div class="container">
<h1>{{ .RenderString .Title }}</h1>
<div class="container">
<div class="container md">
{{ .Content }}
<ul>
{{ block "list" . }}
{{ range .Pages }}
<li><a href="{{ .URL }}">{{ .RenderString .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
</div>
</div>
{{ end }}

View File

@ -1,7 +1,7 @@
{{ define "main" }}
<div class="container">
<h1>{{ .RenderString .Title }}</h1>
<div class="container">
<div class="container md">
{{ .Content }}
</div>
</div>