From 67a64c121dbd03fd6bb3b8d535b3e6e6a9678f68 Mon Sep 17 00:00:00 2001 From: dzello Date: Mon, 30 Apr 2018 12:08:32 -0700 Subject: [PATCH] Add the frag shortcode --- exampleSite/content/home/usage-shortcodes.md | 23 ++++++++++++++++++++ layouts/shortcodes/frag.html | 4 ++++ layouts/shortcodes/fragment.html | 8 ++----- 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 layouts/shortcodes/frag.html diff --git a/exampleSite/content/home/usage-shortcodes.md b/exampleSite/content/home/usage-shortcodes.md index 477fa88..d186fc9 100644 --- a/exampleSite/content/home/usage-shortcodes.md +++ b/exampleSite/content/home/usage-shortcodes.md @@ -22,6 +22,29 @@ The `fragment` shortcode makes content appear incrementally. --- +### Frag shortcode + +The `frag` shortcode is like `fragment` but more terse. It accepts the content as the `c` attribute. + +``` +{{}} +{{}} +{{}} +``` + +{{< frag c="One" >}} +{{< frag c="Two" >}} +{{< frag c="Three" >}} + +--- + +Both `fragment` and `frag` accept two additional parameters: + +- `class`: sets the class of the wrapping `span` element +- `index`: controls the order in which sections will appear + +--- + {{% section %}} ### Section shortcode diff --git a/layouts/shortcodes/frag.html b/layouts/shortcodes/frag.html new file mode 100644 index 0000000..c1de8c8 --- /dev/null +++ b/layouts/shortcodes/frag.html @@ -0,0 +1,4 @@ + + {{ .Get "c" }} + \ No newline at end of file diff --git a/layouts/shortcodes/fragment.html b/layouts/shortcodes/fragment.html index 82271c2..dc41e03 100644 --- a/layouts/shortcodes/fragment.html +++ b/layouts/shortcodes/fragment.html @@ -1,8 +1,4 @@ - + {{ .Inner }} \ No newline at end of file