diff options
-rw-r--r-- | assets/js/index.js | 11 | ||||
-rw-r--r-- | static/js/timeago.ts | 10 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.following.html | 1 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.webring.html | 3 | ||||
-rw-r--r-- | themes/default/layouts/partials/author-card.html | 1 |
5 files changed, 18 insertions, 8 deletions
diff --git a/assets/js/index.js b/assets/js/index.js index 3d133fd..c2b6fb5 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -574,9 +574,6 @@ const view = element.getBoundingClientRect(); return view.top >= -options.offset && view.left >= -options.offset && view.bottom <= (window.innerHeight || self.documentElement.clientHeight) + options.offset && view.right <= (window.innerWidth || self.documentElement.clientWidth) + options.offset; } - function tiny(string, place) { - return string.split(" ").slice(0, place).join(" ") + string.split(" ")[place].charAt(0); - } const date = function(update) { const elements = document.querySelectorAll("time"); for(let i = 0; i < elements.length; ++i){ @@ -593,6 +590,14 @@ const days = Math.round(hours / 24); const past = Math.sign(seconds) === 1; const future = Math.sign(seconds) === -1; + let tiny = function(string, place) { + return string.split(" ").slice(0, place).join(" ") + string.split(" ")[place].charAt(0); + }; + if (element.dataset.type === "default") { + tiny = function(string) { + return string; + }; + } if (element.dataset.type === "localDate") { return element.textContent = new Intl.DateTimeFormat([], { dateStyle: "medium" diff --git a/static/js/timeago.ts b/static/js/timeago.ts index 2949d44..9cc5370 100644 --- a/static/js/timeago.ts +++ b/static/js/timeago.ts @@ -15,10 +15,6 @@ view.right <= (window.innerWidth || self.documentElement.clientWidth) + options.offset; } - function tiny(string, place) { - return string.split(" ").slice(0, place).join(" ") + string.split(" ")[place].charAt(0); - } - const date = function (update) { const elements = document.querySelectorAll("time"); for (let i = 0; i < elements.length; ++i) { @@ -39,6 +35,12 @@ const past = Math.sign(seconds) === 1; const future = Math.sign(seconds) === -1; + let tiny = function (string, place) { + return string.split(" ").slice(0, place).join(" ") + string.split(" ")[place].charAt(0); + } + + if (element.dataset.type === "default") { tiny = function (string) { return string; }; } + if (element.dataset.type === "localDate") { return element.textContent = new Intl.DateTimeFormat([], { dateStyle: "medium", diff --git a/themes/default/layouts/_default/section.following.html b/themes/default/layouts/_default/section.following.html index bb1b920..0eba618 100644 --- a/themes/default/layouts/_default/section.following.html +++ b/themes/default/layouts/_default/section.following.html @@ -49,6 +49,7 @@ </a> </h3> <time + data-type="default" title="{{ $distinct.FeedDateTitle }}" datetime="{{ $distinct.FeedDateTime }}"> {{ $distinct.FeedDate -}} diff --git a/themes/default/layouts/_default/section.webring.html b/themes/default/layouts/_default/section.webring.html index e2f4518..9816dbf 100644 --- a/themes/default/layouts/_default/section.webring.html +++ b/themes/default/layouts/_default/section.webring.html @@ -40,7 +40,7 @@ {{- else -}} {{ or .FeedContentShort .FeedTitle }} {{- end }} - — + <br /> <a data-hover title="{{ .FeedSourceDescription }}" @@ -49,6 +49,7 @@ </a> </p> <time + data-type="default" title="{{ .FeedDateTitle }}" datetime="{{ .FeedDateTime }}"> {{ .FeedDate }} diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index 02ab0b2..a370eaf 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -66,6 +66,7 @@ </a> </h3> <time + data-type="default" title="{{ .Date | time.Format "Monday January 2 2006 at 15:04:05 MST" }}" datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}" > |