Browse Source

added tag cloud, fixed a typo and fixed categories page

master
jk 3 years ago
parent
commit
e8a6eb2048
  1. 2
      content/note/5ff0e1e2/index.md
  2. 21
      themes/nipponalba/layouts/_default/list.html
  3. 23
      themes/nipponalba/layouts/partials/aside.html
  4. 24
      themes/nipponalba/static/css/style.css

2
content/note/5ff0e1e2/index.md

@ -2,7 +2,7 @@
category:
- environment
- sustainability
- consumarism
- consumerism
- materialism
- 'electronic waste'
- 1

21
themes/nipponalba/layouts/_default/list.html

@ -1,11 +1,11 @@
{{ define "main" }}
<section class="archive">
<section class="archive-listing">
<span class="list-title">{{ humanize .Name }}<a href="{{ .Permalink }}index.xml"><i class="fa fa-rss fa-2x fa-fw" aria-hidden="true" title="{{ .Name }} RSS feed"></i></a></span>
<ul class="listing">
<span class="list-title">{{if eq .Name "Category"}}Categories{{ else }}{{ humanize .Name }}{{ end }}<a href="{{ .Permalink }}index.xml"><i class="fa fa-rss fa-2x fa-fw" aria-hidden="true" title="{{ .Name }} RSS feed"></i></a></span>
{{ range .Pages }}
<li class="post h-feed contents">
{{ if eq .Type "note"}}
{{ if eq .Type "note"}}
<ul class="listing">
<li class="post h-feed contents">
<span class="archive_content h-entry entry">
<span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "2 Jan 2006 15:04 GMT" }}</time></a></span>
<span class="headline">{{ range .Params.category }}
@ -20,10 +20,15 @@
<section class="info">
<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span><br/>
</section>
</span>{{end}}
</li>
{{ end }}</ul>
</span>
</li>
</ul>
{{ end }}{{ end }}
{{if eq .Page.Permalink "https://sakino.kelbie.scot/category/"}}
<ul class="listing">
{{ range .Site.Taxonomies.category }}
{{if not (in (slice "1" "2" "3" "4" "5") .Page.Title )}}<li class="list-without-title"><a href="{{ .Page.Permalink }}">{{ humanize .Page.Title }}</a></li>{{ end }}{{ end }}
</ul>{{ end }}
</section>
</section>
{{ end }}

23
themes/nipponalba/layouts/partials/aside.html

@ -29,6 +29,29 @@
</section>
</section>
<hr/>
<section class="panel panel-default">
<div class="panel-heading">
<b>Categories</b>
<div style="float: right"><a href="{{ "/category/" | relLangURL }}">- full list -</a></div>
</div>
{{ if not (eq (len $.Site.Taxonomies.category) 0) }}
{{ $fontUnit := "rem" }}
{{ $largestFontSize := 1.6 }}
{{ $smallestFontSize := 1.0 }}
{{ $max := len (index $.Site.Taxonomies.category.ByCount 0).Pages }}
{{ $min := len (index $.Site.Taxonomies.category.ByCount.Reverse 0).Pages }}
<div id="category-cloud">
{{ range $name, $taxonomy := $.Site.Taxonomies.category }}
{{ $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) ) }}
<!--Current font size: {{$currentFontSize}}-->
{{if not (in (slice "1" "2" "3" "4" "5") $name)}}<a href="{{ "/category/" | relLangURL }}{{ $name | urlize }}" style="font-size:{{$currentFontSize}}{{$fontUnit}}">{{ $name }}</a>{{ end }}
{{ end }}
</div>
{{ end }}
</section>
<hr/>
<section class="site-info">&copy; {{ now.Format "2006"}} | <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">CC-BY 4.0</a> | <a href="{{ .Permalink }}index.xml"><i class="fa fa-rss fa-fw" aria-hidden="true" title="Blog RSS feed"></i></a><br/>
Made with ❤ and <a href="https://gohugo.io/">Hugo</a> <br/>by <a href="https://jon.kelbie.scot" target="_blank">Jon Kelbie</a></section>

24
themes/nipponalba/static/css/style.css

@ -328,7 +328,7 @@ main {
box-shadow: 0 2px 3px var(--shadow-colour);
border: 1px solid var(--border-colour);
border-radius:15px;
height: 770px;
height: 1030px;
grid-column: 2;
max-width:250px;
width:rgb(255, 0, 0);px;
@ -575,7 +575,10 @@ main {
.list-with-title .listing .listing-post a:hover {
color: var(--link-colour);
}
.list-without-title{
list-style: none;
padding: 5px 0;
}
.readmore {
font-size: 14px;
text-align:left;
@ -668,6 +671,23 @@ ul li {
list-style:circle;
}
.panel{
width:230px;
border-radius: 15px;
padding: 0;
border: 1px solid var(--border-colour);
margin: 0;
}
.panel-heading{
border-bottom: 1px solid var(--border-colour);
text-align:left;
padding: 5px 10px;
}
#category-cloud{
width:97%;
margin: 0 auto;
padding: 10px 0;
}
@media screen and (max-width: 960px) {
#page-top {
width: 95%;

Loading…
Cancel
Save