From c9029936ea7e607ccda40d7c036b8397328538db Mon Sep 17 00:00:00 2001 From: squidfunk Date: Thu, 30 Jul 2020 20:36:08 +0200 Subject: [PATCH] Added documentation for using icons in templates --- docs/reference/icons-emojis.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/reference/icons-emojis.md b/docs/reference/icons-emojis.md index 568898725..284629ab8 100644 --- a/docs/reference/icons-emojis.md +++ b/docs/reference/icons-emojis.md @@ -205,3 +205,22 @@ _Result_: [20]: #with-colors [21]: https://developer.mozilla.org/en-US/docs/Web/CSS/animation + +## Customization + +### Using icons in templates + +When you're [extending the theme][22] with partials or blocks, you can simply +reference any icon that's [bundled with the theme][1] with Jinja's +[`include`][23] function and wrap it with the `twemoji` class: + +``` html + + {% include ".icons/fontawesome/brands/twitter.svg" %} + +``` + +This is exactly what Material for MkDocs does in its templates. + + [22]: ../customization.md#extending-the-theme + [23]: https://jinja.palletsprojects.com/en/2.11.x/templates/#include