initial commit

This commit is contained in:
Matthieu Bessat 2022-12-10 11:37:36 +01:00
commit b55f54eb6d
68 changed files with 1761 additions and 0 deletions

3
layouts/404.html Normal file
View file

@ -0,0 +1,3 @@
{{ define "main" }}
<h1>Page non trouvé</h1>
{{ end }}

View file

@ -0,0 +1,11 @@
{{ if .Title }}
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
<figcaption>{{ .Title }}</figcaption>
</figure>
{{ else }}
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
</figure>
{{ end }}

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
{{ partial "head.html" . }}
{{- block "head" . -}}{{ end }}
</head>
<body>
<div class="footer-push">
{{ partial "header" . }}
{{ block "main" . }}{{ end }}
</div>
{{ partial "footer" . }}
</body>
</html>

View file

@ -0,0 +1,26 @@
{{ define "main" }}
<main class="page-container">
{{ $listtitle := .Title }}
{{ if or .Title .Content }}
<div>
{{ with .Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Content }}<div>{{ . }}</div>{{ end }}
</div>
{{ end }}
<ul>
{{ range .Paginator.Pages }}
<li>
<div class="post-title">
{{ if eq $listtitle "Posts" }}
{{ .Date.Format "2006-01-02" }} <a href="{{ .RelPermalink }}">{{.Title }}</a>
{{ else }}
<a href="{{ .RelPermalink }}">{{.Title }}</a>
{{ end }}
</div>
</li>
{{ end }}
</ul>
{{ partial "pagination.html" . }}
</main>
{{ end }}

View file

