feat: Avancement sur le design
This commit is contained in:
5
layouts/_default/_markup/render-image.html
Normal file
5
layouts/_default/_markup/render-image.html
Normal file
@ -0,0 +1,5 @@
|
||||
{{/*
|
||||
S'il n'y a pas de / dans l'url d'une image alors on ajoute le path de l'article
|
||||
*/}}
|
||||
{{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.Dir .Destination) }}
|
||||
<img src="{{ $path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
|
1
layouts/_default/_markup/render-link.html
Normal file
1
layouts/_default/_markup/render-link.html
Normal file
@ -0,0 +1 @@
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>
|
@ -4,7 +4,7 @@
|
||||
<body>
|
||||
{{ partial "header.html" . }}
|
||||
{{ block "all" . }}
|
||||
<main role="main" id="content">
|
||||
<main role="main" id="content" class="container">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
{{ end }}
|
||||
|
@ -1,10 +1,7 @@
|
||||
{{ define "main" }}
|
||||
{{ if .Params.Image }}
|
||||
<img class="cover" src="{{ .Params.Image }}" alt="{{ .Title }}"/>
|
||||
{{ end }}
|
||||
<div class="container grid-lg contenu {{ if .Params.Image }}contenu-image{{end}}">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<div class="container grid-sm">
|
||||
<div class="container">
|
||||
<h1>{{ .RenderString .Title }}</h1>
|
||||
<div class="container">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,10 +1,7 @@
|
||||
{{ define "main" }}
|
||||
{{ if .Params.Image }}
|
||||
<img class="cover" src="{{ .Params.Image }}" alt="{{ .Title }}"/>
|
||||
{{ end }}
|
||||
<div class="container grid-lg contenu {{ if .Params.Image }}contenu-image{{end}}">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<div class="container grid-sm">
|
||||
<div class="container">
|
||||
<h1>{{ .RenderString .Title }}</h1>
|
||||
<div class="container">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
|
56
layouts/home.html
Normal file
56
layouts/home.html
Normal file
@ -0,0 +1,56 @@
|
||||
{{ define "main" }}
|
||||
<div class="container">
|
||||
<h1>Le fil <strong>des actualités</strong></h1>
|
||||
<div class="infos">
|
||||
<div class="news">
|
||||
{{ $headless := .Site.GetPage "/news" }}
|
||||
{{ $lastnews := first 4 (sort $headless.Pages "Date" "desc") }}
|
||||
{{ $first := index (first 1 $lastnews) 0 }}
|
||||
{{ $others := after 1 $lastnews }}
|
||||
{{ with $first }}
|
||||
<div class="post last">
|
||||
<div class="picture">
|
||||
{{ $image := .Resources.GetMatch (default "*" .Params.image) }}
|
||||
{{ $resized := $image.Fill "220x220 Center"}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img src="{{ $resized.RelPermalink }}" alt="{{ .RenderString .Title }}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="info">
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}</time> - {{ .Params.catégorie }}
|
||||
</div>
|
||||
<h2 title="{{ .RenderString .Title }}"><a href="{{ .RelPermalink }}">{{ .RenderString .Title }}</a></h2>
|
||||
<div class="text">
|
||||
{{ .Content | truncate 280 }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ range $others }}
|
||||
<div class="post ">
|
||||
<div class="picture">
|
||||
{{ $image := .Resources.GetMatch (default "*" .Params.image) }}
|
||||
{{ if $image }}
|
||||
{{ $resized := $image.Fill "100x100 Center"}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img src="{{ $resized.RelPermalink }}" alt="{{ .Title }}" />
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="details">
|
||||
<span><time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}</time> - {{ .Params.catégorie }}</span>
|
||||
<h3 title="{{ .Title }}"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
||||
<div class="text">
|
||||
{{ .Content | truncate 200 }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="opening">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
@ -1,10 +0,0 @@
|
||||
{{ define "all" }}
|
||||
|
||||
|
||||
<div class="container grid-lg contenu {{ if .Params.Image }}contenu-image{{end}}">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<div class="container grid-sm">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
8
layouts/news/single.html
Normal file
8
layouts/news/single.html
Normal file
@ -0,0 +1,8 @@
|
||||
{{ define "main" }}
|
||||
<div class="container">
|
||||
<h1>{{ .RenderString .Title }}</h1>
|
||||
<div class="container news">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
@ -1,32 +1,23 @@
|
||||
{{ $headless := .Site.GetPage "/viemunicipale" }}
|
||||
<footer class="footer">
|
||||
<div class="container grid-xl">
|
||||
<div class="columns">
|
||||
<div class="column col-4 col-md-6 text-right">
|
||||
<img src="logo.png" alt="Blason de Crémeaux" height="80" width="229" class="float-right" style="max-width: inherit">
|
||||
</div>
|
||||
<div class="column col-8 col-md-6">
|
||||
<h5>Mairie</h5>
|
||||
<p>Lundi – Mardi – Jeudi – Vendredi : 8h30 à 12h15<br>Mercredi : 9h15 à 12h15</p>
|
||||
<ul>
|
||||
<li>📞 04 77 62 50 67</li>
|
||||
<li>📫 mairie@cremeaux.fr</li>
|
||||
</ul>
|
||||
<h5>Bibliothèque Municipale</h5>
|
||||
<p>Mercredi : 16h40 à 18h40<br>Vendredi – Samedi : 10h à 12h</p>
|
||||
<ul>
|
||||
<li>📞 04 77 62 82 66</li>
|
||||
<li>📫 bibliotheque@cremeaux.fr</li>
|
||||
</ul>
|
||||
<h5>Agence Postale</h5>
|
||||
<p>Mardi – Mercredi – Jeudi – Vendredi – Samedi : 9h15 à 12h15</p>
|
||||
<ul>
|
||||
<li>📞 04 77 62 56 49</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="address">
|
||||
<h3>Mairie de Crémeaux</h3>
|
||||
<p>Place de Pierre-Bénite</p>
|
||||
<p>42260 Crémeaux</p>
|
||||
<p>04 77 62 50 67</p>
|
||||
<p>mairie@cremeaux.fr</p>
|
||||
</div>
|
||||
<div class="logo">
|
||||
<img src="/icons/logo-footer.png" alt="Commune de Crémeaux" />
|
||||
</div>
|
||||
<div class="horaire">
|
||||
<h3>Horaire d'ouverture<br>au public :</h3>
|
||||
<p>Lundi, mardi, jeudi et vendredi : 8h30 à 12h15</p>
|
||||
<p>Mercredi : 9h15 à 12h15</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<footer class="explain">
|
||||
Ce site est réalisé de façon <a href="https://weko.io">éco-responsable, économe en énergie sans aucun traceur</a>.
|
||||
Ce site est réalisé par <a href="https://weko.io">Weko</a> de façon <a href="https://weko.io">éco-responsable, économe en énergie et sans aucun traceur</a>.
|
||||
</footer>
|
||||
|
@ -1,14 +1,21 @@
|
||||
|
||||
<header class="header">
|
||||
{{ $headless := .Site.GetPage "/" }}
|
||||
{{ $image := $headless.Resources.GetMatch "*" }}
|
||||
{{ $resized := $image.Fill "1400x600 Top"}}
|
||||
<img class="hero" src="{{ $resized.RelPermalink }}" alt="{{ .Title }}" />
|
||||
<header class="header{{ if .IsHome }} home{{ end }}">
|
||||
{{ if .Resources }}
|
||||
{{ $image := .Resources.GetMatch (default "*" .Params.image) }}
|
||||
{{ if $image }}
|
||||
{{ $resized := $image.Fill "1400x600 Center"}}
|
||||
<img class="hero" src="{{ $resized.RelPermalink }}" alt="{{ .Title }}" />
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $headless := .Site.GetPage "/" }}
|
||||
{{ $image := $headless.Resources.GetMatch "*" }}
|
||||
{{ $resized := $image.Fill "1400x600 Top"}}
|
||||
<img class="hero" src="{{ $resized.RelPermalink }}" alt="{{ .Title }}" />
|
||||
{{ end }}
|
||||
<nav class="nav">
|
||||
<div class="container">
|
||||
<div class="logo">
|
||||
<a href="/" class="">
|
||||
<img src="/icons/logo.jpg" alt="Blason de Crémeaux" />
|
||||
<img src="/icons/logo-header.png" alt="Blason de Crémeaux" />
|
||||
</a>
|
||||
</div>
|
||||
<button class="open-button">≡ Menu</button>
|
||||
@ -16,7 +23,7 @@
|
||||
{{ range .Site.Menus.main }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
<img src="/icons/{{ .Identifier }}.jpg" alt="{{ .Name }}" />
|
||||
<img class="icons" src="/icons/{{ .Identifier }}.svg" alt="{{ .Name }}" />
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{{ $headless := .Site.GetPage "/viemunicipale/lemotdumaire" }}
|
||||
<div class="maire">
|
||||
{{ $image := $headless.Resources.GetMatch "*" }}
|
||||
{{ $image := $headless.Resources.GetMatch "maire.jpg" }}
|
||||
{{ $resized := $image.Resize "300x" }}
|
||||
<img class="round" src="{{ $resized.RelPermalink }}" alt="Didier PONCET" />
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user