From 72d2fc4f8c0c09b33716d539c105b6f98b8c6193 Mon Sep 17 00:00:00 2001 From: band-a-prend Date: Wed, 26 Sep 2018 01:47:11 +0300 Subject: [PATCH] [SCons/Doc] Fix too long time offline render of Sphinx Docs pages Add asynchronous ('async', 'media' and conditional 'defer' attributes) loading of remote javascript and css files within Cantera 2.4.0 Sphinx Documentation to avoid too long render of pages in case of offline usage of documentation. --- doc/sphinx/_templates/layout.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/sphinx/_templates/layout.html b/doc/sphinx/_templates/layout.html index 916891eba..778bcb1a0 100644 --- a/doc/sphinx/_templates/layout.html +++ b/doc/sphinx/_templates/layout.html @@ -10,20 +10,24 @@ lang="en"> {%- macro script() %} {%- for scriptfile in script_files %} - + {%- if scriptfile.startswith("https://cdn.jsdelivr.net") %} + + {%- else %} + + {%- endif %} {%- endfor %} {%- endmacro %} {%- macro css() %} - + {%- for css in css_files %} {%- if css|attr("rel") %} - + {%- else %} - + {%- endif %} {%- endfor %} {%- endmacro %} @@ -152,7 +156,7 @@ lang="en"> - - + +