From 024540e389bf980bcd1137820d540816520c5859 Mon Sep 17 00:00:00 2001 From: sthag Date: Sat, 12 Apr 2025 15:49:46 +0200 Subject: [PATCH 1/2] feat: Move macros for general usage --- source/screens/demo/examples/portal.njk | 2 +- source/screens/demo/examples/ui/new.njk | 2 +- .../{demo/macros/_gates.njk => hippie/macros/_gate.njk} | 0 .../{demo/macros/_states.njk => hippie/macros/_state.njk} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename source/templates/{demo/macros/_gates.njk => hippie/macros/_gate.njk} (100%) rename source/templates/{demo/macros/_states.njk => hippie/macros/_state.njk} (100%) diff --git a/source/screens/demo/examples/portal.njk b/source/screens/demo/examples/portal.njk index 8c6bb73..5b96681 100644 --- a/source/screens/demo/examples/portal.njk +++ b/source/screens/demo/examples/portal.njk @@ -7,7 +7,7 @@ tags: {% set bodyClass = "body_portal" %} {% extends "demo/_default.njk" %} -{% import "demo/macros/_gates.njk" as gate %} +{% import "hippie/macros/_gate.njk" as gate %} {% block title %}{{ title }}{% endblock %} diff --git a/source/screens/demo/examples/ui/new.njk b/source/screens/demo/examples/ui/new.njk index edc4d47..c567309 100755 --- a/source/screens/demo/examples/ui/new.njk +++ b/source/screens/demo/examples/ui/new.njk @@ -8,7 +8,7 @@ tags: {% set bodyClass = "body_new" %} {% extends "demo/_app.njk" %} -{% import "demo/macros/_states.njk" as state %} +{% import "hippie/macros/_state.njk" as state %} {% block title %}{{ title }} {% endblock %} diff --git a/source/templates/demo/macros/_gates.njk b/source/templates/hippie/macros/_gate.njk similarity index 100% rename from source/templates/demo/macros/_gates.njk rename to source/templates/hippie/macros/_gate.njk diff --git a/source/templates/demo/macros/_states.njk b/source/templates/hippie/macros/_state.njk similarity index 100% rename from source/templates/demo/macros/_states.njk rename to source/templates/hippie/macros/_state.njk From 2e2091a179f37eb6df5f900efd2c57ec25d61c75 Mon Sep 17 00:00:00 2001 From: sthag Date: Sat, 12 Apr 2025 16:41:47 +0200 Subject: [PATCH 2/2] feat: Add soungbook example - Add songbook to demo - Add macro for song - Add style module --- source/screens/demo/examples/songbook.njk | 51 +++++++++++++++++++ .../demo/examples/songbook/0_artist-title.md | 26 ++++++++++ source/style/demo.scss | 1 + .../modules/songbook/_songbook_module.scss | 20 ++++++++ source/templates/hippie/macros/_song.njk | 12 +++++ 5 files changed, 110 insertions(+) create mode 100755 source/screens/demo/examples/songbook.njk create mode 100755 source/screens/demo/examples/songbook/0_artist-title.md create mode 100755 source/style/modules/songbook/_songbook_module.scss create mode 100644 source/templates/hippie/macros/_song.njk diff --git a/source/screens/demo/examples/songbook.njk b/source/screens/demo/examples/songbook.njk new file mode 100755 index 0000000..0b91499 --- /dev/null +++ b/source/screens/demo/examples/songbook.njk @@ -0,0 +1,51 @@ +--- +title: Songbook +tags: + - demoExample +--- +{% set pageBase = "../" %} +{% set pageId = page.fileSlug %} + +{% extends "demo/_default.njk" %} +{% import "hippie/macros/_placeholder.njk" as ph %} +{% import "hippie/macros/_song.njk" as song %} + +{% block title %}{{ title }}{% endblock %} + +{% block head %} + {{ super() }} +{% endblock %} + +{% block body %} + +
+
+

Titel

+

Jahr

+
+ +

Vorwort

+

Liederbuch für + Name.

+

Gibt es gebunden und hier + {{ ph.link() }}.
+ Bestellungen bitte an + {{ ph.name() }} + richten.

+
+ {%- for piece in collections.song -%} + {{ song.simple(loop.index0, piece.data, piece.content) }} + {%- endfor -%} +
+
{{ ph.name() }}
+
+{% endblock %} \ No newline at end of file diff --git a/source/screens/demo/examples/songbook/0_artist-title.md b/source/screens/demo/examples/songbook/0_artist-title.md new file mode 100755 index 0000000..ccf1b5c --- /dev/null +++ b/source/screens/demo/examples/songbook/0_artist-title.md @@ -0,0 +1,26 @@ +--- +tags: + - songbook + - song +title: "Interpret - Titel" +releaseDate: JJJJ +description: Text +--- +~~~ +[verse 1] +strophe 1 + +[chorus] +refrain + +[verse 2] +strophe 2 + +[chorus] +[bridge] +überleitung + +[interlude] +[chorus] +[outro] +~~~ diff --git a/source/style/demo.scss b/source/style/demo.scss index e46a622..b3d4100 100644 --- a/source/style/demo.scss +++ b/source/style/demo.scss @@ -11,5 +11,6 @@ // ----------------------------------------------------------------------------- @import "modules/card/card_module"; @import "modules/portal/portal_module"; +@import "modules/songbook/songbook_module"; @import "modules/demo/demo_module"; // @import "modules/YOUR-MODULE/YOUR-FILES"; diff --git a/source/style/modules/songbook/_songbook_module.scss b/source/style/modules/songbook/_songbook_module.scss new file mode 100755 index 0000000..321f8bd --- /dev/null +++ b/source/style/modules/songbook/_songbook_module.scss @@ -0,0 +1,20 @@ +.songbook_song { + pre { + @extend .pre_code + } + + header { + h2 { + margin-bottom: $space_basic; + } + + h6 { + color: $color_brightest; + } + + h2+h6 { + margin-top: 0; + margin-bottom: $space_small; + } + } +} \ No newline at end of file diff --git a/source/templates/hippie/macros/_song.njk b/source/templates/hippie/macros/_song.njk new file mode 100644 index 0000000..79083c0 --- /dev/null +++ b/source/templates/hippie/macros/_song.njk @@ -0,0 +1,12 @@ +{% macro simple(index, data, content) %} +
+
+

{{ data.title }}

+
{{ data.releaseDate }}
+

{{ data.description }}

+
+ {#
{{ content }}
#} + {{ content | safe }} + +
+{% endmacro %} \ No newline at end of file