From 69224788015c8b50ebf31cc0f42eff15be12be61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Thu, 28 Nov 2024 19:07:16 +0100 Subject: [PATCH] Add example including file only if exists (#243) --- examples/include-if-exists/docs/empty.md | 0 examples/include-if-exists/docs/included.md | 1 + examples/include-if-exists/docs/index.md | 5 +++++ examples/include-if-exists/mkdocs.yml | 3 +++ 4 files changed, 9 insertions(+) create mode 100644 examples/include-if-exists/docs/empty.md create mode 100644 examples/include-if-exists/docs/included.md create mode 100644 examples/include-if-exists/docs/index.md create mode 100644 examples/include-if-exists/mkdocs.yml diff --git a/examples/include-if-exists/docs/empty.md b/examples/include-if-exists/docs/empty.md new file mode 100644 index 0000000..e69de29 diff --git a/examples/include-if-exists/docs/included.md b/examples/include-if-exists/docs/included.md new file mode 100644 index 0000000..333a243 --- /dev/null +++ b/examples/include-if-exists/docs/included.md @@ -0,0 +1 @@ +Some included content. diff --git a/examples/include-if-exists/docs/index.md b/examples/include-if-exists/docs/index.md new file mode 100644 index 0000000..f4be21f --- /dev/null +++ b/examples/include-if-exists/docs/index.md @@ -0,0 +1,5 @@ + + +{% include-markdown '?(empty.md)?(included.md)' %} + +{% include-markdown '?(empty.md)?(not-existent.md)' %} diff --git a/examples/include-if-exists/mkdocs.yml b/examples/include-if-exists/mkdocs.yml new file mode 100644 index 0000000..0f97266 --- /dev/null +++ b/examples/include-if-exists/mkdocs.yml @@ -0,0 +1,3 @@ +site_name: Foo +plugins: + - include-markdown