Using Markdown

An easier way to compose your content

Required skills: HTML Markdown

Use this when you want to write lots of content without worrying about HTML tags.

Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to HTML. If you're writing lots of content (blog posts, articles, etc), then Markdown is an ideal choice for your site. Wunderbucket supports markdown automatically using the data-merge-include-markdown attribute.

<article data-merge-include-markdown="my-article.md">
<!-- 
  Wunderbucket will convert the contents 
  of my-article.md to HTML and put it 
  here
-->
</article>

How does it work?

The value you that you use inside data-merge-include-markdown works just like a URL. You can use a relative url like data-merge-include-markdown="../my-article.md" or an absolute url like data-merge-include-markdown="/my-article.md".

A few basic rules:

  • The file you include has to exist.
  • It has to be a valid path.
  • You can use full URLs but they are subject to CORS loading restrictions. I.E. data-merge-include-markdown="http://my-site.com/footer.html" will result in an error if my-site.com does not have the correct CORS headers.

We use the open-source Merge.js engine to power HTML includes. If you want to really see how this works, the source code is here: https://github.com/levinunnink/merge.js

FAQs

  • Can I mix Markdown and HTML?
  • What Markdown parser does Wunderbucket use?
  • My site loads in stages when I'm on localhost. Will it do that when I publish it?
  • Why am I getting an error when I publish my site?