feat: Avancement dans l'architecture du site
This commit is contained in:
@ -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>
|
||||
|
@ -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 }}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{ define "main" }}
|
||||
<div class="container">
|
||||
<h1>{{ .RenderString .Title }}</h1>
|
||||
<div class="container">
|
||||
<div class="container md">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user