Skip to content

Commit cf2b39d

Browse files
committed
Documentation
1 parent 10177cc commit cf2b39d

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

Diff for: docs/plugins/privacy.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ plugins:
471471

472472
## Limitations
473473

474+
### Dynamic URLs
475+
474476
Dynamically created URLs as part of scripts are not detected, and thus cannot be
475477
downloaded automatically, as the plugin does not execute scripts – it only detects fully qualified URLs for downloading and replacement. In short, don't do this:
476478

@@ -485,15 +487,18 @@ Instead, always use fully qualified URLs:
485487
const url ="https://example.com/script.js"
486488
```
487489

488-
Note that the plugin does not scan embedded HTML for external assets –
489-
this is related to MkDocs, as it does not process HTML
490-
(not to be confused with the generated HTML) in the plugin pipeline.
491-
To self-host external assets of an embedded HTML,
492-
it has to be explicitly listed under [`extra_templates`][extra_templates] in `mkdocs.yml`:
490+
### Embedded HTML
493491

494-
[extra_templates]: https://www.mkdocs.org/user-guide/configuration/#extra_templates
492+
By default, embedded HTML files (e.g. in iframes) are not scanned for external
493+
assets. This is a limitation of MkDocs, as it considers `.html` files to be
494+
templates, which must be explicitly listed under
495+
[`extra_templates`][mkdocs.extra_templates]. Thus, to self-host external assets
496+
of an embedded HTML file:
495497

496498
``` yaml
497499
extra_templates:
498-
- embed.html
500+
- iframe.html
499501
```
502+
503+
Note that the path to `iframe.html` is relative to the
504+
[`docs_dir`][mkdocs.docs_dir] directory.

Diff for: docs/setup/setting-up-a-blog.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ We'll add more settings here, as we discover new use cases.
7272
[Insiders]: ../insiders/index.md
7373
[built-in blog plugin]: ../plugins/blog.md
7474
[built-in plugins]: ../insiders/getting-started.md#built-in-plugins
75-
[docs_dir]: https://www.mkdocs.org/user-guide/configuration/#docs_dir
7675
[start writing your first post]: #writing-your-first-post
7776

7877
[config.archive_pagination]: ../plugins/blog.md#config.archive_pagination
@@ -469,7 +468,7 @@ links:
469468
...
470469
```
471470

472-
You can use the exact same syntax as for the [`nav`][nav] section in
471+
You can use the exact same syntax as for the [`nav`][mkdocs.nav] section in
473472
`mkdocs.yml`, which means you can set explicit titles for links, add external
474473
links and even use nesting:
475474

@@ -489,14 +488,13 @@ links:
489488
```
490489

491490
If you look closely, you'll realize that you can even use an anchor to link to
492-
a specific section of a document, extending the possibilities of the [`nav`][nav]
493-
syntax in `mkdocs.yml`. The [built-in blog plugin] resolves the anchor and sets
494-
the title of the anchor as a [subtitle] of the related link.
491+
a specific section of a document, extending the possibilities of the
492+
[`nav`][mkdocs.nav] syntax in `mkdocs.yml`. The [built-in blog plugin] resolves
493+
the anchor and sets the title of the anchor as a [subtitle] of the related link.
495494

496-
Note that all links must be relative to [`docs_dir`][docs_dir], as is also the
497-
case for the [`nav`][nav] setting.
495+
Note that all links must be relative to [`docs_dir`][mkdocs.docs_dir], as is
496+
also the case for the [`nav`][mkdocs.nav] setting.
498497

499-
[nav]: https://www.mkdocs.org/user-guide/configuration/#nav
500498
[subtitle]: ../reference/index.md#setting-the-page-subtitle
501499

502500
#### Linking from and to posts
@@ -624,9 +622,9 @@ values defined for a post, which means you can define common properties in
624622
### Adding pages
625623

626624
Besides posts, it's also possible to add static pages to your blog by listing
627-
the pages in the [`nav`][nav] section of `mkdocs.yml`. All generated indexes
628-
are included after the last specified page. For example, to add a page on the
629-
authors of the blog, add the following to `mkdocs.yml`:
625+
the pages in the [`nav`][mkdocs.nav] section of `mkdocs.yml`. All generated
626+
indexes are included after the last specified page. For example, to add a page
627+
on the authors of the blog, add the following to `mkdocs.yml`:
630628

631629
``` yaml
632630
nav:

Diff for: includes/mkdocs.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[mkdocs.metadata]: https://www.mkdocs.org/user-guide/writing-your-docs/#yaml-style-meta-data
44
[mkdocs.env]: https://www.mkdocs.org/user-guide/configuration/#environment-variables
55
[mkdocs.docs_dir]: https://www.mkdocs.org/user-guide/configuration/#docs_dir
6+
[mkdocs.extra_templates]: https://www.mkdocs.org/user-guide/configuration/#extra_templates
67
[mkdocs.site_dir]: https://www.mkdocs.org/user-guide/configuration/#site_dir
78
[mkdocs.site_url]: https://www.mkdocs.org/user-guide/configuration/#site_url
89
[mkdocs.site_description]: https://www.mkdocs.org/user-guide/configuration/#site_description

0 commit comments

Comments
 (0)