feat: Update songbook
- Change songbook from njk to liquid - Add song partial
This commit is contained in:
parent
92f3c4f81f
commit
99b98635e7
4 changed files with 50 additions and 53 deletions
|
|
@ -47,7 +47,7 @@ export default async function (eleventyConfig) {
|
|||
});
|
||||
|
||||
eleventyConfig.addShortcode('link', function (target, text, attrId, attrClass) {
|
||||
if (text === '') {
|
||||
if (!text || text === '') {
|
||||
text = target;
|
||||
}
|
||||
|
||||
|
|
|
|||
39
source/screens/demo/examples/songbook.liquid
Normal file
39
source/screens/demo/examples/songbook.liquid
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: Songbook
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="sec_main_center">
|
||||
<header class="header_txt">
|
||||
<h1>Titel</h1>
|
||||
<p>Jahr</p>
|
||||
</header>
|
||||
<nav role="doc-toc">
|
||||
<h2>Inhaltsverzeichnis</h2>
|
||||
<ul>
|
||||
{%- for song in collections.song -%}
|
||||
<li>
|
||||
<a href="{{ song.page.url }}">{{ song.data.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</nav>
|
||||
<h2>Vorwort</h2>
|
||||
<p>Liederbuch für
|
||||
<em>Name</em>.</p>
|
||||
<p>Gibt es gebunden und hier
|
||||
{% link hippie.placeholders.domain %}.<br/>
|
||||
Bestellungen bitte an
|
||||
{% text hippie.placeholders.name %}
|
||||
richten.</p>
|
||||
<hr class="double dotted">
|
||||
{%- for piece in collections.song -%}
|
||||
{% render 'hippie/partials/song.liquid', index: forloop.index0, data: piece.data, content: piece.content %}
|
||||
{%- endfor -%}
|
||||
<hr/>
|
||||
<address>{% text hippie.placeholders.name %}</address>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -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 %}
|
||||
<!-- {{ page.fileSlug }}.page -->
|
||||
<div class="sec_main_center">
|
||||
<header class="header_txt">
|
||||
<h1>Titel</h1>
|
||||
<p>Jahr</p>
|
||||
</header>
|
||||
<nav role="doc-toc">
|
||||
<h2>Inhaltsverzeichnis</h2>
|
||||
<ul>
|
||||
{%- for song in collections.song -%}
|
||||
<li>
|
||||
<a href="{{ song.page.url }}">{{ song.data.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</nav>
|
||||
<h2>Vorwort</h2>
|
||||
<p>Liederbuch für
|
||||
<em>Name</em>.</p>
|
||||
<p>Gibt es gebunden und hier
|
||||
{{ ph.link() }}.<br/>
|
||||
Bestellungen bitte an
|
||||
{{ ph.name() }}
|
||||
richten.</p>
|
||||
<hr class="double dotted">
|
||||
{%- for piece in collections.song -%}
|
||||
{{ song.simple(loop.index0, piece.data, piece.content) }}
|
||||
{%- endfor -%}
|
||||
<hr/>
|
||||
<address>{{ ph.name() }}</address>
|
||||
</div>
|
||||
{% endblock %}
|
||||
10
source/templates/hippie/partials/song.liquid
Normal file
10
source/templates/hippie/partials/song.liquid
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<article class="songbook_song">
|
||||
<header>
|
||||
<h2>{{ data.title }}</h2>
|
||||
<h6>{{ data.releaseDate }}</h6>
|
||||
<p>{{ data.description }}</p>
|
||||
</header>
|
||||
{% comment %}<pre class="pre_code"><code>{{ content }}</code></pre>{% endcomment %}
|
||||
{{ content }}
|
||||
<footer>{{ index }}</footer>
|
||||
</article>
|
||||
Loading…
Add table
Add a link
Reference in a new issue