diff options
Moved site to website folder
15 files changed, 294 insertions, 0 deletions
| -rw-r--r-- | website/themes/natrium/layouts/404.html | 17 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/_default/list.html | 1 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/_default/single.html | 31 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/index.html | 20 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/partials/footer.html | 13 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/partials/head.html | 31 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/partials/header.html | 10 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/partials/list-item.html | 6 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/partials/nav.html | 14 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/partials/pagination.html | 34 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/rss.xml | 28 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/taxonomy/category.html | 18 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/taxonomy/category.terms.html | 22 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/taxonomy/tag.html | 18 | ||||
| -rw-r--r-- | website/themes/natrium/layouts/taxonomy/tag.terms.html | 31 |
diff --git a/website/themes/natrium/layouts/404.html b/website/themes/natrium/layouts/404.html new file mode 100644 index 0000000..28489eb --- /dev/null +++ b/website/themes/natrium/layouts/404.html @@ -0,0 +1,17 @@ +{{ partial "header" . }} + + <main class="content"> + <div> + <h1 class="error-page-title">404</h1> + </div> + <div class="error-page-content"> + {{ i18n "errorMessage" }} + <div> + <a href="{{ .Site.BaseURL }}"><i class="fa fa-chevron-up"></i></a> + </div> + </div> + </main> + +{{ partial "footer" . }} + + diff --git a/website/themes/natrium/layouts/_default/list.html b/website/themes/natrium/layouts/_default/list.html new file mode 100644 index 0000000..9353e44 --- /dev/null +++ b/website/themes/natrium/layouts/_default/list.html @@ -0,0 +1 @@ +/* Natrium doesn't support list.html. */ diff --git a/website/themes/natrium/layouts/_default/single.html b/website/themes/natrium/layouts/_default/single.html new file mode 100644 index 0000000..240109d --- /dev/null +++ b/website/themes/natrium/layouts/_default/single.html @@ -0,0 +1,31 @@ +{{ partial "header.html" . }} + +<main class="content" role="main"> + <article class="article"> + <h1 class="article-title">{{ .Title }}</h1> + {{ if eq .Section "post" }} + <span class="article-date">{{ .Date.Format "2006-01-02" }}</span> + {{ end }} + + <div class="article-content"> + {{ .Content }} + </div> + + <ul class="article-taxonomy"> + {{ if .Params.categories }} + <hr> + <li> + <i class="fa fa-category"></i>{{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ end }}<a href="{{ "categories/" | relURL }}{{ . | urlize }}">{{ . }}</a>{{ end }} + </li> + {{ end }} + + {{ if .Params.tags }} + <li> + <i class="fa fa-tags"></i>{{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ end }}<a href="{{ "tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>{{ end }} + </li> + {{ end }} + </article> + +</main> + +{{ partial "footer.html" . }} diff --git a/website/themes/natrium/layouts/index.html b/website/themes/natrium/layouts/index.html new file mode 100644 index 0000000..d71b3fa --- /dev/null +++ b/website/themes/natrium/layouts/index.html @@ -0,0 +1,20 @@ +{{ partial "header.html" . }} + +<main class="content"> + + <div class="list"> + {{ range (.Paginate ((where .Data.Pages "Type" "post").GroupByDate "2006")).PageGroups }} + <h2 class="list-title">{{ .Key }}</h2> + {{ range .Pages }} + + {{ partial "list-item.html" . }} + + {{ end }} + {{ end }} + </div> + + {{ partial "pagination.html" . }} + +</main> + +{{ partial "footer.html" . }} diff --git a/website/themes/natrium/layouts/partials/footer.html b/website/themes/natrium/layouts/partials/footer.html new file mode 100644 index 0000000..0230966 --- /dev/null +++ b/website/themes/natrium/layouts/partials/footer.html @@ -0,0 +1,13 @@ + <footer class="footer"> + <ul class="footer-links"> + <li> + <a href="{{ .Site.RSSLink }}" type="application/rss+xml" target="_blank"><i class="fa fa-rss"></i> {{ i18n "footerRSS" }}</a> + </li> + <li> + <a href="{{ .Site.Params.GitHubURL }}"><i class="fa fa-github"></i> Code</a> + </li> + </ul> + </footer> + </div> + </body> +</html> diff --git a/website/themes/natrium/layouts/partials/head.html b/website/themes/natrium/layouts/partials/head.html new file mode 100644 index 0000000..b17415e --- /dev/null +++ b/website/themes/natrium/layouts/partials/head.html @@ -0,0 +1,31 @@ +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +{{ .Hugo.Generator }} + +{{ if eq .URL "/" }} +<title>{{ .Title }}</title> +<meta property="og:title" content="{{ .Title }}"> +<meta property="og:type" content="website"> +{{ else }} +<title>{{ .Title }} - {{ .Site.Title }}</title> +<meta property="og:title" content="{{ .Title }} - {{ .Site.Title }}"> +{{ end }} + +{{ if eq .URL "/" }} +<meta property="description" content="{{ .Site.Params.description }}"> +{{ else }} + {{ if .Description }} + <meta property="description" content="{{ .Description }}"> + {{ end }} +{{ end }} + +{{ if .Keywords }} +<meta property="keywords" content ="{{ delimit .Keywords ", " }}"> +{{ end }} + +{{ if .RSSLink }} +<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> +{{ end }} + +<link rel="stylesheet" href="{{ .Site.BaseURL }}css/main.css" media="all"> +<link rel="stylesheet" href="{{ .Site.BaseURL }}css/fonts.css"> diff --git a/website/themes/natrium/layouts/partials/header.html b/website/themes/natrium/layouts/partials/header.html new file mode 100644 index 0000000..6a3b55c --- /dev/null +++ b/website/themes/natrium/layouts/partials/header.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="{{ .Site.LanguageCode }}"> + <head> + {{ partial "head.html" . }} + </head> + <body> + <div class="wrapper"> + <header class="header"> + {{ partial "nav.html" . }} + </header> diff --git a/website/themes/natrium/layouts/partials/list-item.html b/website/themes/natrium/layouts/partials/list-item.html new file mode 100644 index 0000000..245a80d --- /dev/null +++ b/website/themes/natrium/layouts/partials/list-item.html @@ -0,0 +1,6 @@ + <nav class="list-item"> + <a href="{{ .Permalink }}">{{ .Title }}</a> + <span class="list-item-date"> + {{ .Date.Format "2006-01-02" }} + </span> + </nav> diff --git a/website/themes/natrium/layouts/partials/nav.html b/website/themes/natrium/layouts/partials/nav.html new file mode 100644 index 0000000..607878c --- /dev/null +++ b/website/themes/natrium/layouts/partials/nav.html @@ -0,0 +1,14 @@ +<nav class="nav"> + <a href="{{ .Site.BaseURL }}" class="nav-logo"> + <img src="{{ .Site.BaseURL }}images/{{ .Site.Params.logo.url }}" + width="{{ .Site.Params.logo.width }}" + height="{{ .Site.Params.logo.height }}" + alt="{{ .Site.Params.logo.alt }}"> + </a> + + <ul class="nav-links"> + {{ range .Site.Menus.main }} + <li><a href="{{ .URL }}">{{ .Name }}</a></li> + {{ end }} + </ul> +</nav> diff --git a/website/themes/natrium/layouts/partials/pagination.html b/website/themes/natrium/layouts/partials/pagination.html new file mode 100644 index 0000000..d818c18 --- /dev/null +++ b/website/themes/natrium/layouts/partials/pagination.html @@ -0,0 +1,34 @@ +{{ $pag := $.Paginator }} +{{ if gt $pag.TotalPages 1 }} + +<ul class="page-links"> + <li + {{ if not $pag.HasPrev }}class="page-links-disabled"{{ end }}> + <a href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" aria-label="Previous"><span aria-hidden="true">< </span></a> + </li> + {{ $.Scratch.Set "__paginator.ellipsed" false }} + {{ range $pag.Pagers }} + {{ $right := sub .TotalPages .PageNumber }} + {{ $showNumber := or (le .PageNumber 3) (eq $right 0) }} + {{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }} + {{ if $showNumber }} + {{ $.Scratch.Set "__paginator.ellipsed" false }} + {{ $.Scratch.Set "__paginator.shouldEllipse" false }} + {{ else }} + {{ $.Scratch.Set "__paginator.shouldEllipse" (not ($.Scratch.Get "__paginator.ellipsed") ) }} + {{ $.Scratch.Set "__paginator.ellipsed" true }} + {{ end }} + {{ if $showNumber }} + <li + {{ if eq . $pag }}class="page-links-active"{{ end }}><a href="{{ .URL }}">{{ .PageNumber }}</a> + </li> + {{ else if ($.Scratch.Get "__paginator.shouldEllipse") }} + <li class="page-links-disabled"><span aria-hidden="true">…</span></li> + {{ end }} + {{ end }} + <li + {{ if not $pag.HasNext }}class="page-links-disabled"{{ end }}> + <a href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}" aria-label="Next"><span aria-hidden="true"> ></span></a> + </li> +</ul> +{{ end }} diff --git a/website/themes/natrium/layouts/rss.xml b/website/themes/natrium/layouts/rss.xml new file mode 100644 index 0000000..4008f49 --- /dev/null +++ b/website/themes/natrium/layouts/rss.xml @@ -0,0 +1,28 @@ +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> + <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} + <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} + <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} + <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range .Data.Pages }} + {{ if eq .Section "post" }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{ .Summary | html }}</description> + </item> + {{ end }} + {{ end }} + </channel> +</rss> diff --git a/website/themes/natrium/layouts/taxonomy/category.html b/website/themes/natrium/layouts/taxonomy/category.html new file mode 100644 index 0000000..d20298a --- /dev/null +++ b/website/themes/natrium/layouts/taxonomy/category.html @@ -0,0 +1,18 @@ +{{ partial "header.html" . }} + +<main class="content" role="main"> + + <div class="list"> + <h2 class="list-title">{{ .Title }}</h2> + {{ range .Paginator.Pages }} + + {{ partial "list-item.html" . }} + + {{ end }} + </div> + + {{ partial "pagination.html" . }} + +</main> + +{{ partial "footer.html" . }} diff --git a/website/themes/natrium/layouts/taxonomy/category.terms.html b/website/themes/natrium/layouts/taxonomy/category.terms.html new file mode 100644 index 0000000..d5ba7bc --- /dev/null +++ b/website/themes/natrium/layouts/taxonomy/category.terms.html @@ -0,0 +1,22 @@ +{{ partial "header.html" . }} + +<main class="content"> + + <div class="category"> + <h2 class="category-title">{{ i18n "categories" }}</h2> + {{ $data := .Data }} + {{ range $key, $value := .Data.Terms.Alphabetical }} + <ul class="category-item"> + <li> + <a href="{{ $.Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}">{{ $value.Name }}</a> + <span class="category-item-count"> + <sup>({{ $value.Count }})</sup> + </span> + </li> + </ul> + {{ end }} + </div> + +</main> + +{{ partial "footer.html" . }} diff --git a/website/themes/natrium/layouts/taxonomy/tag.html b/website/themes/natrium/layouts/taxonomy/tag.html new file mode 100644 index 0000000..08eb524 --- /dev/null +++ b/website/themes/natrium/layouts/taxonomy/tag.html @@ -0,0 +1,18 @@ +{{ partial "header.html" . }} + +<main class="content" role="main"> + + <div class="list"> + <h2 class="list-title">{{ .Title }}</h2> + {{ range .Paginator.Pages }} + + {{ partial "list-item.html" . }} + + {{ end }} + </div> + + {{ partial "pagination.html" . }} + +</main> + +{{ partial "footer.html" . }} diff --git a/website/themes/natrium/layouts/taxonomy/tag.terms.html b/website/themes/natrium/layouts/taxonomy/tag.terms.html new file mode 100644 index 0000000..77a68c7 --- /dev/null +++ b/website/themes/natrium/layouts/taxonomy/tag.terms.html @@ -0,0 +1,31 @@ +{{ partial "header.html" . }} + +<main class="content"> + + <div class="tag-cloud"> + <h2 class="tag-cloud-title">{{ i18n "tags" }}</h2> + {{ if not (eq (len $.Site.Taxonomies.tags) 0) }} + {{ $fontUnit := "rem" }} + {{ $largestFontSize := 2.5 }} + {{ $smallestFontSize := 1.0 }} + {{ $fontSpread := sub $largestFontSize $smallestFontSize }} + {{ $max := add (len (index $.Site.Taxonomies.tags.ByCount 0).Pages) 1 }} + {{ $min := len (index $.Site.Taxonomies.tags.ByCount.Reverse 0).Pages }} + {{ $spread := sub $max $min }} + {{ $fontStep := div $fontSpread $spread }} + <ul class="tag-cloud-item"> + {{ range $name, $taxonomy := $.Site.Taxonomies.tags }} + {{ $currentTagCount := len $taxonomy.Pages }} + {{ $currentFontSize := (add $smallestFontSize (mul (sub $currentTagCount $min) $fontStep) ) }} + {{ $count := len $taxonomy.Pages }} + {{ $weigth := div (sub (math.Log $count) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }} + {{ $currentFontSize := (add $smallestFontSize (mul (sub $largestFontSize $smallestFontSize) $weigth) ) }} + <li><a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" style="font-size:{{$currentFontSize}}{{$fontUnit}}">{{ $name }}</a></li> + {{ end }} + </ul> + {{ end }} + </div> + +</main> + +{{ partial "footer.html" . }} |
