diff --git a/bun.lockb b/bun.lockb index 144258d..650d8c8 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 6185a5e..e3d2a41 100644 --- a/package.json +++ b/package.json @@ -46,11 +46,8 @@ "@types/node-schedule": "^2.1.7", "nanoid": "^5.1.0", "node-schedule": "^2.1.1", - "rehype-autolink-headings": "^7.1.0", - "rehype-slug": "^6.0.0", "robots-parser": "^3.0.1", - "steamgriddb": "^2.2.0", - "svelte-time": "^2.0.0" + "steamgriddb": "^2.2.0" }, "trustedDependencies": [ "@sveltejs/kit", diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 9c7d347..bb28868 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -3,7 +3,6 @@ import Note from '../components/note.svelte'; import Window from '../components/window.svelte'; import LatestStuff from './lateststuff.md'; - import Time from "svelte-time"; interface Props { data: any; @@ -20,6 +19,21 @@ minute: "2-digit", }) } + const renderRelativeDate = (timestamp: number) => { + const elapsed = timestamp - (new Date()).getTime() + const units: Record = { + year : 24 * 60 * 60 * 1000 * 365, + month : 24 * 60 * 60 * 1000 * 365/12, + day : 24 * 60 * 60 * 1000, + hour : 60 * 60 * 1000, + minute: 60 * 1000, + second: 1000 + } + const rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto' }) + for (var unit in units) + if (Math.abs(elapsed) > units[unit] || unit == 'second') + return rtf.format(Math.round(elapsed / units[unit]), unit as Intl.RelativeTimeFormatUnit) + }
@@ -157,9 +171,10 @@

last log was… - published

diff --git a/svelte.config.js b/svelte.config.js index aee11db..178d6ee 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -2,8 +2,6 @@ import adapter from 'svelte-adapter-bun'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import { mdsvex } from 'mdsvex' -import rehypeAutolinkHeadings from 'rehype-autolink-headings' -import rehypeSlug from 'rehype-slug' import * as toml from "@std/toml"; @@ -33,10 +31,6 @@ const config = { } }, }, - rehypePlugins: [ - rehypeSlug, - rehypeAutolinkHeadings, - ], smartypants: { dashes: 'oldschool', quotes: true,