Markdown source: not working #5403
-
So I've inherited an old customized version of mkdocs-material (v6.1.1 2020-09-26). I can't really upgrade right now, but certainly something I will look into. In our markdown (.md files) that uses this theme, we have files that include javascript for just that page by using the source: meta data. e.g.
Prior to the owner leaving these source: files were included as into the page somehow, but now after rebuilding the theme for a minor color change, they are not getting included anymore. Can anyone point me to where/how this source: files are getting included, so I can check to see if that code was disrupted or not? I feel like this is handled by Jinja2 (heard this somewhere but not familiar with it) somehow? If so, it is possible that a version change of Jinja2 somehow stopped supporting this, so when I rebuilt the theme it pulled an updated dependency and stopped supporting it? Thank you so much for any advice. All the best. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The |
Beta Was this translation helpful? Give feedback.
-
Thanks so much for the reply Martin.
Assuming that is the case with this customized version, what is the
official method of including per-page javascript now?
I could add them to extra_javascript but didn't really want them on every
page.
On the flip side, if I wanted to reintroduce it or at least a simplified
version of it, is this something I could add back into my theme somehow?
Seems like I'd just need to loop over the list of entries in the tag
somewhere in a base or main html?
All the best
…On Fri, Apr 21, 2023, 6:34 PM Martin Donath ***@***.***> wrote:
The source Markdown property was deprecated in 5.5.0
<https://squidfunk.github.io/mkdocs-material/changelog/#5.5.0> and
removed in 6.0.0
<https://squidfunk.github.io/mkdocs-material/changelog/#6.0.0>, but it
was never meant to include (runnable) JavaScript. It was meant to link to
source files. You said you didn't upgrade, but it sounds like that, so
maybe investigate that.
—
Reply to this email directly, view it on GitHub
<#5403 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APYDZE2PTNPITDT5EGPLBBDXCMDPZANCNFSM6AAAAAAXHIFZXI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
You can just add JavaScript to a single page by adding it inline in the Markdown:
If you need to add that to multiple pages, consider using theme extension and define a
template
, where you add your script tags (and potentially other customizations), that you then set via front matter: