Skip to content

Commit 6922478

Browse files
authored
Add example including file only if exists (#243)
1 parent f725896 commit 6922478

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

examples/include-if-exists/docs/empty.md

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Some included content.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- Only include 'included.md' if exists. Always include 'empty.md'. -->
2+
3+
{% include-markdown '?(empty.md)?(included.md)' %}
4+
5+
{% include-markdown '?(empty.md)?(not-existent.md)' %}

examples/include-if-exists/mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
site_name: Foo
2+
plugins:
3+
- include-markdown

0 commit comments

Comments
 (0)