cupper-hugo-theme/content/patterns/writing/snippets.md

20 lines
926 B
Markdown
Raw Normal View History

2017-08-15 18:47:49 +02:00
+++
title = "Snippets"
+++
2017-11-02 16:37:06 +01:00
A lot of the time, your larger documentation patterns will share some common techniques and utilities. For this reason, **Cupper** lets you save snippets of markdown in a **snippets** folder, alongside the main content folder.
2017-08-15 18:47:49 +02:00
The example `visually-hidden.md` snippet describes the CSS needed to create content that is visually hidden but still available to screen readers. Since this is a technique/utility you are likely to use often, it's nice to be able to just drop a snippet into your markdown content. The `snippet` shortcode lets you do exactly that:
{{<codeBlock>}}
&#x7b;{% snippet file="visually-hidden.md" %}}
{{</codeBlock>}}
{{% note %}}
To make your snippets truly reusable, try to write them in such a way that they make sense independent of surrounding text, a little bit like this note does.
{{% /note %}}
2017-09-13 11:39:46 +02:00
## Visually hidden snippet
{{% snippet file="visually-hidden.md" %}}