First version of the theme

This commit is contained in:
Gregory Trolliet 2021-10-26 11:34:30 +02:00
commit 8dd30f6eb8
61 changed files with 1658 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<footer class="archive-footer">
<span class="footer-return">
<a href="#">{{ i18n "page_top" | humanize }}</a>
</span><br/>
{{ if .PrevInSection }}
<span class="footer-link">
<span class="label">{{ i18n "previous_article" | humanize }}:</span>
<a href="{{ .PrevInSection.RelPermalink }}">
{{ .PrevInSection.Title }}
</a>
{{ if .NextInSection }}
<span class="spacer"></span>
{{ end }}
</span>
{{ end }}
{{ if .NextInSection }}
<span class="footer-link">
<span class="label">{{ i18n "next_article" | humanize }}:</span>
<a href="{{ .NextInSection.RelPermalink }}">
{{ .NextInSection.Title }}
</a>
</span>
{{ end }}
</footer>

View file

@ -0,0 +1,9 @@
<div id="author">
<div id="avatar" aria-hidden="true">
<img src="images/{{ .Site.Params.avatar }}" alt="avatar"/>
</div>
<div id="description">
<h1>{{ .Site.Params.author }}</h1>
<h2>{{ .Site.Params.info }}</h2>
</div>
</div>

View file

@ -0,0 +1,13 @@
{{ if . }}
<div class="categories">
<img class="page-icon header-icon" src="/svg/folder.svg"/>
{{ range $index, $el := . }}
{{ if gt $index 0 }}
<span class="separator"></span>
{{ end }}
<a href="{{ ( printf "categories/%s/" ( $el | urlize ) ) | relLangURL }}">
{{ . }}
</a>
{{ end }}
</div>
{{ end }}

View file

@ -0,0 +1,5 @@
<div id="footer">
<div id="footer-name" class="footer-element">{{ .Site.Params.name }}</div>
<!--div id="footer-mail" class="footer-element"><a href="mailto:{{ .Site.Params.mail }}">{{ .Site.Params.mail }}</a></div-->
{{ partial "social.html" . }}
</div>

View file

View file

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang='{{ .Site.Language.Lang }}'>
<head>
<title>{{ .Title }}</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
{{ if .Description }}
<meta name="description" content="{{ .Description }}">
{{ else }}
<meta name="description" content="{{ .Site.Params.description }}">
{{ end }}
{{ if .Params.Tags }}
<meta name="keywords" content="{{ delimit .Params.Tags ", "}}">
{{ else }}
<meta name="keywords" content="{{ .Site.Params.keywords }}">
{{ end }}
{{ if .Params.author }}
<meta name="author" content="{{ .Params.author }}">
{{ else }}
<meta name="author" content="{{ .Site.Params.author }}">
{{ end }}
<link rel="stylesheet" href="/css/style.css">
<link href="{{ .Site.RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}">
{{ if and (.Site.Params.favicon) (fileExists (print "static/images/" .Site.Params.favicon)) }}
{{ $name := .Site.Params.favicon }}
{{ $splitted := split $name "." }}
{{ $extension := index $splitted 1 }}
{{ if ( in "svg" $extension) }}
<link rel="icon" type="image/svg+xml" href="{{ $.Site.BaseURL }}images/{{ $name }}" sizes="any">
{{ else if (in "gif png" $extension) }}
<link rel="icon" type="image/{{ $extension }}" href="{{ $.Site.BaseURL }}images/{{ $name }}">
{{ end}}
{{ else if (fileExists "static/images/favicon.svg") }}
<link rel="icon" type="image/svg+xml" href="{{ $.Site.BaseURL }}images/favicon.svg">
{{ else if (fileExists "static/images/favicon.png") }}
<link rel="icon" type="image/png" href="{{ $.Site.BaseURL }}images/favicon.png">
{{ end }}
{{ partial "opengraph.html" . }}
{{ range .Site.Params.custom_css }}
<link rel="stylesheet" href="{{ . | relURL }}"/>
{{ end }}
{{ hugo.Generator }}
</head>

View file

@ -0,0 +1,22 @@
<nav id="navigation">
<section class="navigation-container">
<a id="navigation-title" href="/">
{{ .Site.Title }}
</a>
<input type="checkbox" id="menu-toggle" />
<label class="menu-button" for="menu-toggle">
<div class="menu-button-inner">
<div class="menu-button-image"></div>
</div>
</label>
<ul id="navigation-list">
{{ range .Site.Home.Pages }}
<li class="navigation-item">
<a href="{{ .RelPermalink }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</section>
</nav>

View file

@ -0,0 +1,38 @@
<meta name="twitter:card" content="summary_large_image"/>
{{ with .Site.Params.twitterUser }}
<meta name="twitter:site" content="@{{ . }}"/>
{{ end }}
<meta name="twitter:title" content="{{ .Title }}"/>
{{ if .Description }}
<meta name="twitter:description" content="{{ .Description }}"/>
{{ else }}
<meta name="twitter:description" content="{{ .Site.Params.description }}"/>
{{ end }}
<meta property="og:title" content="{{ .Title }}" />
{{ if .Description }}
<meta property="og:description" content="{{ .Description }}"/>
{{ else }}
<meta property="og:description" content="{{ .Site.Params.description }}"/>
{{ end }}
{{ if eq .Kind "page" }}
<meta property="og:type" content="article" />
{{ else }}
<meta property="og:type" content="website" />
{{ end }}
<meta property="og:url" content="{{ .Permalink }}" />
{{ $title := .Title }}
{{if .Params.images }}
{{ $baseUrl := .Permalink }}
{{ $altText := i18n "alt_image" }}
{{ range first 1 .Params.images }}
<meta property="og:image" content="{{ $baseUrl }}{{ . }}"/>
<meta property="og:image:alt" content="{{ $altText }} {{ $title }}"/>
{{ end }}
{{ else }}
<meta property="og:image" content="{{ .Site.BaseURL }}images/avatar.png"/>
<meta property="og:image:alt" content="{{ i18n "alt_avatar" . }}"/>
{{ end }}
<meta property="og:updated_time" content="{{ .Site.LastChange }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" />

View file

@ -0,0 +1,51 @@
{{ $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 2 }}
<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 (sub $paginator.TotalPages 1) }}
<li><a href="{{ $paginator.Last.URL }}">&raquo;</a></li>
{{ end }}
{{ end }}
</ul>
{{ end }}

View file

@ -0,0 +1,11 @@
{{ with .Site.Params.social }}
<ul id="social">
{{ range sort . "weight" }}
<li class="social-element">
<a href="{{ safeURL .url }}" rel="me" aria-label="{{ .name }}" title="{{ .name }}">
<img class="social-icon" src="{{ .Site.BaseURL }}/svg/{{ .icon }}.svg" alt="{{ .name }}" aria-hidden="true">
</a>
</li>
{{ end }}
</ul>
{{ end }}

View file

@ -0,0 +1,11 @@
{{ if . }}
<div class="tags">
<img class="page-icon header-icon" src="/svg/tag.svg"/>
{{ range $index, $el := . }}
{{ if gt $index 0 }}
<span class="separator"></span>
{{ end }}
<a href="{{ ( printf "tags/%s/" ( $el | urlize ) ) | relLangURL }}">{{ . }}</a>
{{ end }}
</div>
{{ end }}