diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d65854b..0d2f56f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.0.7 (unreleased) - Sort individual tag/category pages by date +- Add extra builtin shortcode for Streamable videos ## 0.0.6 (2017-05-24) diff --git a/README.md b/README.md index d379fb46..a813649a 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ You can also choose, at the section level, whether to automatically insert an an but can be turned on by setting `insert_anchor = "left"` or `insert_anchor = "right"` in the `_index.md` file. `left` will insert the anchor link before the title text and right will insert it after. -The default template is very basic and will need CSS tweaks in your projet to look decent. +The default template is very basic and will need CSS tweaks in your project to look decent. It can easily be overwritten by creating a `anchor-link.html` file in the `templates` directory. ### Shortcodes @@ -212,7 +212,8 @@ Gutenberg comes with a few built-in shortcodes: - YouTube: embeds a YouTube player for the given YouTube `id`. Also takes an optional `autoplay` argument that can be set to `true` if wanted - Vimeo: embeds a Vimeo player for the given Vimeo `id` -- Gist: embeds a Github gist from the `url` given. Also takes an optional `file` argument if you only want to show one of the files. +- Streamable: embeds a Streamable player for the given Streamable `id` +- Gist: embeds a Github gist from the `url` given. Also takes an optional `file` argument if you only want to show one of the files #### Defining a shortcode All shortcodes need to be in the `templates/shortcodes` folder and their files to end with `.html`. diff --git a/src/rendering/markdown.rs b/src/rendering/markdown.rs index 44172a4f..4481971f 100644 --- a/src/rendering/markdown.rs +++ b/src/rendering/markdown.rs @@ -373,6 +373,8 @@ Hello {{ youtube(id="ub36ffWAqgQ", autoplay=true) }} {{ vimeo(id="210073083") }} + +{{ streamable(id="c0ic") }} {{ gist(url="https://gist.github.com/Keats/32d26f699dcc13ebd41b") }} @@ -380,6 +382,7 @@ Hello assert!(res.contains("

Hello

\n
")); assert!(res.contains(r#" +
diff --git a/src/templates/mod.rs b/src/templates/mod.rs index ac8d2728..53f1cbe2 100644 --- a/src/templates/mod.rs +++ b/src/templates/mod.rs @@ -17,6 +17,7 @@ lazy_static! { ("shortcodes/youtube.html", include_str!("builtins/shortcodes/youtube.html")), ("shortcodes/vimeo.html", include_str!("builtins/shortcodes/vimeo.html")), ("shortcodes/gist.html", include_str!("builtins/shortcodes/gist.html")), + ("shortcodes/streamable.html", include_str!("builtins/shortcodes/streamable.html")), ("internal/alias.html", include_str!("builtins/internal/alias.html")), ]).unwrap(); diff --git a/test_site/content/posts/simple.md b/test_site/content/posts/simple.md index ee8367fc..2d4e6127 100644 --- a/test_site/content/posts/simple.md +++ b/test_site/content/posts/simple.md @@ -11,4 +11,6 @@ A simple page {{ vimeo(id="210073083") }} +{{ streamable(id="c0ic") }} + {{ gist(url="https://gist.github.com/Keats/32d26f699dcc13ebd41b") }}