Problem
Loading js/tacc-theme.module.js via custom HTML:
- Loads important JavaScript in unexpected way (for a MkDocs project).
- Is only done because I forgot
import('…') can dynamically load ES module.
Solution
A. Compatible with MkDocs
- Rename
js/tacc-theme.module.js to js/tacc-theme.js.
- Edit
js/tacc-theme.js to use import('…') instead of import '…'.
- Edit
mkdocs.yml to load js/tacc-theme.js via extra_javascript.
- Delete
js/tacc-theme.module.js load from main.html.
B. Compatible with MkDocs-TACC
- Edit
mkdocs.yml to load js/tacc-theme.module.js via extra_javascript.
- Delete
js/tacc-theme.module.js load from main.html.
Problem
Loading
js/tacc-theme.module.jsvia custom HTML:import('…')can dynamically load ES module.Solution
A. Compatible with MkDocs
js/tacc-theme.module.jstojs/tacc-theme.js.js/tacc-theme.jsto useimport('…')instead ofimport '…'.mkdocs.ymlto loadjs/tacc-theme.jsviaextra_javascript.js/tacc-theme.module.jsload frommain.html.B. Compatible with MkDocs-TACC
mkdocs.ymlto loadjs/tacc-theme.module.jsviaextra_javascript.js/tacc-theme.module.jsload frommain.html.