mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-09 09:46:11 +01:00
Add calendar info at top of post/feed entry
This commit is contained in:
parent
6fa8ec9004
commit
ca041286d7
4 changed files with 28 additions and 3 deletions
|
@ -69,7 +69,7 @@
|
|||
margin-left: 0.2em;
|
||||
}
|
||||
|
||||
p.in-reply-to, p.bookmark-of {
|
||||
p.in-reply-to, p.bookmark-of, p.next-visit {
|
||||
font-size: small;
|
||||
font-style: italic;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,20 @@
|
|||
{{- range $i, $src := .Params.Media }}
|
||||
<img src="{{ path.Join $page.RelPermalink $src.url | absURL }}" {{ with $src.alt }}alt="{{ . }}" {{ end }}/><br/>
|
||||
{{- end }}
|
||||
{{- if eq .Section "calendar" -}}
|
||||
{{ $timing := dict -}}
|
||||
{{ range .Params.timings -}}
|
||||
{{ if (time.AsTime .starts).After time.Now -}}
|
||||
{{ $timing = . -}}
|
||||
{{ break -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ if $timing }}
|
||||
<p style="font-style:italic;font-size:small">I'm planning on going to this event on
|
||||
{{ partial "year-relative-date.txt" (time.AsTime $timing.starts) }}.
|
||||
See the bottom of <a href="{{ .Permalink | absURL }}#post-info">the post</a> for more information, and get in touch if you'd like to go together!</p>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{ if .Params.bookmarkOf }}
|
||||
<p><i>{{ partial "bookmark-of.html" . | html }}</i></p>
|
||||
{{ else if .Params.inReplyTo }}
|
||||
|
|
|
@ -9,8 +9,10 @@
|
|||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ $timing := dict }}
|
||||
{{ $isPast := true }}
|
||||
{{ if gt (len $timings) 0 }}
|
||||
{{ $timing = index $timings 0 }}
|
||||
{{ $isPast = false }}
|
||||
{{ else }}
|
||||
{{ $timing = index .Params.timings 0 }}
|
||||
{{ end }}
|
||||
|
@ -38,13 +40,20 @@
|
|||
{{ end }}
|
||||
|
||||
<div class="post-content p-description" data-pagefind-body data-pagefind-filter="type:{{.Type | title}}">
|
||||
{{ if not $isPast }}
|
||||
<p class="next-visit">
|
||||
{{ partial "svg.html" (dict "name" "calendar") }} I'm planning on going to this event on {{ partial "year-relative-date.html" (slice (time.AsTime $timing.starts) "dt-start") }}.
|
||||
See the bottom of the post for more information.
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="post-info">
|
||||
<div class="post-info" id="post-info">
|
||||
{{ partial "tags.html" .Params.tags }}
|
||||
|
||||
{{ with .Params.location }}<p>
|
||||
|
@ -78,7 +87,7 @@
|
|||
|
||||
{{ if $timing.attending }}
|
||||
<p class="attending">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user-check"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><polyline points="17 11 19 13 23 9"></polyline></svg>
|
||||
{{ partial "svg.html" (dict "name" "attending") }}
|
||||
{{ if eq $timing.attending true }}{{ partial "friend.html" "jp.no-emoji" }} is going
|
||||
{{ else if eq (len $timing.attending) 1 }}
|
||||
{{ partial "friend.html" (printf "%s.no-emoji" (index $timing.attending 0)) }} is going
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M.045 18.02c.072-.116.187-.124.348-.022 3.636 2.11 7.594 3.166 11.87 3.166 2.852 0 5.668-.533 8.447-1.595l.315-.14c.138-.06.234-.1.293-.13.226-.088.39-.046.525.13.12.174.09.336-.12.48-.256.19-.6.41-1.006.654-1.244.743-2.64 1.316-4.185 1.726a17.617 17.617 0 01-10.951-.577 17.88 17.88 0 01-5.43-3.35c-.1-.074-.151-.15-.151-.22 0-.047.021-.09.051-.13zm6.565-6.218c0-1.005.247-1.863.743-2.577.495-.71 1.17-1.25 2.04-1.615.796-.335 1.756-.575 2.912-.72.39-.046 1.033-.103 1.92-.174v-.37c0-.93-.105-1.558-.3-1.875-.302-.43-.78-.65-1.44-.65h-.182c-.48.046-.896.196-1.246.46-.35.27-.575.63-.675 1.096-.06.3-.206.465-.435.51l-2.52-.315c-.248-.06-.372-.18-.372-.39 0-.046.007-.09.022-.15.247-1.29.855-2.25 1.82-2.88.976-.616 2.1-.975 3.39-1.05h.54c1.65 0 2.957.434 3.888 1.29.135.15.27.3.405.48.12.165.224.314.283.45.075.134.15.33.195.57.06.254.105.42.135.51.03.104.062.3.076.615.01.313.02.493.02.553v5.28c0 .376.06.72.165 1.036.105.313.21.54.315.674l.51.674c.09.136.136.256.136.36 0 .12-.06.226-.18.314-1.2 1.05-1.86 1.62-1.963 1.71-.165.135-.375.15-.63.045a6.062 6.062 0 01-.526-.496l-.31-.347a9.391 9.391 0 01-.317-.42l-.3-.435c-.81.886-1.603 1.44-2.4 1.665-.494.15-1.093.227-1.83.227-1.11 0-2.04-.343-2.76-1.034-.72-.69-1.08-1.665-1.08-2.94l-.05-.076zm3.753-.438c0 .566.14 1.02.425 1.364.285.34.675.512 1.155.512.045 0 .106-.007.195-.02.09-.016.134-.023.166-.023.614-.16 1.08-.553 1.424-1.178.165-.28.285-.58.36-.91.09-.32.12-.59.135-.8.015-.195.015-.54.015-1.005v-.54c-.84 0-1.484.06-1.92.18-1.275.36-1.92 1.17-1.92 2.43l-.035-.02zm9.162 7.027c.03-.06.075-.11.132-.17.362-.243.714-.41 1.05-.5a8.094 8.094 0 011.612-.24c.14-.012.28 0 .41.03.65.06 1.05.168 1.172.33.063.09.099.228.099.39v.15c0 .51-.149 1.11-.424 1.8-.278.69-.664 1.248-1.156 1.68-.073.06-.14.09-.197.09-.03 0-.06 0-.09-.012-.09-.044-.107-.12-.064-.24.54-1.26.806-2.143.806-2.64 0-.15-.03-.27-.087-.344-.145-.166-.55-.257-1.224-.257-.243 0-.533.016-.87.046-.363.045-.7.09-1 .135-.09 0-.148-.014-.18-.044-.03-.03-.036-.047-.02-.077 0-.017.006-.03.02-.063v-.06z"/></svg>
|
||||
{{- else if (eq .name "anilist") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6.361 2.943L0 21.056h4.942l1.077-3.133H11.4l1.052 3.133H22.9c.71 0 1.1-.392 1.1-1.101V17.53c0-.71-.39-1.101-1.1-1.101h-6.483V4.045c0-.71-.392-1.102-1.101-1.102h-2.422c-.71 0-1.101.392-1.101 1.102v1.064l-.758-2.166zm2.324 5.948l1.688 5.018H7.144z"/></svg>
|
||||
{{- else if (eq .name "attending") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user-check"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><polyline points="17 11 19 13 23 9"></polyline></svg>
|
||||
{{- else if (eq .name "bluesky") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 11.107c-.815-1.565-3.035-4.481-5.098-5.92-1.977-1.378-2.731-1.14-3.226-.919C3.104 4.524 3 5.391 3 5.902c0 .51.283 4.184.468 4.797.61 2.026 2.785 2.71 4.787 2.491.103-.015.206-.029.311-.042-.103.017-.207.03-.31.042-2.935.43-5.54 1.485-2.123 5.241 3.76 3.844 5.152-.824 5.867-3.19.715 2.366 1.538 6.865 5.8 3.19 3.2-3.19.879-4.812-2.055-5.24a6.62 6.62 0 0 1-.311-.043c.105.013.208.027.31.042 2.003.22 4.177-.465 4.788-2.491.185-.613.468-4.287.468-4.797 0-.51-.104-1.378-.676-1.633-.495-.221-1.249-.46-3.226.918-2.063 1.439-4.283 4.355-5.098 5.92Z" style="stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:2.2"/></svg>
|
||||
{{- else if (eq .name "bookmark") -}}
|
||||
|
|
Loading…
Reference in a new issue