listing des articles un peu plus fournis
This commit is contained in:
parent
2fe8d5a5ae
commit
207e46f02b
25 changed files with 263 additions and 119 deletions
|
|
@ -4,7 +4,9 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ .Title }}</title>
|
||||
|
||||
<title>{{ .Title }} - L'Étoile de Bethéem</title>
|
||||
|
||||
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
|
||||
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
{{/*
|
||||
|
|
@ -12,9 +14,16 @@
|
|||
<link rel="stylesheet" href="{{ . | relURL }}?rnd={{ now.Unix }}">
|
||||
{{- end }}
|
||||
*/}}
|
||||
{{/*
|
||||
{{ with .OutputFormats.Get "RSS" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{- end }}
|
||||
*/}}
|
||||
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ 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 }}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,25 @@
|
|||
<main class="page-container">
|
||||
<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 }}
|
||||
|
|
|
|||
53
layouts/actualites/list.html
Normal file
53
layouts/actualites/list.html
Normal 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 }}
|
||||
36
layouts/actualites/single.html
Normal file
36
layouts/actualites/single.html
Normal 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 }}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
{{ define "main" }}
|
||||
<main class="page-container">
|
||||
<h1>Reconstruison pierre après pierre...</h1>
|
||||
<b>🚧 Site en construction... 🚧</b>
|
||||
{{ .Content }}
|
||||
{{/*
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
|
||||
{{ range $paginator.Pages }}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<nav class="site-header__nav">
|
||||
<a href="/actualites"><b>Actualité</b></a>.
|
||||
<a href="/association"><b>L'association</b></a>.
|
||||
<a href="/histoires"><b>Histoire de la chapelle</b></a>.
|
||||
<a href="/histoires"><b>Histoire</b></a>.
|
||||
<a href="/images"><b>Gallerie</b></a>.
|
||||
{{ range .Site.Menus.main }}
|
||||
<a href="{{ .URL | relURL }}"><b>{{ .Name }}</b></a>.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue