diff --git a/src/pydata_sphinx_theme/assets/scripts/fontawesome.js b/src/pydata_sphinx_theme/assets/scripts/fontawesome.js index 6d3ee4317..10d83ecde 100644 --- a/src/pydata_sphinx_theme/assets/scripts/fontawesome.js +++ b/src/pydata_sphinx_theme/assets/scripts/fontawesome.js @@ -1,5 +1,5 @@ // TODO: @trallard might end up moving this to the main JS file // Define the custom behavior of the page -import { documentReady } from "./mixin"; -import "@fortawesome/fontawesome-free/js/all.min.js"; +import "@fortawesome/fontawesome-free/js/fontawesome.min.js"; +import "@fortawesome/fontawesome-free/js/all.min.js"; \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index f5427e4c2..5ceeac2f8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,7 +31,6 @@ exec(`pybabel compile -d ${localePath} -D sphinx`); const scriptPath = resolve(__dirname, "src/pydata_sphinx_theme/assets/scripts"); const staticPath = resolve(__dirname, "src/pydata_sphinx_theme/theme/pydata_sphinx_theme/static"); -const vendorPath = resolve(staticPath, "vendor"); /******************************************************************************* * functions to load the assets in the html head @@ -42,6 +41,8 @@ const vendorPath = resolve(staticPath, "vendor"); function stylesheet(css) { return ``; } function preload(js) { return ``; } function script(js) { return ``; } +// Adding FA without preloading +function fascript(js) { return ``; } /******************************************************************************* * the assets to load in the macro @@ -78,13 +79,14 @@ function macroTemplate({ compilation }) { {% endmacro %} {% macro head_js_preload() %} - + + ${fa_scripts.map(fascript.bind(compilation)).join("\n")} + ${theme_scripts.map(preload.bind(compilation)).join("\n")} {% endmacro %} {% macro body_post() %} - ${fa_scripts.map(script.bind(compilation)).join("\n")} ${theme_scripts.map(script.bind(compilation)).join("\n")} {% endmacro %} `);