Skip to content

Commit

Permalink
Fixed instant navigation removing color theme tags
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Feb 29, 2024
1 parent 6219f3d commit d366a45
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion material/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

__version__ = "9.5.11"
__version__ = "9.5.12"

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions material/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<link rel="alternate" type="application/rss+xml" title="{{ lang.t('rss.updated') }}" href="{{ 'feed_rss_updated.xml' | url }}">
{% endif %}
<link rel="icon" href="{{ config.theme.favicon | url }}">
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-9.5.11">
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-9.5.12">
{% endblock %}
{% block htmltitle %}
{% if page.meta and page.meta.title %}
Expand Down Expand Up @@ -249,7 +249,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.553b3b51.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.c8d2eff1.min.js' | url }}"></script>
{% for script in config.extra_javascript %}
{{ script | script_tag }}
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mkdocs-material",
"version": "9.5.11",
"version": "9.5.12",
"description": "Documentation that simply works",
"keywords": [
"mkdocs",
Expand Down
10 changes: 8 additions & 2 deletions src/templates/assets/javascripts/integrations/instant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,14 @@ function inject(next: Document): Observable<Document> {
document.head.appendChild(el)

// Remove meta tags that are not present in the new document
for (const el of tags.values())
el.remove()
for (const el of tags.values()) {
const name = el.getAttribute("name")
// @todo - find a better way to handle attributes we add dynamically in
// other components without mounting components on every navigation, as
// this might impact overall performance - see https://t.ly/ehp_O
if (name !== "theme-color" && name !== "color-scheme")
el.remove()
}

// After components and meta tags were replaced, re-evaluate scripts
// that were provided by the author as part of Markdown files
Expand Down

0 comments on commit d366a45

Please sign in to comment.