aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-context-menu.html
blob: 7a8798419e6637305ccece7e7c09bdedf57b86bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{{- $id  := delimit (shuffle (seq 1 7)) "" -}}
{{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}}
{{- $href   := print  .Site.BaseURL "/" $author.user "/messages/" (path.Base .Permalink) "/" -}}
{{- $plain  := print  .Site.BaseURL "/" $author.user "/messages/" (path.Base .Permalink) "/index.txt" -}}

{{- with .Params.feed.self -}}
  {{- $href = print $.Site.BaseURL "/" $.Params.feed.self -}}
  {{- $plain = print $.Site.BaseURL "/" $.Params.feed.self "/index.txt" -}}
{{- end -}}

<micro-metadata-menu>
  <context-control>
    <label for="context-metadata-{{ $id }}">
      {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-down-circle.svg")) -}}
      <span>menu</span>
    </label>
    <input hidden type="checkbox" id="context-metadata-{{ $id }}" />
    <context-menu anchor>
      {{- partial "meta-markdown.html"  . -}}
      {{- partial "meta-permalink.html" . -}}
      <micro-metadata-plain>
        <a href="{{ $plain }}">
          {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/file-text.svg")) -}}
          <span>plaintext</span>
        </a>
      </micro-metadata-plain>
      <micro-metadata-datetime>
        <a title="{{ .Date.Local | time.Format "3:04 PM Jan 2 2006" -}}" href="{{ $href }}">
          {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/calendar.svg")) -}}
          <span>{{ .Date.Local | time.Format "Jan 2 2006" | lower -}}</span>
        </a>
      </micro-metadata-datetime>
    </context-menu>
  </context-control>
</micro-metadata-menu>
{{- /* This comment removes trailing newlines and white spaces. */ -}}