-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
force_render_paths
parameter in config file (#204)
- this is a mechanism that forces rendering of files for the case when `render_by_default` is set to `false`. - it uses a git-like syntax to define files to include
- Loading branch information
Laurent Franceschetti
committed
Feb 19, 2024
1 parent
ef51c7a
commit 827943d
Showing
10 changed files
with
152 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Hello World | ||
# This is a test of opt-in with various mechanisms | ||
|
||
**This is the case of opt-in, where `render_by_default` is set to | ||
`false` in the config file.** | ||
|
||
|
||
{# The jinja2 code in this index page should not be rendered | ||
(since there must be an opt-in) #} | ||
|
||
## Should not be rendered | ||
{{ macros_info() }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
render_macros: true # opt-in | ||
title: Opt-in by page header | ||
--- | ||
# {{ title }} | ||
|
||
This page should be rendered, because the variable `render_macros` | ||
is set to `true` in this page. | ||
|
||
{{ macros_info() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
text: Hello world | ||
times: 5 | ||
--- | ||
|
||
# This page must NOT be rendered | ||
|
||
You should have some uninterpreted Jinja2 here. | ||
|
||
This is because there is opt-in (`render_by_default` is set to `false`). | ||
|
||
|
||
{% for n in range(times) %} | ||
- {{ n }}: {{text}} | ||
{% endfor %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Opt-in by paths | ||
--- | ||
# {{ title }} | ||
|
||
This page must be rendered because there is `render_*.md` in the | ||
`force_render_paths` variable, and the name of this page is | ||
**`{{page.file.src_uri}}`**. | ||
|
||
{{ macros_info() }} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
text: Hello world | ||
times: 10 | ||
--- | ||
|
||
# Opt-in by directory | ||
|
||
This page is rendered, because the `rendered/` path is | ||
specified in the `mkdocs.yml` file, | ||
and the original filename of this page is **`{{page.file.src_uri}}`**. | ||
|
||
|
||
{% for n in range(times) %} | ||
- {{ n }}: {{text}} | ||
{% endfor %} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters