From d5c31a87d3d487160dcf5902882d91944d1ef5f1 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Fri, 28 Mar 2025 17:13:45 -0700 Subject: [PATCH] feat(forgejo.liquid): add forgejo repo banner block --- package-lock.json | 4 ++-- package.json | 2 +- queries/views/content/posts.psql | 8 ++++++-- queries/views/globals/pages.psql | 8 ++++++-- src/assets/styles/base/index.css | 5 +++++ src/assets/styles/base/vars.css | 1 + src/includes/blocks/banners/forgejo.liquid | 3 +++ src/includes/blocks/index.liquid | 4 ++++ 8 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 src/includes/blocks/banners/forgejo.liquid diff --git a/package-lock.json b/package-lock.json index 9ccdcb3..924b88f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "1.0.2", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "1.0.2", + "version": "1.1.2", "license": "MIT", "dependencies": { "minisearch": "^7.1.2", diff --git a/package.json b/package.json index 5c75708..240b622 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "1.0.2", + "version": "1.1.2", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "engines": { diff --git a/queries/views/content/posts.psql b/queries/views/content/posts.psql index a2d6e6f..47f2b25 100644 --- a/queries/views/content/posts.psql +++ b/queries/views/content/posts.psql @@ -26,6 +26,8 @@ SELECT json_agg( CASE WHEN pb.collection = 'youtube_player' THEN json_build_object('type', pb.collection, 'url', yp.url) + WHEN pb.collection = 'forgejo_banner' THEN + json_build_object('type', pb.collection, 'url', fb.url) WHEN pb.collection = 'github_banner' THEN json_build_object('type', pb.collection, 'url', gb.url) WHEN pb.collection = 'npm_banner' THEN @@ -43,8 +45,10 @@ SELECT END) FROM posts_blocks pb - LEFT JOIN youtube_player yp ON pb.collection = 'youtube_player' - AND yp.id = pb.item::integer + LEFT JOIN youtube_player yp ON pb.collection = 'youtube_player' + AND yp.id = pb.item::integer + LEFT JOIN forgejo_banner fb ON pb.collection = 'forgejo_banner' + AND fb.id = pb.item::integer LEFT JOIN github_banner gb ON pb.collection = 'github_banner' AND gb.id = pb.item::integer LEFT JOIN npm_banner nb ON pb.collection = 'npm_banner' diff --git a/queries/views/globals/pages.psql b/queries/views/globals/pages.psql index 14d83e5..0fb2543 100644 --- a/queries/views/globals/pages.psql +++ b/queries/views/globals/pages.psql @@ -11,6 +11,8 @@ SELECT json_agg( CASE WHEN pb.collection = 'youtube_player' THEN json_build_object('type', pb.collection, 'url', yp.url) + WHEN pb.collection = 'forgejo_banner' THEN + json_build_object('type', pb.collection, 'url', fb.url) WHEN pb.collection = 'github_banner' THEN json_build_object('type', pb.collection, 'url', gb.url) WHEN pb.collection = 'npm_banner' THEN @@ -28,8 +30,10 @@ SELECT END ORDER BY pb.sort) FROM pages_blocks pb - LEFT JOIN youtube_player yp ON pb.collection = 'youtube_player' - AND yp.id = pb.item::integer + LEFT JOIN youtube_player yp ON pb.collection = 'youtube_player' + AND yp.id = pb.item::integer + LEFT JOIN forgejo_banner fb ON pb.collection = 'forgejo_banner' + AND fb.id = pb.item::integer LEFT JOIN github_banner gb ON pb.collection = 'github_banner' AND gb.id = pb.item::integer LEFT JOIN npm_banner nb ON pb.collection = 'npm_banner' diff --git a/src/assets/styles/base/index.css b/src/assets/styles/base/index.css index 65dbe8c..0e75930 100644 --- a/src/assets/styles/base/index.css +++ b/src/assets/styles/base/index.css @@ -117,6 +117,7 @@ ol { .device-watch, .error, .favorite, +.forgejo, .github, .headphones, .heart-handshake, @@ -175,6 +176,10 @@ ol { &.favorite { --section-color: var(--favorite); } + &.git-merge, + &.forgejo { + --section-color: var(--brand-forgejo); + } &.headphones { --section-color: var(--music); } diff --git a/src/assets/styles/base/vars.css b/src/assets/styles/base/vars.css index 6ce5abc..0d623a1 100644 --- a/src/assets/styles/base/vars.css +++ b/src/assets/styles/base/vars.css @@ -40,6 +40,7 @@ --background-color-inverted: light-dark(var(--color-darkest), var(--color-lightest)); --brand-buy-me-a-coffee: light-dark(#9500ff, #ffdd00); + --brand-forgejo: light-dark(#d40000, #ff6600); --brand-github: light-dark(#333, #f5f5f5); --brand-mastodon: light-dark(#563acc, #858afa); --brand-npm: #cb3837; diff --git a/src/includes/blocks/banners/forgejo.liquid b/src/includes/blocks/banners/forgejo.liquid new file mode 100644 index 0000000..b11b7d6 --- /dev/null +++ b/src/includes/blocks/banners/forgejo.liquid @@ -0,0 +1,3 @@ + diff --git a/src/includes/blocks/index.liquid b/src/includes/blocks/index.liquid index f5e1517..7adaa0c 100644 --- a/src/includes/blocks/index.liquid +++ b/src/includes/blocks/index.liquid @@ -4,6 +4,10 @@ {% render "blocks/youtube-player.liquid", url:block.url %} + {%- when "forgejo_banner" -%} + {% render "blocks/banners/forgejo.liquid", + url:block.url + %} {%- when "github_banner" -%} {% render "blocks/banners/github.liquid", url:block.url