diff --git a/.eleventy.js b/.eleventy.js index 152f256..48791f7 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -47,7 +47,7 @@ export default async function (eleventyConfig) { }); eleventyConfig.addShortcode('link', function (target, text, attrId, attrClass) { - if (text === '') { + if (!text || text === '') { text = target; } diff --git a/source/screens/demo/examples/songbook.liquid b/source/screens/demo/examples/songbook.liquid new file mode 100644 index 0000000..5329c0a --- /dev/null +++ b/source/screens/demo/examples/songbook.liquid @@ -0,0 +1,39 @@ +--- +title: Songbook +tags: +- demoExample +--- +{% layout 'hippie/simple.liquid' %} + +{% block body %} +
+
+

Titel

+

Jahr

+
+ +

Vorwort

+

Liederbuch für + Name.

+

Gibt es gebunden und hier + {% link hippie.placeholders.domain %}.
+ Bestellungen bitte an + {% text hippie.placeholders.name %} + richten.

+
+ {%- for piece in collections.song -%} + {% render 'hippie/partials/song.liquid', index: forloop.index0, data: piece.data, content: piece.content %} + {%- endfor -%} +
+
{% text hippie.placeholders.name %}
+
+{% endblock %} \ No newline at end of file diff --git a/source/screens/demo/examples/songbook.njk b/source/screens/demo/examples/songbook.njk deleted file mode 100755 index 78a9939..0000000 --- a/source/screens/demo/examples/songbook.njk +++ /dev/null @@ -1,52 +0,0 @@ ---- -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/templates/hippie/partials/song.liquid b/source/templates/hippie/partials/song.liquid new file mode 100644 index 0000000..534da59 --- /dev/null +++ b/source/templates/hippie/partials/song.liquid @@ -0,0 +1,10 @@ +
+
+

{{ data.title }}

+
{{ data.releaseDate }}
+

{{ data.description }}

+
+ {% comment %}
{{ content }}
{% endcomment %} + {{ content }} + +
\ No newline at end of file