@ -0,0 +1,32 @@
{{ define "main" }}
<main class="page-container">
<article class="article">
<h1>{{ .Title }}</h1>
{{ with .Date }}
<div>Publié le <b><time>{{ . | time.Format ":date_full" }}</time></b></div>
{{ end }}
{{ if .Params.featured_image }}
{{ $featuredImage := .Resources.GetMatch (.Params.featured_image.src | safeURL) }}
{{ if $featuredImage }}
{{ $featuredImage = $featuredImage.Resize "600x" }}
<figure>
<img alt="" src="{{ $featuredImage.RelPermalink }}" />
{{ with .Params.featured_image.caption }}
<figcaption>{{ . }}</figcaption>
{{ end }}
</figure>
{{ end }}
{{ end }}
{{ range .Params.tags }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
<div>
{{ .Content }}
</div>
</article>
</main>
{{ end }}

View file

@ -0,0 +1,13 @@
<article>
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<b><time>{{ .Date.Format (default "2006-01-02 15:04:05" .Site.Params.dateFmt) }}</time></b>
{{ range .Params.tags }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
<div>
{{ .Summary }}
{{ if .Truncated }}
<a href="{{ .Permalink }}">Read more...</a>
{{ end }}
</div>
</article>

View file

@ -0,0 +1,53 @@
{{ define "main" }}
<main class="page-container">
{{ $listtitle := .Title }}
{{ if or .Title .Content }}
<div>
{{ with .Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Content }}<div>{{ . }}</div>{{ end }}
</div>
{{ end }}
<ul class="news-list">
{{ range .Paginator.Pages }}
<li class="news-item">
<a href="{{ .RelPermalink }}" class="news-item__image">
{{ $featuredImage := (resources.Get (printf "%s" ("cover/cover.jpg" | safeURL))) }}
{{ if .Params.featured_image }}
{{ $featuredImage = .Resources.GetMatch (.Params.featured_image.src | safeURL) }}
{{ end }}
{{ $featuredImage := $featuredImage.Resize "450x" }}
<figure>
<img alt="" src="{{ $featuredImage.RelPermalink }}" />
{{ with .Params.featured_image.caption }}
<figcaption>{{ . }}</figcaption>
{{ end }}
</figure>
</a>
<div class="news-item__content">
<h2
class="news-item__title"
>
<a
href="{{ .RelPermalink }}"
>
{{.Title }}
</a>
</h2>
<p class="news-item__date">
{{ $date := .Date.Format "2006-01-02" }}
<time datetime="{{ $date }}">
{{ time.Format "2 January 2006" $date }}
</time>
</p>
<div class="news-item__summary">
{{ .Summary }}...
</div>
</div>
</li>
{{ end }}
</ul>
{{ partial "pagination.html" . }}
</main>
{{ end }}

View file

@ -0,0 +1,36 @@
{{ define "main" }}
<main class="page-container">
<article class="article">
<h1>{{ .Title }}</h1>
{{ if .Date }}
<div class="article__date">
Publié le
{{ $date := .Date.Format "2006-01-02" }}
<time date="{{ $date }}">{{ time.Format "2 January 2006" $date }}</time>
</div>
{{ end }}
{{ if .Params.featured_image }}
{{ $featuredImage := .Resources.GetMatch (.Params.featured_image.src | safeURL) }}
{{ if $featuredImage }}
{{ $featuredImage = $featuredImage.Resize "600x" }}
<figure class="article__featured-image">
<img alt="" src="{{ $featuredImage.RelPermalink }}" />
{{ with .Params.featured_image.caption }}
<figcaption>{{ . }}</figcaption>
{{ end }}
</figure>
{{ end }}
{{ end }}
{{ range .Params.tags }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
<div>
{{ .Content }}
</div>
</article>
</main>
{{ end }}

View file

@ -0,0 +1,16 @@
{{ define "main" }}
<main class="page-container">
<h1>Informations de contact</h2>
<div class="columns-two">
<div>
{{ partial "contact-card" }}
</div>
<div>
<!-- https://www.openstreetmap.org/node/9526690022 -->
<!-- 49,1755136, 1,3343608 -->
{{ partial "slippy-map" (dict "lat" 49.175513 "lng" 1.33436 "zoom" 15) }}
</div>
</div>
</main>
{{ end }}

53
layouts/index.html Normal file
View file

@ -0,0 +1,53 @@
{{ define "main" }}
<main class="page-container">
<div class="landing">
<div class="landing-one">
<div class="landing-brand">
<!-- <img class="half-wheel-logo" src="/half_wheel_logo.svg" alt="Demi Roue" /> -->
<div class="brand__logo landing-half-wheel-logo">
{{ partial "svg" "half_wheel_logo" }}
</div>
<h1 class="brand__name">Bicycl'Eure</h1>
<div class="brand__role1-container">
<h2 class="text">Atelier mobile</h2>
</div>
<div class="brand__role2">Réparation &amp; Entretien - Toutes marques</div>
<!-- <img class="full-logo" src="/full_logo.jpg" alt="Logo complet" /> -->
</div>
<div class="landing-description">
<!-- <p> -->
<!-- Bicycl'Eure est un atelier mobile de réparation et d'entretien de VÉLOS. Sur simple rendez-vous et après un diagnostic gratuit, Laurent, technicien cycle qualifié, redonnera vie à votre monture ! -->
<!-- </p> -->
<!-- <p>Éco-Responsable et Économique !</p> -->
{{ .Content }}
</div>
</div>
<!-- <div class="contact-card-container"> -->
<!-- <div class="contact-card"> -->
<!-- <div class="address"> -->
<!-- <div> -->
<!-- 30 Résidence des Trois Moulins -->
<!-- </div> -->
<!-- <div> -->
<!-- 27940 Aubevoye Le Val d'Hazey -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="legal-id"> -->
<!-- SIRET 537577 785 00018 -->
<!-- </div> -->
<!-- <div class="phone"> -->
<!-- 06 52 64 05 37 -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
</div>
{{/*
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
{{ range $paginator.Pages }}
{{ .Render "summary" }}
{{ end }}
{{ partial "pagination.html" . }}
*/}}
</main>
{{ end }}

View file

@ -0,0 +1,37 @@
<dl class="card contact-card">
<dt>
Nom
</dt>
<dd>
{{ site.Data.contact.name }}
</dd>
<dt>Téléphone</dt>
<dd>
<a href="tel:{{ site.Data.contact.phone }}">{{ site.Data.contact.phone }}</a>
</dd>
<dt>Adresse électronique</dt>
<dd>
<a href="mailto:{{ site.Data.contact.email }}">{{ site.Data.contact.email }}</a>
</dd>
<dt>Facebook</dt>
<dd>
<a href="{{ site.Data.contact.facebook.url }}">{{ site.Data.contact.facebook.name }}</a>
</dd>
<dt>Adresse</dt>
<dd>
{{ site.Data.contact.address.house_number }}
{{ site.Data.contact.address.street_name }}<br>
{{ site.Data.contact.address.postal_code }}
{{ site.Data.contact.address.quarter }}
{{ site.Data.contact.address.city }}
</dd>
<dt>SIRET</dt>
<dd>
{{ site.Data.contact.siret }}
</dd>
</dl>

View file

@ -0,0 +1,13 @@
<!-- Use site subtitle by default -->
{{ $description := .Site.Params.sidebar.subtitle }}
{{ if .Description }}
<!-- Page description exists -->
{{ $description = .Description }}
{{ else if .IsPage }}
<!-- Use page summary -->
{{ $description = .Summary }}
{{ end }}
{{ return ($description | plainify)}}

View file

@ -0,0 +1,39 @@
{{- $title := .Title -}}
{{- $siteTitle := .Site.Title -}}
{{- if .IsHome -}}
<!-- Homepage, and it's pagination -->
<!-- Build paginator -->
{{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ $pag := .Paginate ($filtered) }}
{{ if .Paginator.HasPrev }}
<!-- Paginated. Append page number to title -->
{{ $title = printf "%s - %s" .Paginator $siteTitle }}
{{ else }}
{{ $title = $siteTitle}}
{{ end }}
{{- else if eq .Kind "term" -}}
<!-- Taxonomy page -->
<!-- Build paginator -->
{{ $notHidden := where .Pages "Params.hidden" "!=" true }}
{{ $pag := .Paginate ($notHidden) }}
<!-- {TAXONOMY_TYPE}: {TAXONOMY_TERM} -->
{{ $title = slice (title .Data.Singular) ": " $title }}
{{ if .Paginator.HasPrev }}
<!-- Add page number-->
{{ $title = $title | append " - " .Paginator }}
{{ end }}
{{ $title = $title | append " - " $siteTitle }}
{{ $title = delimit $title "" }}
{{- end -}}
{{ return $title }}

View file

@ -0,0 +1,7 @@
<footer class="site-footer">
<div class="site-footer__content page-container">
<a href="/"><b>{{ .Site.Title }}</b></a>.
<a href="/a-propos-du-site">A propos de ce site</a>.
<a href="/contact">Nous contacter</a>.
</div>
</footer>

View file

@ -0,0 +1,29 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{- $description := partialCached "data/description" . .RelPermalink -}}
<meta name="description" content="{{ $description }}">
{{- with .Site.Params.author -}}
<meta name="author" content="{{ . }}">
{{ end }}
{{- $title := partialCached "data/title" . .RelPermalink -}}
<title>{{ $title }}</title>
<link rel="canonical" href="{{ .Permalink }}">
{{ partial "opengraph/include.html" . }}
{{ range .AlternativeOutputFormats }}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end }}
{{ with .Site.Params.favicon }}
<link rel="shortcut icon" href="{{ . }}" />
{{ end }}
<!-- Note: j'ai galérer à rajouter du scss car en fait y'avait déja une variable $style de définit plus haut... -->
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">

