Revision date doesn't work with Instant loading
See original GitHub issueI checked that…
- … the documentation does not mention anything about my problem
- … the problem doesn’t occur with the default MkDocs template
- … the problem is not in any of my customizations (CSS, JS, template)
- … there are no open or closed issues that are related to my problem
Description
When I set the instant
feature along with the git-revision-date-localized
plugin and click in any page from within the site, the XHR reload shows the new page fast, but the revision date won’t appear at the end. I can only see it by refresing the site.
This bug doesn’t happen when I follow a link to the site; only when I navigate through pages from within the site (XHR reloads).
Expected behavior
Go to another page, displayed by XHR, and see the revision date at the end.
Actual behavior
Go to another page, displayed by XHR, and only see “Last update:”, without any date.
Steps to reproduce the bug
- Enable
instant
andgit-revision-date-localized
:plugins: - search - git-revision-date-localized: type: timeago fallback_to_build_date: true
- Go to any page of your site following an URL from the outside. Revision date shows.
- Go to any page from within the site (sidebar, prev/next page buttons, etc). Revision date doesn’t show.
- Refresh the site. Revision date shows again.
Package versions
- Python: 3.8.5
- MkDocs: 1.1.2
- Material: 5.5.12+insiders.1.4.1
(although it also happened before using Insider builds)
Project configuration
# Appearance
theme:
name: material
custom_dir: theme
logo: assets/img/logo.png
favicon: assets/img/favicon.png
font:
text: PT Sans
code: PT Mono
palette:
- scheme: slate
primary: deep purple
accent: deep purple
toggle:
icon: material/weather-night
name: Switch to dark mode
- scheme: default
primary: deep purple
accent: deep purple
toggle:
icon: material/weather-sunny
name: Switch to light mode
features:
- instant
- tabs
- header.hide # Insiders
- search.highlight # Insiders
# Plugins
plugins:
- search
- minify:
minify_html: true
- git-revision-date-localized:
type: timeago
fallback_to_build_date: true
# Extensions
markdown_extensions:
- admonition
- def_list
- meta
- pymdownx.details
- pymdownx.emoji
- pymdownx.extra
- pymdownx.highlight
- pymdownx.inlinehilite
- pymdownx.keys:
separator: ' + '
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.striphtml
- pymdownx.superfences
- pymdownx.tabbed
- pymdownx.tasklist:
custom_checkbox: true
- toc:
separator: "-"
permalink: '#'
toc_depth: 3
# Customization
extra_css:
- assets/css/tasklist.css
- assets/css/tabbed.css
- assets/css/critic.css
- assets/css/2t1.css
extra_javascript:
- assets/js/details.js
- assets/js/tables.js
- assets/js/2t1.js
- https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js
System information
- OS: Windows 10 20H1
- Browser: Firefox 80.0.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
How to show revisions that are not displayed on titleblock in ...
Issue : On a specific plan view on a sheet which has many scope boxes. Each portion of the building is displayed in...
Read more >How to Fix Excel Dates That Won't Change Format - Contextures
See how to fix Excel dates that won't change format, by using a built-in Excel tool, and a few simple steps. format previews...
Read more >Revisions in Revit Tutorial - YouTube
Get these Project files, all Advanced Courses and 1 on 1 Classes:https://www.patreon.com/balkanarchitectSubscribe for more!
Read more >Google calendar not loading? Here is how to fix it. - TimeTackle
1. Update your browser. An un-updated browser can be an issue for Google Calendar to not load. Simply go to the google chrome...
Read more >If you can't change the time or time zone on your Apple device
Open Date & Time settings and make sure that the option to set time and date automatically, as well as the option to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sweet thanks for the help @squidfunk, and thanks for the detailed report @danierutu !
I just released
mkdocs-git-revision-date-localized-plugin
v0.7.1 which adds support for instant loading.@timvink thanks for your input! It’s not hard to get it working with instant loading. The documentation describes how to integrate
tablesort
, an external library, with instant loading:mkdocs.yml
:javascripts/tables.js
:As instant loading is a Material-specific feature, you’d have to detect Material. The
app.document$
observable is exposed no matter if instant loading is enabled or not, and will run on the initial document load and on every document load triggered by instant loading, so maybe you could detect Material like this:Other than that, you may also use the
generator
meta tag to detect Material: