feat(forgejo.liquid): add forgejo repo banner block

This commit is contained in:
Cory Dransfeldt 2025-03-28 17:13:45 -07:00
parent 835e49a89e
commit d5c31a87d3
No known key found for this signature in database
8 changed files with 28 additions and 7 deletions

4
package-lock.json generated
View file

@ -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",

View file

@ -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": {

View file

@ -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'

View file

@ -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'

View file

@ -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);
}

View file

@ -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;

View file

@ -0,0 +1,3 @@
<div class="banner forgejo">
<p>{% tablericon "git-merge" %} Take a look at <a href="{{ url }}">the repository for this project</a> on my <a href="https://forgejo.org">Forgejo</a> instance.</p>
</div>

View file

@ -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