first commit

This commit is contained in:
Gabriele Musco 2020-08-24 08:48:03 +02:00
commit f9eb307cca
38 changed files with 1394 additions and 0 deletions

7
layouts/404.html Normal file
View file

@ -0,0 +1,7 @@
{{ define "main" }}
<article>
<h1>
This is not the page you were looking for
</h1>
</article>
{{ end }}

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
<div id="content">
{{- partial "header.html" . -}}
<main>
{{- block "main" . }}{{- end }}
</main>
{{- partial "footer.html" . -}}
</div>
</body>
</html>

View file

@ -0,0 +1,18 @@
{{ define "main" }}
<h2>
<span>
{{ $title := .Title }}
{{ $section := .Section | humanize }}
{{ if and (ne $section $title) (ne $section "Tags") }}
{{ $section }}:
{{ end }}
{{ if and (eq $section "Tags") (ne $section $title) }}#{{ end }}{{ $title }}
</span>
</h2>
<ul>
{{ range .Pages }}
<li><span class="date">{{ .Date.Format "2006-01-02" }}</span> <a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}

View file

@ -0,0 +1,16 @@
{{ define "main" }}
<article>
<h1>{{ .Title }}</h1>
<p class="date">{{ .Date.Format "2006-01-02" }}</p>
<div>{{ .Content }}</div>
{{ if .Params.tags }}
<hr />
<p>
<h4>Tags:</h4>
{{ range .Params.tags }}
<a href="/tags/{{ . }}">#{{ . }}</a>
{{ end }}
</p>
{{ end }}
</article>
{{ end }}

47
layouts/index.html Normal file
View file

@ -0,0 +1,47 @@
{{ define "main" }}
{{/* get all the pages that are regular posts and not pages */}}
{{ $postsDir := .Site.Params.Posts | default (slice "posts") }}
{{ $postsList := where .Site.RegularPages "Section" "in" $postsDir }}
{{/* pagination */}}
{{ range (.Paginate $postsList).Pages }}
<div class="card">
<h3>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h3>
<p class="date">
{{ .Date.Format "2006-01-02" }}
{{ if .Params.tags }}
<br />
<small>{{ range .Params.tags }}#{{ . }} {{ end }}</small>
{{ end }}
</p>
<div class="articlePreview">
{{ .Summary }}
<a href="{{ .Permalink }}">Continue reading -></a>
</div>
<hr />
</div>
{{ end }}
{{ if gt .Paginator.TotalPages 1 }}
<div id="pageNavigation">
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL }}" title="Previous page">&lt;&lt;&lt;</a>
{{ end }}
{{ $currentPage := .Paginator.PageNumber }}
{{ range .Paginator.Pagers }}
{{ if ne .PageNumber $currentPage }}
<a href="{{ .URL }}">{{ .PageNumber }}</a>
{{ else }}
<span>[{{ .PageNumber }}]</span>
{{ end }}
{{ end }}
{{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL }}" title="Next page">&gt;&gt;&gt;</a>
{{ end }}
</div>
{{ end }}
{{ end }}

View file

@ -0,0 +1,10 @@
<footer>
<hr />
<p><small>
{{ now.Format "2006" }} &copy; {{ .Site.Copyright }}
</small></p>
<p><small>
<a href="https://gitlab.com/gabmus/hugo-ficurinia">Ficurinia theme</a> for <a href="https://gohugo.io">Hugo</a> by <a href="https://gabmus.org">Gabriele Musco</a>.
Licensed under <a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3</a>.
</small></p>
</footer>

View file

@ -0,0 +1,23 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=7">
{{ if .OutputFormats.Get "RSS" }}
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .Permalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ .Permalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
{{ end }}
{{ end }}
<link rel="shortcut icon" href='{{ .Site.Params.favicon | default "/img/favicon.png" }}' type="image/x-icon" />
<title>
{{ if ne .Title .Site.Title }}
{{ .Title }} &ndash;
{{ end }}
{{ .Site.Title | default "Ficurinia" }}
</title>
<link href="/symbols-nerd-font/symbols-nerd-font.css" rel="stylesheet">
<link href="/jetbrains-mono/jetbrains-mono.css" rel="stylesheet">
{{ $style := resources.Get "/scss/style.scss" | resources.ExecuteAsTemplate "/scss/style.scss" . | resources.ToCSS (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") | resources.Fingerprint "sha512" }}
<link type=text/css rel=stylesheet href={{ $style.Permalink }} integrity="{{ $style.Data.Integrity }}" />

View file

@ -0,0 +1,27 @@
<header>
<div id="titleContainer">
<img src='{{ .Site.Params.Logo | default "/img/icon.svg" }}' />
<div>
<h1>{{ .Site.Title | default "Ficurinia" }}</h1>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/posts">Posts</a></li>
{{ $pagesDir := .Site.Params.Pages | default (slice "pages") }}
{{ $pagesList := where .Site.RegularPages "Section" "in" $pagesDir }}
{{ range $pagesList }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
{{ if (.Site.Params.showTags | default true) }}
<li><a href="/tags">Tags</a></li>
{{ end }}
</ul>
</nav>
</div>
</div>
<div id="links">
{{ range .Site.Params.links }}
{{- partial "nerdlink" . -}}
{{ end }}
</div>
</header>

View file

@ -0,0 +1,31 @@
<a
target="_blank"
class="nerdlink"
href="{{ index . 1 }}"
title="{{ index . 0 }}">
{{ if eq (lower (index . 0)) "gitlab" }}
&#xf296;
{{ else if eq (lower (index . 0)) "gnome" }}
&#xf7ab;
{{ else if eq (lower (index . 0)) "youtube" }}
&#xf16a;
{{ else if eq (lower (index . 0)) "email" }}
&#xf6ed;
{{ else if eq (lower (index . 0)) "twitter" }}
&#xf099;
{{ else if eq (lower (index . 0)) "instagram" }}
&#xf16d;
{{ else if eq (lower (index . 0)) "facebook" }}
&#xf09a;
{{ else if eq (lower (index . 0)) "github" }}
&#xf09b;
{{ else if eq (lower (index . 0)) "linkedin" }}
&#xf0e1;
{{ else if eq (lower (index . 0)) "telegram" }}
&#xf2c6;
{{ else if eq (lower (index . 0)) "phone" }}
&#xf095;
{{ else }}
{{ index . 0 }}
{{ end }}
</a>