Skip to content

Instantly share code, notes, and snippets.

@jensgro
Last active April 3, 2020 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jensgro/e0753068c705075a807734d93a443f2a to your computer and use it in GitHub Desktop.
Save jensgro/e0753068c705075a807734d93a443f2a to your computer and use it in GitHub Desktop.
I want to put parts of some Markdown files into a special area
title date permalink introText introImage tags
Eierlikör
2006-11-04
rezepte/eierlikoer.html
Einfach ein schönes Geschenk. Aber auch zum sleber trinken verdammt lecker.
eierlikoer
getraenk

{% block sidecnt %}

Zutaten

  • 5 Eigelb
  • 1 Vanilleschote
  • 120g Puderzucker
  • 200g Sahne
  • 340ml Vollmilch
  • 50ml Weingeist (90%)
  • 75ml Weinbrand

{% endblock %}

Zubereitung

  • Vanilleschote aufschneiden, Mark herausstreichen.
  • Puderzucker sieben.
  • Alle Zutaten miteinander vermischen.

Tipps

  • Wenn die Apotheke des Vertrauens den Weingeist nicht herausrückt, kann der Weingeist komplett durch Weinbrand ersetzt werden.
  • Am besten den Puderzucker direkt in die vermischten Flüssigkeiten sieben.
  • Um den Vanillegeschmack zu stärken nimmt man entweder noch eine Vanilleschote oder aber ein Fläschchen mit Vanillearoma.
// this is a part of my base.njk. template-file
<main>
{% if templateClass == "tmpl-post" %}
{% block sidecnt %}
<aside>
{{ sidecnt | safe }}
</aside>
{% endblock %}
{% endif %}
{{ content | safe }}
{% if templateClass == "tmpl-home" %}
{% include "categories.njk" %}
{% endif %}
</main>
// this is in the end of the eleventy.js. - configuration file
return {
templateFormats: [
"md",
"njk",
"html",
"liquid"
],
// If your site lives in a different subdirectory, change this.
// Leading or trailing slashes are all normalized away, so don’t worry about those.
// If you don’t have a subdirectory, use "" or "/" (they do the same thing)
// This is only used for link URLs (it does not affect your file structure)
// Best paired with the `url` filter: https://www.11ty.io/docs/filters/url/
// You can also pass this in on the command line using `--pathprefix`
// pathPrefix: "/",
markdownTemplateEngine: "njk",
htmlTemplateEngine: "njk",
dataTemplateEngine: "njk",
// These are all optional, defaults are shown:
dir: {
input: ".",
includes: "_includes",
data: "_data",
output: "_site"
}
};
@jensgro
Copy link
Author

jensgro commented Apr 3, 2020

I want to put some parts of my recipes into an aside. I wanted to refrain from integrating it into the markdown-file. Instead I wanted to mark a block inside the markdown that should belong to the aside.
Unfortunately this doesn't work. The content never reaches the aside. The block is ignored.

I am using nunjucks and Markdown. I don't want to integrate too much HTML into Markdown. Another idea would be exporting the data into an external file which would be imported into the page via YAML frontmatter. This is neither elegant nor usable.

Where is my error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment