Browse Source

making bookmarks page a bit more dynamic

master
jk 4 years ago
parent
commit
ec1f62cc9b
  1. 45
      themes/nipponalba/layouts/partials/backup_bookmarks.html
  2. 40
      themes/nipponalba/layouts/partials/bookmarks.html

45
themes/nipponalba/layouts/partials/backup_bookmarks.html

@ -0,0 +1,45 @@
<h4>Brewing</h4>
{{ range .Site.Data.bookmarks }}
{{ if eq .category "Brewing"}}
<section data-post-type="bookmark-of" data-post-id="{{ .Params.slug }}" class="bookmark h-entry">
<div class="author" style="display:none">
<a rel="author" class="p-author h-card" rel="me" href="https://jk.nipponalba.scot"><img src="/images/profile.jpg"/><div class="title">{{ .Site.Params.Title }}</div></a>
</div>
<aside>
<article class="h-cite">
<u><a href="{{ .bookmarkof | absURL }}" class="u-bookmark-of" target="_blank">{{ .name }}</a></u> - <div class="p-name p-content">{{ .content | markdownify }}</div>
</article>
</aside>
</section>
{{ end }}
{{ end }}
<h4>Scottish Politics</h4>
{{ range .Site.Data.bookmarks }}
{{ if eq .category "Scottish Politics"}}
<section data-post-type="bookmark-of" data-post-id="{{ .Params.slug }}" class="bookmark h-entry">
<div class="author" style="display:none">
<a rel="author" class="p-author h-card" rel="me" href="https://jk.nipponalba.scot"><img src="/images/profile.jpg"/><div class="title">{{ .Site.Params.Title }}</div></a>
</div>
<aside>
<article class="h-cite">
<u><a href="{{ .bookmarkof | absURL }}" class="u-bookmark-of" target="_blank">{{ .name }}</a></u> - <div class="p-name p-content">{{ .content | markdownify }}</div>
</article>
</aside>
</section>
{{ end }}
{{ end }}
<h4>Vegan Recipes</h4>
{{ range .Site.Data.bookmarks }}
{{ if eq .category "Vegan Recipes"}}
<section data-post-type="bookmark-of" data-post-id="{{ .Params.slug }}" class="bookmark h-entry">
<div class="author" style="display:none">
<a rel="author" class="p-author h-card" rel="me" href="https://jk.nipponalba.scot"><img src="/images/profile.jpg"/><div class="title">{{ .Site.Params.Title }}</div></a>
</div>
<aside>
<article class="h-cite">
<u><a href="{{ .bookmarkof | absURL }}" class="u-bookmark-of" target="_blank">{{ .name }}</a></u> - <div class="p-name p-content">{{ .content | markdownify }}</div>
</article>
</aside>
</section>
{{ end }}
{{ end }}

40
themes/nipponalba/layouts/partials/bookmarks.html

@ -1,6 +1,13 @@
<h4>Brewing</h4>
{{ $cats := slice }}
{{ range .Site.Data.bookmarks }}
{{ if eq .category "Brewing"}}
{{ $cats = $cats | append .category }}
{{ end }}
{{ $cats = uniq $cats | sort }}
{{ range $cats }}
{{ $cat := . }}
<h4>{{ $cat }}</h4>
{{ range $.Site.Data.bookmarks }}
{{ if eq .category $cat }}
<section data-post-type="bookmark-of" data-post-id="{{ .Params.slug }}" class="bookmark h-entry">
<div class="author" style="display:none">
<a rel="author" class="p-author h-card" rel="me" href="https://jk.nipponalba.scot"><img src="/images/profile.jpg"/><div class="title">{{ .Site.Params.Title }}</div></a>
@ -13,33 +20,4 @@
</section>
{{ end }}
{{ end }}
<h4>Scottish Politics</h4>
{{ range .Site.Data.bookmarks }}
{{ if eq .category "Scottish Politics"}}
<section data-post-type="bookmark-of" data-post-id="{{ .Params.slug }}" class="bookmark h-entry">
<div class="author" style="display:none">
<a rel="author" class="p-author h-card" rel="me" href="https://jk.nipponalba.scot"><img src="/images/profile.jpg"/><div class="title">{{ .Site.Params.Title }}</div></a>
</div>
<aside>
<article class="h-cite">
<u><a href="{{ .bookmarkof | absURL }}" class="u-bookmark-of" target="_blank">{{ .name }}</a></u> - <div class="p-name p-content">{{ .content | markdownify }}</div>
</article>
</aside>
</section>
{{ end }}
{{ end }}
<h4>Vegan Recipes</h4>
{{ range .Site.Data.bookmarks }}
{{ if eq .category "Vegan Recipes"}}
<section data-post-type="bookmark-of" data-post-id="{{ .Params.slug }}" class="bookmark h-entry">
<div class="author" style="display:none">
<a rel="author" class="p-author h-card" rel="me" href="https://jk.nipponalba.scot"><img src="/images/profile.jpg"/><div class="title">{{ .Site.Params.Title }}</div></a>
</div>
<aside>
<article class="h-cite">
<u><a href="{{ .bookmarkof | absURL }}" class="u-bookmark-of" target="_blank">{{ .name }}</a></u> - <div class="p-name p-content">{{ .content | markdownify }}</div>
</article>
</aside>
</section>
{{ end }}
{{ end }}