Browse Source

bringing bookmarks section into single.html

master
jk 4 years ago
parent
commit
a3e6f189fd
  1. 1
      content/note/5eea8190/index.md
  2. 24
      themes/nipponalba/layouts/_default/single.html
  3. 45
      themes/nipponalba/layouts/partials/backup_bookmarks.html

1
content/note/5eea8190/index.md

@ -30,4 +30,3 @@ Webmention.rocks test post
<a href="https://webmention.rocks/test/21">Test 21</a>
<a href="https://webmention.rocks/test/22">Test 22</a>
<a href="https://webmention.rocks/test/23/page">Test 23</a>

24
themes/nipponalba/layouts/_default/single.html

@ -64,7 +64,29 @@
</aside></div>
</article>
{{ else if eq .Type "bookmarkof" }}
{{ partial "bookmarks.html" . }}
{{ $cats := slice }}
{{ range .Site.Data.bookmarks }}
{{ $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>
</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 }}
{{ end }}
{{ else }}
<section data-post-type="{{ .Params.posttype }}" data-post-id="{{ .Params.slug }}" class="h-entry">
<div class="author" style="display:none;">

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

@ -1,45 +0,0 @@
<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 }}