Website Summary Files Commits Branches @commit @diff @stats
path: root / website / themes / natrium / layouts / taxonomy
diff options
context:
space:
mode:
Commit3245f1f1404785d92c21eb381c08dee5a4be6bb7 (patch)
Author
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2018-09-04 09:08:41 +0300
Committer
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2018-09-04 09:08:41 +0300
Files3c245582fb5a2a9eaf8518f7272c03a6aaa2f635 /website/themes/natrium/layouts/taxonomy
IPL-3245f1f1404785d92c21eb381c08dee5a4be6bb7.tar
IPL-3245f1f1404785d92c21eb381c08dee5a4be6bb7.tar.gz
IPL-3245f1f1404785d92c21eb381c08dee5a4be6bb7.zip
Parentae12c0a482298e4da9b816137ceb6131c7d4b9e4 (diff)
Moved site to website folder
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" . }}