Deployed 96a4717 to dev with MkDocs 1.6.1 and mike 2.1.3

This commit is contained in:
github-actions 2024-09-04 19:11:16 +00:00
parent 260186253c
commit 357e5aac12
60 changed files with 6905 additions and 4679 deletions

View file

@ -1,18 +1,33 @@
// Script to ensure timeago keeps working when
// used with mkdocs-material's instant loading feature
// Script to ensure timeago keeps working when
// used with mkdocs-material's instant loading feature
function getLocale(element) {
var raw_locale = element.getAttribute('locale');
var locale = {
bn: 'bn_IN',
en: 'en_US',
hi: 'hi_IN',
id: 'id_ID',
nb: 'nb_NO',
nn: 'nn_NO',
pt: 'pt_BR',
zh: 'zh_CN'
}[raw_locale];
return locale ? locale : raw_locale;
}
if (typeof document$ !== "undefined") {
document$.subscribe(function() {
var nodes = document.querySelectorAll('.timeago');
if (nodes.length > 0) {
var locale = nodes[0].getAttribute('locale');
timeago.render(nodes, locale);
var locale = getLocale(nodes[0]);
timeago.render(nodes, locale);
}
})
} else {
var nodes = document.querySelectorAll('.timeago');
if (nodes.length > 0) {
var locale = nodes[0].getAttribute('locale');
timeago.render(nodes, locale);
var locale = getLocale(nodes[0]);
timeago.render(nodes, locale);
}
}