better directory structure

master
Quentin Duchemin 2021-05-11 10:01:24 +02:00
parent 09d0098e22
commit 0b7d5cab2c
11 changed files with 158 additions and 9 deletions

1
.gitignore vendored 100644
View File

@ -0,0 +1 @@
ressources

View File

@ -1,9 +0,0 @@
# Global options
baseURL: "https://blog.chosto.me"
defaultContentLanguage: "fr"
enableEmoji: true
enableGitInfo: true
languageCode: "fr-fr"
languageName: "Français"
title: "Billets à la mer"
watch: true

28
config.yaml 100644
View File

@ -0,0 +1,28 @@
# Global options
baseURL: https://blog.chosto.me
defaultContentLanguage: fr
enableEmoji: true
enableGitInfo: true
footnoteReturnLinkContents:
languageCode: fr-fr
languageName: Français
watch: true
# All pages under posts section will have this link structure
permalinks:
posts: /:year/:month/:day/:title/
# Disable all privacy unfriendly stuff
privacy:
disqus:
disable: true
googleAnalytics:
disable: true
instagram:
disable: true
twitter:
disable: true
vimeo:
disable: true
youtube:
disable: true

View File

@ -0,0 +1,7 @@
---
title: Billets à la mer
subtitle: et oui
---
Test
Salut les potes

View File

@ -0,0 +1,10 @@
---
categories:
- Technologie
- Réflexions
tags:
- smartphone
- addiction
title: Ma première page
date: "2021-05-10"
---

View File

@ -0,0 +1,12 @@
1: "janvier"
2: "février"
3: "mars"
4: "avril"
5: "mai"
6: "juin"
7: "juillet"
8: "août"
9: "septembre"
10: "octobre"
11: "novembre"
12: "décembre"

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
{{ block "title" . }}
{{ .Site.Title }}
{{ end }}
</title>
</head>
<body>
<!-- Code that all your templates share, like a header -->
{{ block "main" . }}
<!-- The part of the page that begins to differ between templates -->
{{ end }}
{{ block "footer" . }}
<!-- More shared code, perhaps a footer but that can be overridden if need be in -->
{{ end }}
</body>
</html>

View File

@ -0,0 +1,19 @@
{{ define "main" }}
<main>
<article>
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
</article>
<ul>
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }}
<li>
<a href="{{.Permalink}}">{{.Date.Format "02 Jan 2006"}} | {{.Title}}</a>
</li>
{{ end }}
</ul>
</main>
{{ end }}

View File

@ -0,0 +1,42 @@
{{ define "main" }}
<section id="main">
<h1 id="title">{{ .Title }}</h1>
<div>
<article id="content">
{{ .Content }}
</article>
</div>
</section>
<aside id="meta">
<div>
<section>
<time class="post-date" datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
Article publié le {{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }} (dernière modification le {{ .Lastmod.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Lastmod.Month) }} {{ .Lastmod.Year }})
</time>
<h4 id="wordcount"> {{ .WordCount }} mots </h5>
</section>
{{ with .Params.categories }}
<ul id="categories">
{{ range . }}
<li><a href="{{ "categories" | absURL}}/{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
{{ end }}
{{ with .Params.tags }}
<ul id="tags">
{{ range . }}
<li> <a href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
{{ end }}
</div>
<div>
{{ with .PrevInSection }}
<a class="previous" href="{{.Permalink}}"> {{.Title}}</a>
{{ end }}
{{ with .NextInSection }}
<a class="next" href="{{.Permalink}}"> {{.Title}}</a>
{{ end }}
</div>
</aside>
{{ end }}

19
layouts/index.html 100644
View File

@ -0,0 +1,19 @@
{{ define "main" }}
<main>
<header>
<h1>{{.Title}}</h1>
{{ with .Params.subtitle }}
<span>{{.}}</span>
{{ end }}
</header>
<div>
<!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
{{.Content}}
</div>
<div>
{{ range first 10 .Site.RegularPages }}
{{ .Render "summary"}}
{{ end }}
</div>
</main>
{{ end }}