-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
timeago output is dynamic, which breaks when you print a page. | ||
This CSS is only included when type: timeago | ||
and ensures fallback to type "iso_date" when printing. | ||
*/ | ||
|
||
.git-revision-date-localized-plugin-iso_date { display: none } | ||
|
||
@media print { | ||
.git-revision-date-localized-plugin-iso_date { display: inline } | ||
.git-revision-date-localized-plugin-timeago { display: none } | ||
} | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// 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 = getLocale(nodes[0]); | ||
timeago.render(nodes, locale); | ||
} | ||
}) | ||
} else { | ||
var nodes = document.querySelectorAll('.timeago'); | ||
if (nodes.length > 0) { | ||
var locale = getLocale(nodes[0]); | ||
timeago.render(nodes, locale); | ||
} | ||
} |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.