Move some files to a better place, remove some unused file

This commit is contained in:
Gregory Trolliet 2019-09-20 10:56:51 +02:00
parent 0bbda99e9c
commit 89e88cf1e1
27 changed files with 13 additions and 13 deletions

3
layouts/404.html Normal file
View file

@ -0,0 +1,3 @@
{{ define "content" }}
{{ partial "404.html" . }}
{{ end }}

View file

@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
{{ with .Site.Params.keywords }}<meta name="keywords" content="{{ . }}">{{ end }}
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/opengraph.html" . }}
{{ if .Permalink }}
<base href="{{ .Permalink }}">
{{ end }}
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ if .Permalink }}
<link rel="canonical" href="{{ .Permalink }}">
{{ end }}
<!-- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous" /> -->
{{ if .Site.IsServer }}
{{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
{{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
{{ else }}
{{ $cssOpts := (dict "targetPath" "css/coder.css" ) }}
{{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
{{ end }}
{{ if .Site.Params.rtl }}
{{ if .Site.IsServer }}
{{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
{{ else }}
{{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" ) }}
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
{{ end }}
{{ end }}
{{ if .Site.Params.inverted }}
{{ if .Site.IsServer }}
{{ $cssOpts := (dict "targetPath" "css/coder-inverted.css" "enableSourceMap" true ) }}
{{ $styles := resources.Get "scss/coder-inverted.scss" | resources.ExecuteAsTemplate "style.coder-inverted.css" . | toCSS $cssOpts }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
{{ else }}
{{ $cssOpts := (dict "targetPath" "css/coder-inverted.css" ) }}
{{ $styles := resources.Get "scss/coder-inverted.scss" | resources.ExecuteAsTemplate "style.coder-inverted.css" . | toCSS $cssOpts | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
{{ end }}
{{ end }}
{{ range .Site.Params.custom_css }}
<link rel="stylesheet" href="{{ . | relURL }}"/>
{{ end }}
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | absURL }}" sizes="32x32">
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | absURL }}" sizes="16x16">
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ hugo.Generator }}
</head>
<body class="{{ if .Site.Params.rtl }}rtl{{ end }} {{ if .Site.Params.inverted }}inverted{{ end }}">
<main class="wrapper">
{{ partial "header.html" . }}
<div class="content">
{{ block "content" . }}{{ end }}
</div>
{{ partial "footer.html" . }}
</main>
{{ template "_internal/google_analytics.html" . }}
</body>
</html>

View file

@ -0,0 +1,11 @@
{{ define "title" }}
{{- if eq .Kind "taxonomy" -}}
{{- i18n .Data.Singular | title -}}
{{- print ": " -}}
{{- end -}}
{{- .Title }} · {{ .Site.Title -}}
{{ end }}
{{ define "content" }}
{{ partial "list.html" . }}
{{ end }}

View file

@ -0,0 +1,6 @@
{{ define "title" }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
{{ partial "page.html" . }}
{{ end }}

3
layouts/index.html Normal file
View file

@ -0,0 +1,3 @@
{{ define "content" }}
{{ partial "home.html" . }}
{{ end }}

View file

@ -0,0 +1,7 @@
<section class="container centered">
<div class="error">
<h1>404</h1>
<h2>{{ i18n "page_not_found" }}</h2>
<p>{{ i18n "page_does_not_exist" }}<br />{{ i18n "head_back" .Site.BaseURL | safeHTML }}</p>
</div>
</section>

View file

@ -0,0 +1,16 @@
<footer class="footer">
<section class="container">
{{ with .Site.Params.footercontent }}
<p>{{ . }}</p>
{{ end }}
{{ if not .Site.Params.hideCopyright }} © {{ now.Format "2006" }}{{ end }}
{{ if not .Site.Params.hideCredits }}
{{ if not .Site.Params.hideCopyright }} · {{ end }}
{{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
{{ end }}
{{ if .Site.Params.commit }}
{{ if or (not .Site.Params.hideCredits) (not .Site.Params.hideCopyright) }} · {{ end }}
[<a href="{{ .Site.Params.commit }}{{ getenv "GIT_COMMIT_SHA" }}">{{ getenv "GIT_COMMIT_SHA_SHORT" }}</a>]
{{ end }}
</section>
</footer>

View file

@ -0,0 +1,35 @@
<nav class="navigation">
<section class="container">
<a class="navigation-title" href="{{ .Site.BaseURL | absLangURL }}">
{{ .Site.Title }}
</a>
<input type="checkbox" id="menu-toggle" />
<label class="menu-button float-right" for="menu-toggle"><i class="fas fa-bars"></i></label>
<ul class="navigation-list">
{{ with .Site.Menus.main}}
{{ range sort . }}
<li class="navigation-item">
<a class="navigation-link" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
{{ if .Site.IsMultiLingual }}
{{ $node := . }}
{{ .Scratch.Set "separator" true }}
{{ range .Site.Home.AllTranslations }}
{{ if ne $.Site.Language .Language }}
{{ if $node.Scratch.Get "separator" }}
<li class="navigation-item menu-separator">
<span>|</span>
</li>
{{ $node.Scratch.Set "separator" false }}
{{ end }}
<li class="navigation-item">
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>
</section>
</nav>

View file

@ -0,0 +1,30 @@
<section class="container centered">
<div class="about">
{{ with .Site.Params.avatarurl }}
<div class="avatar"><img src="{{ . | relURL }}" alt="avatar"></div>
{{ end }}
<h1>{{ .Site.Params.author }}</h1>
<h2>{{ .Site.Params.info }}</h2>
{{ with .Site.Params.social }}
<ul>
{{ range sort . "weight" }}
{{ if .icon }}
<li>
{{ if eq .type "tel"}}
<a href="tel:{{ .url }}" rel="me" aria-label="{{ .name }}" title="{{ .name }}">
{{ else }}
<a href="{{ .url }}" rel="me" aria-label="{{ .name }}" title="{{ .name }}">
{{ end }}
<i class="{{ .icon }}" aria-hidden="true"></i>
</a>
</li>
{{ else }}
<li>
<a href="{{ .url }}" rel="me" aria-label="{{ .name }}" title="{{ .name }}">{{ .name }}</a>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}
</div>
</section>

View file

@ -0,0 +1,19 @@
<section class="container list">
<h1 class="title">
{{- if eq .Kind "taxonomy" -}}
{{- i18n .Data.Singular | title -}}
{{- print ": " -}}
{{- end -}}
{{- .Title -}}
</h1>
<ul>
{{ range .Paginator.Pages }}
<li>
<span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
<a class="title" href="{{ .Params.ExternalLink | default .URL }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
{{ partial "pagination.html" . }}
</section>

View file

@ -0,0 +1,9 @@
<section class="container page">
<article>
<header>
<h1>{{ .Title }}</h1>
</header>
{{ .Content }}
</article>
</section>

View file

@ -0,0 +1,48 @@
{{ $paginator := .Paginator }}
{{ $adjacent_links := 2 }}
{{ $max_links := (add (mul $adjacent_links 2) 1) }}
{{ $lower_limit := (add $adjacent_links 1) }}
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
{{ if gt $paginator.TotalPages 1 }}
<ul class="pagination">
{{ if $paginator.HasPrev }}
{{ if ne $paginator.PageNumber 1 }}
<li><a href="{{ $paginator.First.URL }}">&laquo;</a></li>
{{ end }}
<li class="hidden"><a href="{{ $paginator.Prev.URL }}">&lsaquo;</a></li>
{{ end }}
{{ range $paginator.Pagers }}
{{ $.Scratch.Set "page_number_flag" false }}
{{ if gt $paginator.TotalPages $max_links }}
{{ if le $paginator.PageNumber $lower_limit }}
{{ if le .PageNumber $max_links }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ else if ge $paginator.PageNumber $upper_limit }}
{{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ else }}
{{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ end }}
{{ else }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ if eq ($.Scratch.Get "page_number_flag") true }}
{{ if eq . $paginator }}
<li>{{ .PageNumber }}</li>
{{ else }}
<li><a href="{{ .URL }}">{{ .PageNumber }}</a></li>
{{ end }}
{{ end }}
{{ end }}
{{ if $paginator.HasNext }}
<li class="hidden"><a href="{{ $paginator.Next.URL }}">&rsaquo;</a></li>
{{ if ne $paginator.PageNumber $paginator.TotalPages }}
<li><a href="{{ $paginator.Last.URL }}">&raquo;</a></li>
{{ end }}
{{ end }}
</ul>
{{ end }}

View file

@ -0,0 +1,3 @@
{{- if and (not (eq .Site.DisqusShortname "" )) (eq (.Site.Params.disable_comments | default false) false) -}}
{{ template "_internal/disqus.html" . }}
{{- end -}}

View file

@ -0,0 +1,24 @@
{{- if .Params.math -}}
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$']],
displayMath: [['$$','$$']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: { extensions: ["AMSmath.js", "AMSsymbols.js"] }
}
});
MathJax.Hub.Queue(function() {
// Fix <code> tags after MathJax finishes running. This is a
// hack to overcome a shortcoming of Markdown. Discussion at
// https://github.com/mojombo/jekyll/issues/199
var all = MathJax.Hub.getAllJax(), i;
for(i = 0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
{{- end -}}

View file

@ -0,0 +1,24 @@
{{ $currentPageUrl := .URL }}
{{ if .Params.series }}
<section class="see-also">
{{ range .Params.series }}
<h3>See also in {{ . }}</h3>
{{ $name := . | urlize }}
{{ $series := index $.Site.Taxonomies.series $name }}
{{ if gt (len $series.Pages) 0 }}
<nav>
<ul>
{{ $maxItems := $.Site.Params.maxSeeAlsoItems | default 5 }}
{{ range first (add $maxItems 1) $series.Pages }}
{{ if ne .URL $currentPageUrl }}
<li>
<a href="{{ .Params.ExternalLink | default .URL }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
</section>
{{ end }}

View file

@ -0,0 +1,9 @@
<div class="categories">
<i class="fas fa-folder"></i>
{{- range $index, $el := . -}}
{{- if gt $index 0 }}
<span class="separator"></span>
{{- end }}
<a href="{{ ( printf "categories/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
{{- end -}}
</div>

View file

@ -0,0 +1,9 @@
<div class="tags">
<i class="fas fa-tag"></i>
{{- range $index, $el := . -}}
{{- if gt $index 0 }}
<span class="separator"></span>
{{- end }}
<a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
{{- end -}}
</div>

7
layouts/posts/li.html Normal file
View file

@ -0,0 +1,7 @@
<li>
<span class="date">
{{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}
<!--{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}-->
</span>
<a class="title" href="{{ .Params.ExternalLink | default .URL }}">{{ .Title }}</a>
</li>

16
layouts/posts/list.html Normal file
View file

@ -0,0 +1,16 @@
{{ define "title" }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
<section class="container list">
<h1 class="title">{{ .Site.Params.Posts }}</h1>
<ul>
{{- range .Paginator.Pages -}}
{{- .Render "li" -}}
{{- end -}}
</ul>
{{ partial "pagination.html" . }}
</section>
{{ end }}

42
layouts/posts/single.html Normal file
View file

@ -0,0 +1,42 @@
{{ define "title" }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
<section class="container post">
<article>
<header>
<div class="post-title">
<h1 class="title">{{ .Title }}</h1>
</div>
<div class="post-meta">
<div class="date">
<span class="posted-on">
<i class="fas fa-calendar"></i>
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
Article publié le {{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}
<!--{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}-->
</time>
</span>
<span class="reading-time">
<i class="fas fa-clock"></i>
{{ i18n "reading_time" .ReadingTime }}
</span>
</div>
{{ with .Page.Params.Categories }}{{ partial "taxonomy/categories" . }}{{ end }}
{{ with .Page.Params.Tags }}{{ partial "taxonomy/tags" . }}{{ end }}
</div>
</header>
<div>
{{ .Content }}
</div>
<footer>
{{ partial "posts/series" . }}
{{ partial "posts/disqus" . }}
</footer>
</article>
{{ partial "posts/math" . }}
</section>
{{ end }}