View file

@ -0,0 +1,20 @@
<header class="site-header">
<div class="site-header__content page-container">
<a class="site-header__title" href="/">
<img
class="site-header__logo"
src=""
alt="Logo Bicycleure"
/>
</a>
<nav class="site-header__nav">
<a href="/tarifs">Tarifs</a>.
<a href="/contact">Contact</a>.
<a href="/actualites">Actualités</a>.
<a href="/avis">Avis</a>.
{{ range .Site.Menus.main }}
<a href="{{ .URL | relURL }}"><b>{{ .Name }}</b></a>.
{{ end }}
</nav>
</div>
</header>

View file

@ -0,0 +1,63 @@
<!-- Modified to have the featured image field as a dict (being able to specify meta data and display option for image) -->
{{ $result := dict "exists" false "permalink" nil "resource" nil "isDefault" false }}
{{ $imageField := "featured_image" }}
{{ $imageValue := index .Context.Params $imageField }}
{{ printf "%#v" "hello debu" }}
{{ if $imageValue }}
{{ $imageValue := index $imageValue "src" }}
<!-- If page has `image` field set -->
{{ $result = merge $result (dict "exists" true) }}
{{ $url := urls.Parse $imageValue }}
{{ if or (eq $url.Scheme "http") (eq $url.Scheme "https") }}
<!-- Is an external image -->
{{ $result = merge $result (dict "permalink" $imageValue) }}
{{ else }}
{{ $pageResourceImage := .Context.Resources.GetMatch (printf "%s" ($imageValue | safeURL)) }}
{{ if $pageResourceImage }}
<!-- If image is found under page bundle -->
{{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }}
<!-- Disable SVG image processing, not supported by Hugo -->
{{ if ne (path.Ext $imageValue) ".svg" }}
{{ $result = merge $result (dict "resource" $pageResourceImage) }}
{{ end }}
{{ else }}
<!-- Can not find the image under page bundle. Could be a relative linked image -->
{{ $result = merge $result (dict "permalink" (relURL $imageValue)) }}
{{ end }}
{{ end }}
{{ else }}
<!-- Type arg is set, check for defaultImage setting -->
{{ $defaultImageSetting := .Context.Site.Params.defaultImage }}
{{ $result = merge $result (dict "isDefault" true) }}
{{ $result = merge $result (dict "exists" true) }}
{{ if $defaultImageSetting.local }}
{{ $siteResourceImage := resources.GetMatch (printf "%s" ($defaultImageSetting.src | safeURL)) }}
{{ if $siteResourceImage }}
<!-- Try search image under site's assets folder -->
{{ $result = merge $result (dict "permalink" $siteResourceImage.RelPermalink) }}
{{ $result = merge $result (dict "resource" $siteResourceImage) }}
{{ else }}
<!-- Can not find the image -->
{{ errorf "Failed loading image: %q" $defaultImageSetting.src }}
{{ $result = merge $result (dict "exists" false) }}
{{ end }}
{{ else }}
<!-- External image -->
{{ $result = merge $result (dict "permalink" (relURL $defaultImageSetting.src)) }}
{{ end }}
{{ end }}
{{ return $result }}

View file

@ -0,0 +1,54 @@
<div class="gallery">
<div class="gallery__side">
{{ $listtitle := .Title }}
{{ if or .Title .Content }}
<div>
{{ with .Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Content }}<div>{{ . }}</div>{{ end }}
</div>
{{ end }}
<p class="gallery-tags__title">Filtrer par étiquettes :</p>
<ul class="gallery-tags__list tags-list">
{{- if eq (.Scratch.Get "image_list_context") "imtags" -}}
<li class="gallery-tags__item tags-list__item">
<a href="/images">Tout</a>
</li>
{{- end -}}
{{- range .Site.Taxonomies.imtags -}}
<li class="gallery-tags__item tags-list__item">
<a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a>
</li>
{{- end -}}
</ul>
</div>
<div class="gallery__items-container">
<div class="gallery__items">
{{ range $item := (.Paginator 8).Pages }}
<a class="gallery__item" href="{{ .RelPermalink }}">
{{ $image := .Resources.GetMatch "original.jpg" }}
{{ $image := $image.Resize "x350" }}
{{ with $image }}
<img
class="gallery__image"
title="{{ $item.Title }}"
src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}"
/>
{{ end }}
{{/*
<div class="post-title">
{{ if eq $listtitle "Posts" }}
{{ .Date.Format "2006-01-02" }} <a href="{{ .RelPermalink }}">{{.Title }}</a>
{{ else }}
<a href="{{ .RelPermalink }}">{{.Title }}</a>
{{ end }}
</div>
*/}}
</a>
{{ end }}
</div>
{{ partial "pagination.html" . }}
</div>
</div>

View file

@ -0,0 +1,42 @@
{{- $title := partialCached "data/title" . .RelPermalink -}}
{{- $description := partialCached "data/description" . .RelPermalink -}}
<meta property='og:title' content='{{ $title }}'>
<meta property='og:description' content='{{ $description }}'>
<meta property='og:url' content='{{ .Permalink }}'>
<meta property='og:site_name' content='{{ .Site.Title }}'>
<meta property='og:type' content='
{{- if .IsPage -}}
article
{{- else -}}
website
{{- end -}}
'>
<meta property='og:locale' content='{{ .Site.LanguageCode }}'>
{{- if .IsPage -}}
<meta property='article:section' content='{{ .Section | title }}' />
{{- range .Params.tags -}}
<meta property='article:tag' content='{{ . }}' />
{{- end -}}
{{- end -}}
{{- if .IsPage -}}
{{- if not .Date.IsZero -}}
<meta property='article:published_time' content='{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
{{- end -}}
{{- if not .Lastmod.IsZero -}}
<meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
{{- end -}}
{{- else -}}
{{- if not .Site.LastChange.IsZero -}}
<meta property='og:updated_time' content='{{ .Site.LastChange.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
{{- end -}}
{{- end -}}
{{ $image := partialCached "helpers/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }}
{{- if $image.exists -}}
<meta property='og:image' content='{{ absURL $image.permalink }}' />
{{- end -}}

View file

@ -0,0 +1,19 @@
<div class="pagination-nav">
<div>
{{ if .Paginator.HasPrev }}
<a class="pagination-nav__prev" href="{{ .Paginator.Prev.URL }}">
Page précédente
</a>
{{ end }}
</div>
<div class="pagination-nav__page">
{{ .Paginator.PageNumber }} de {{ .Paginator.TotalPages }}
</div>
<div>
{{ if .Paginator.HasNext }}
<a class="pagination-nav__next" href="{{ .Paginator.Next.URL }}">
Page suivante
</a>
{{ end }}
</div>
</div>

View file

@ -0,0 +1,14 @@
<aside>
<div>
<div>
<h3>LATEST POSTS</h3>
</div>
<div>
<ul>
{{ range first 5 (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</div>
</div>
</aside>

View file

@ -0,0 +1,16 @@
<div class="maplibre-map" id="short-code-slippy-map"></div>
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />
<script>
var map = new maplibregl.Map({
container: 'short-code-slippy-map',
style:
'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL',
center: [{{ .lng}}, {{ .lat }}],
zoom: {{ .zoom }}
});
var marker = new maplibregl.Marker()
.setLngLat([{{ .lng }}, {{ .lat }}])
.addTo(map);
</script>

View file

@ -0,0 +1,7 @@
{{ $svg := . }}
{{ $class := print $svg "-icon" }}
{{ $match := "<svg (.*)?>(.*)</svg>" }}
{{ $replaceWith := printf `<svg class="%s" ${1}>${2}</svg>` $class }}
{{ return (replaceRE $match $replaceWith (printf "/assets/images/%s.svg" $svg | readFile) | safeHTML) }}

View file

@ -0,0 +1,16 @@
<div class="maplibre-map" id="short-code-slippy-map"></div>
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />
<script>
var map = new maplibregl.Map({
container: 'short-code-slippy-map',
style:
'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL',
center: [{{ .Get "lng" }}, {{ .Get "lat" }}],
zoom: {{ .Get "zoom" }}
});
var marker = new maplibregl.Marker()
.setLngLat([{{ .Get "lng" }}, {{ .Get "lat" }}])
.addTo(map);
</script>

View file

@ -0,0 +1,57 @@
{{ define "main" }}
<main class="large-container">
{{ .Content }}
<div class="pricing-layout">
<div>
<div class="moves">
<h2>Forfait déplacement</h2>
<ul>
{{ range $.Site.Data.pricing.move }}
<li class="move-item">
De {{ .min }} à {{ .max }} km : {{ if eq .price 0 }}Gratuit{{ else }}{{ .price }} €{{ end }}
</li>
{{ end }}
</ul>
</div>
<div class="forfaits">
{{ range $.Site.Data.pricing.forfait }}
<div class="forfait">
<h2>{{ .name }}</h2>
<div class="forfait-price">{{ .price }} €</div>
<ul>
{{ range .components }}
<li>{{ .name }}</li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
</div>
<div class="operations-container">
<h2>Liste des opérations</h2>
<div class="operations-mosaic">
{{ range $.Site.Data.pricing.standalone }}
<div class="operations-category">
<h3>{{ .name }}</h3>
<table class="operations-table">
<tr>
<th>Opération</th>
<th class="operation-price">Prix</th>
</tr>
{{ range .components }}
<tr>
<td>{{ .name }}</td>
<td class="operation-price">{{ .price }} €</td>
</tr>
{{ end }}
</table>
</div>
{{ end }}
</div>
</div>
</div>
</main>
{{ end }}