From 3185a2da352634c2a5b0c3580b0da202e3b9baf9 Mon Sep 17 00:00:00 2001 From: a Date: Sat, 16 Mar 2024 22:48:10 -0500 Subject: [PATCH] Fix /code page --- .../code/liberapay-pleroma/cover.jpg | Bin content/code/liberapay-pleroma/index.md | 3 --- .../code/mastomods/cover.jpg | Bin content/code/mastomods/index.md | 3 --- .../code/obs-edit-transform/cover.jpg | Bin content/code/obs-edit-transform/index.md | 3 --- .../code/photobucketgrabber/select.jpg | Bin .../code/salatime/cover.jpg | Bin content/code/salatime/index.md | 3 --- layouts/code/list.html | 4 +-- layouts/code/single.html | 25 ++++++++++++++++++ 11 files changed, 27 insertions(+), 14 deletions(-) rename static/images/cover/liberapay-pleroma.jpg => content/code/liberapay-pleroma/cover.jpg (100%) rename static/images/cover/mastomods.jpg => content/code/mastomods/cover.jpg (100%) rename static/images/cover/obs-transform.jpg => content/code/obs-edit-transform/cover.jpg (100%) rename static/images/cover/photobucketgrabber.jpg => content/code/photobucketgrabber/select.jpg (100%) rename static/images/cover/salatime.jpg => content/code/salatime/cover.jpg (100%) create mode 100644 layouts/code/single.html diff --git a/static/images/cover/liberapay-pleroma.jpg b/content/code/liberapay-pleroma/cover.jpg similarity index 100% rename from static/images/cover/liberapay-pleroma.jpg rename to content/code/liberapay-pleroma/cover.jpg diff --git a/content/code/liberapay-pleroma/index.md b/content/code/liberapay-pleroma/index.md index 759c06f..1167a74 100644 --- a/content/code/liberapay-pleroma/index.md +++ b/content/code/liberapay-pleroma/index.md @@ -5,9 +5,6 @@ author = "Abdullah Tarawneh" date = "2019-11-13" tags = ["mastodon", "api", "pleroma", "liberapay", "contribution", "pull request", "github"] categories = ["Code"] -[[resources]] -name = "cover" -src = "/images/cover/liberapay-pleroma.jpg" +++ pleroma is compatible with mastodon api. diff --git a/static/images/cover/mastomods.jpg b/content/code/mastomods/cover.jpg similarity index 100% rename from static/images/cover/mastomods.jpg rename to content/code/mastomods/cover.jpg diff --git a/content/code/mastomods/index.md b/content/code/mastomods/index.md index fdd9b7d..51affe7 100644 --- a/content/code/mastomods/index.md +++ b/content/code/mastomods/index.md @@ -5,9 +5,6 @@ author = "Abdullah Tarawneh" date = "2019-02-18" tags = ["mastomods", "mastodon", "css", "userstyles", "tweaks"] categories = ["Code"] -[[resources]] -name = "cover" -src = "/images/cover/mastomods.jpg" +++ This work is heavily based on (and an extension of) my earlier work on Mastodon Flat CSS, and its child theme Linernotes Mastodon Themes. I grew tired of having to maintain what was essentially the same code in multiple different places, so this repo was created to be a more modular way of managing code snippets after I learned enough about how importing works. diff --git a/static/images/cover/obs-transform.jpg b/content/code/obs-edit-transform/cover.jpg similarity index 100% rename from static/images/cover/obs-transform.jpg rename to content/code/obs-edit-transform/cover.jpg diff --git a/content/code/obs-edit-transform/index.md b/content/code/obs-edit-transform/index.md index d2cf0c2..90a38cb 100644 --- a/content/code/obs-edit-transform/index.md +++ b/content/code/obs-edit-transform/index.md @@ -5,9 +5,6 @@ date = "2017-04-30" author = "Abdullah Tarawneh" tags = ["obs", "open broadcaster software", "obs studio", "keyboard shortcut", "edit transform", "pull request", "github"] categories = ["Code"] -[[resources]] -name = "cover" -src = "/images/cover/obs-transform.jpg" +++ Editing was very easy in OBS Classic, and I could not find the option for stretching a source to bounds in OBS Studio, so the "Edit Transform" dialogue should be more user-facing. Giving it a keyboard shortcut denotes that it is important enough to have a shortcut, as opposed to the myriad options with no shortcut. diff --git a/static/images/cover/photobucketgrabber.jpg b/content/code/photobucketgrabber/select.jpg similarity index 100% rename from static/images/cover/photobucketgrabber.jpg rename to content/code/photobucketgrabber/select.jpg diff --git a/static/images/cover/salatime.jpg b/content/code/salatime/cover.jpg similarity index 100% rename from static/images/cover/salatime.jpg rename to content/code/salatime/cover.jpg diff --git a/content/code/salatime/index.md b/content/code/salatime/index.md index 2405b6a..af4acd6 100644 --- a/content/code/salatime/index.md +++ b/content/code/salatime/index.md @@ -5,9 +5,6 @@ date = "2019-05-09" author = "Abdullah Tarawneh" tags = ["python", "web scraping", "scraping", "beautifulsoup", "salat", "prayer", "time"] categories = ["Code"] -[[resources]] -name = "cover" -src = "/images/cover/salatime.jpg" +++ ## The problem diff --git a/layouts/code/list.html b/layouts/code/list.html index 187ecb0..f9f87c9 100644 --- a/layouts/code/list.html +++ b/layouts/code/list.html @@ -35,8 +35,8 @@

{{.Summary}}

- {{ with .Params.cover }} - + {{ with .Resources.GetMatch "cover**" }} + {{end}} diff --git a/layouts/code/single.html b/layouts/code/single.html new file mode 100644 index 0000000..619e394 --- /dev/null +++ b/layouts/code/single.html @@ -0,0 +1,25 @@ +{{ define "main" }} +
+
+ + +
+
+ {{ .Content }} +
+
+
+
+{{ end }}