From bb021ab88cb5b62c82a70eab8fc0034d8dcad51d Mon Sep 17 00:00:00 2001 From: yequari Date: Wed, 24 Apr 2024 23:22:05 -0700 Subject: [PATCH] revamp sidebar --- config.yaml | 4 +++ layouts/partials/avatar.html | 13 ++++++++ layouts/partials/sidebar.html | 30 +++++++++-------- layouts/partials/statuscafe.html | 36 ++++++++++++++++++++ themes/dreamcast/layouts/partials/head.html | 4 +-- themes/dreamcast/static/css/main.css | 37 +++++++++++++++++++-- 6 files changed, 106 insertions(+), 18 deletions(-) create mode 100644 layouts/partials/avatar.html create mode 100644 layouts/partials/statuscafe.html diff --git a/config.yaml b/config.yaml index 34010e1..77c8fc0 100644 --- a/config.yaml +++ b/config.yaml @@ -57,3 +57,7 @@ menu: icon: aero-chat.svg url: xmpp:yequari@cardgameson.motorcycles weight: 40 +caches: + getresource: + dir: :cacheDir/:project + maxAge: 0 diff --git a/layouts/partials/avatar.html b/layouts/partials/avatar.html new file mode 100644 index 0000000..bfc2183 --- /dev/null +++ b/layouts/partials/avatar.html @@ -0,0 +1,13 @@ + {{ range first 1 (where .Site.RegularPages.ByDate.Reverse "Section" "blog") }} + {{ $d1 := time.ParseDuration "-168h" }} + {{ $t1 := time.Now.Add $d1 }} + {{ $t2 := time.AsTime .PublishDate }} + {{ if $t2.After $t1 }} +
+ {{ else }} +
+ {{ end }} + {{ end }} + + +
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 3bc089e..0bcbedf 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,15 +1,19 @@
-
- - -
+ + + + + {{ partial "avatar.html" . }} +

+ I'm yequari. I like programming, tabletop games, and the Transformers. +

-

current status

-
+ + {{ partial "statuscafe.html" .}}
-

Social

+
-
-

yequari says...

-
-

.

-
-
+ + + + + + diff --git a/layouts/partials/statuscafe.html b/layouts/partials/statuscafe.html new file mode 100644 index 0000000..cc8763c --- /dev/null +++ b/layouts/partials/statuscafe.html @@ -0,0 +1,36 @@ +{{ $data := dict }} +{{ $url := "https://status.cafe/users/yequari/status.json" }} +{{ with resources.GetRemote $url }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} +
+ {{ $data = .Content | transform.Unmarshal }} + {{ $length := len $data.content }} + {{ if eq $length 0 }} + No status + {{ else }} + {{ $timestrs := strings.Split $data.timeAgo " " }} + {{ $timeamt := index $timestrs 0 }} + {{ $timeunit := index $timestrs 1 }} + {{ $timeunit = strings.Substr $timeunit 0 1 }} + {{ $url = "https://status.cafe/users/yequari/badge.png" }} + {{ with resources.GetRemote $url}} +
+ Status Cafe Profile +
+ {{ end }} +
+ 🕗{{ $timeamt }}{{ $timeunit }} +
+
+

+ {{ $data.content }} +

+
+
+ {{ end }} + {{ end }} +{{ else }} + {{ errorf "Unable to get remote resource %q" $url }} +{{ end }} diff --git a/themes/dreamcast/layouts/partials/head.html b/themes/dreamcast/layouts/partials/head.html index dcb51ea..00e613b 100644 --- a/themes/dreamcast/layouts/partials/head.html +++ b/themes/dreamcast/layouts/partials/head.html @@ -7,8 +7,8 @@ {{ .Page.Title }} - - + + diff --git a/themes/dreamcast/static/css/main.css b/themes/dreamcast/static/css/main.css index f741e3b..4f5566f 100644 --- a/themes/dreamcast/static/css/main.css +++ b/themes/dreamcast/static/css/main.css @@ -157,7 +157,7 @@ ul.social { } li.social { - padding: 0; + padding: 5px 0; } img.social { @@ -271,7 +271,7 @@ nav li a:hover, nav li a:active { .sidebar { flex: 0 1 20%; border-right: 1px solid black; - padding: 0 15px; + padding: 0 25px; } .sidebar h1 { @@ -279,10 +279,14 @@ nav li a:hover, nav li a:active { padding-bottom: 5px; } +.sidebar p.about-me { + text-align: center; +} + .sidebar #avatar-frame { width: fit-content; height: 100px; - margin: 0 auto; + margin: 0 auto 25px auto; padding: 8px 8px; border: 1px solid #cccccf; border-radius: 16px/24px; @@ -295,6 +299,33 @@ nav li a:hover, nav li a:active { border-radius: 5px; } +#statuscafe { + display: flex; + flex-flow: row wrap; + justify-content: space-between; + /* border: 1px solid #CCCCCC; */ +} + +#statuscafe p { + line-height: 1.5; + margin: 5px 0; + color: var(--secondary-text); + font-style: italic; +} + +#statuscafe #statuscafe-timeago { + flex: 1 1 50%; + text-align: right; +} + +#statuscafe #statuscafe-username { + flex: 1 1 50%; +} + +#statuscafe #statuscafe-content { + flex: 1 1 100%; +} + .online { background: linear-gradient(#D6FFDB00 0%, #D6FFDB 30%, #66FF00 100%); box-shadow: 0 5px 10px #66FF00;