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.

102 lines
5.1 KiB

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