jk.nipponalba.scot website https://jk.nipponalba.scot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

106 lines
5.0 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. {{ define "main" }}
  2. {{ if not (eq .Type "response" "bookmarkof")}}
  3. <article class="post h-entry entry contents">
  4. <div class="author" style="display:none;">
  5. <a rel="author" class="u-author h-card" rel="me" href="https://jk.nipponalba.scot">{{ .Site.Params.Title }}<img src="/images/profile.jpg"/></a>
  6. </div>
  7. <div class="post-content">{{ with .Page.Params.Image }}{{ partial "taxonomy/image.html" . }}{{ end }}<h3 class="post-title p-name entry-title">{{ .Title }}</h3><b>{{ .Description }}</b>
  8. <aside>
  9. {{ if eq .Type "article" }}<div class="info">
  10. <i class="fa fa-sun"></i><a class="u-url" href="{{ .RelPermalink }}"><span class="date"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></span></a>
  11. <i class="fa fa-clock"></i><span class="reading-time">{{ .ReadingTime }}-minute read</span>
  12. </div>{{end}}
  13. <div class="e-content">
  14. {{ .Content }}
  15. {{ if eq .Type "photo"}}
  16. <div class="photos">
  17. {{ range .Page.Params.Photo }}
  18. <a href="{{ . }}"><img class="u-photo thumb" src="{{ replace . "800." "300."}}"/></a>
  19. {{end}}
  20. </div>
  21. {{end}}
  22. {{ if eq .Type "article" }}<div class="p-summary" style="display:none">
  23. {{ .Page.Params.summary }}<br/>
  24. </div>
  25. {{ end }}<br/>
  26. </div>
  27. <div class="post-footer-page">
  28. <div class="date"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></div>
  29. {{ $pathJSON := (print .Permalink "bridgy.json") }}
  30. {{ $relpathJSON := (print .RelPermalink "bridgy.json") }}
  31. {{ if fileExists $relpathJSON }}
  32. <div class="syndication">
  33. {{ $mJSON := getJSON $pathJSON }}
  34. Syndicated to <a href="{{ printf $mJSON.url}}">Pleroma</a>
  35. </div>
  36. {{ end }}
  37. <div class="info">
  38. {{ with .Page.Params.Blog }}{{ partial "taxonomy/blog.html" . }}{{ end }}
  39. {{ with .Page.Params.category }}{{ partial "taxonomy/categories.html" . }}{{ end }}
  40. {{ with .Page.Params.tag }}{{ partial "taxonomy/tags.html" . }}{{ end }}
  41. </div>
  42. </div>
  43. <a href="https://brid.gy/publish/mastodon"></a>
  44. <div class="interactions"><h4>Interactions</h4></div>
  45. <div class="webmention-form">
  46. <form action="https://webmention.io/jk.nipponalba.scot/webmention" method="post">
  47. <label>Did you mention this {{ .Type }} on your website? Put the URL of your post here:</label><br/>
  48. <input name="source" type="url"/>
  49. <input name="target" value="{{ .Permalink }}" type="hidden"/>
  50. <input value="Send Webmention" type="submit"/>
  51. </form>
  52. </div>
  53. {{ $pathJSON := (print "data" (strings.TrimSuffix "/" .RelPermalink) ".json") }}
  54. {{ if fileExists $pathJSON }}
  55. <div class="webmentions">
  56. {{ $mJSON := getJSON $pathJSON }}
  57. <div class="like interaction"><h4>Likes</h4>{{ partial "likes.html" $mJSON }}</div>
  58. <div class="share interaction"><h4>Shares</h4>{{ partial "shares.html" $mJSON }}</div>
  59. <h4>Comments & Replies</h4>{{ partial "webmention.html" $mJSON }}
  60. </div>
  61. {{ end }}
  62. </aside></div>
  63. </article>
  64. {{ else if eq .Type "bookmarkof" }}
  65. {{ $cats := slice }}
  66. {{ range .Site.Data.bookmarks }}
  67. {{ $cats = $cats | append .category }}
  68. {{ end }}
  69. {{ $cats = uniq $cats | sort }}
  70. {{ range $cats }}
  71. {{ $cat := . }}
  72. <h4>{{ $cat }}</h4>
  73. {{ range $.Site.Data.bookmarks }}
  74. {{ if eq .category $cat }}
  75. <section data-post-type="bookmark-of" data-post-id="{{ .Params.slug }}" class="bookmark h-entry">
  76. <div class="author" style="display:none">
  77. <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>
  78. </div>
  79. <aside>
  80. <article class="h-cite">
  81. <u><a href="{{ .bookmarkof | absURL }}" class="u-bookmark-of" target="_blank">{{ .name }}</a></u> - <div class="p-name p-content">{{ .content | markdownify }}</div>
  82. </article>
  83. </aside>
  84. </section>
  85. {{ end }}
  86. {{ end }}
  87. {{ end }}
  88. {{ else }}
  89. <article class="h-entry" id="response">
  90. <div class="author">
  91. <a rel="author" class="u-author h-card" rel="me" href="https://jk.nipponalba.scot"><img src="/images/profile.jpg"/><div class="title">{{ .Site.Params.Title }}</div></a>
  92. </div>
  93. <div class="h-cite">
  94. {{ if .Params.likeof }}<p>Liked <a href="{{ .Params.likeof }}" class="u-url u-like-of"> {{ .Params.likeof }}</a>{{ end }}
  95. {{ if .Params.inreplyto }}<p>Replied to <a href="{{ .Params.inreplyto }}" class="u-url u-in-reply-to"> {{ .Params.inreplyto }}</a>{{ end }}
  96. {{ if .Params.repostof }}<p>Shared <a href="{{ .Params.repostof }}" class="u-url u-repost-of"> {{ .Params.repostof }}</a>{{ end }}</p>
  97. {{ if .Content }}<div class="p-name p-content">{{ .Content }}</div><br/> {{end}}
  98. </div>
  99. <div class="date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></div>
  100. </article>
  101. {{end}}
  102. {{end}}