From 2495dc7278de9682c51aca2fcbe8b9b06ce44237 Mon Sep 17 00:00:00 2001 From: sevichecc <91365763+Sevichecc@users.noreply.github.com> Date: Thu, 26 Jan 2023 00:15:28 +0800 Subject: [PATCH] merge with upsteam https://github.com/importantimport/urara/commit/2ef763fc343df0497cb9409af1e3c069962d814d --- src/app.d.ts | 10 +++++++--- src/lib/components/extra/youtube.svelte | 10 +++++----- src/lib/components/post_action.svelte | 6 +++--- src/lib/components/post_comment.svelte | 7 ++++--- src/lib/components/post_pagination.svelte | 4 +--- src/lib/components/post_toc.svelte | 3 ++- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/app.d.ts b/src/app.d.ts index 6fdf9a6a..ef37bf76 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,6 +1,6 @@ /// -import { FFFBase, FFFExtra } from 'fff-flavored-frontmatter' +import type { FFFBase, FFFMention } from 'fff-flavored-frontmatter' interface ImportMetaEnv extends Readonly> { readonly URARA_SITE_PROTOCOL?: 'http://' | 'https://' @@ -15,8 +15,8 @@ interface ImportMeta { declare global { namespace Urara { namespace Post { - type Frontmatter = Omit & - Pick & { + type Frontmatter = Omit & + Pick & { /** * post type. * @remarks auto-generated @@ -51,6 +51,10 @@ declare global { * @remarks auto-generated or set manually */ updated: string + /** + * the published date of the post. + */ + published?: string /** * the featured image for article, or image for "photo" / "multi-photo" posts. * @remarks currently only supports string diff --git a/src/lib/components/extra/youtube.svelte b/src/lib/components/extra/youtube.svelte index 21979c61..cc97d75d 100644 --- a/src/lib/components/extra/youtube.svelte +++ b/src/lib/components/extra/youtube.svelte @@ -1,15 +1,15 @@ + \ No newline at end of file diff --git a/src/lib/components/post_comment.svelte b/src/lib/components/post_comment.svelte index a929f3c6..651f1332 100644 --- a/src/lib/components/post_comment.svelte +++ b/src/lib/components/post_comment.svelte @@ -3,7 +3,7 @@ import { toSnake } from '$lib/utils/case' export let post: Urara.Post export let config: CommentConfig - const comments = import.meta.glob<{ default: unknown }>('/src/lib/components/comments/*.svelte', { eager: true }) + const comments = import.meta.glob('/src/lib/components/comments/*.svelte', { eager: true, import: 'default' }) let currentComment: string | undefined = undefined let currentConfig: unknown | undefined = undefined currentComment = localStorage.getItem('comment') ?? toSnake(config.use[0]) @@ -16,6 +16,7 @@ {#if config.use.length > 1}
{#each config.use as name} + { currentComment = toSnake(name) @@ -33,10 +34,10 @@ {#if currentComment} {#key currentComment} {/key} {/if}
-{/if} +{/if} \ No newline at end of file diff --git a/src/lib/components/post_pagination.svelte b/src/lib/components/post_pagination.svelte index 43b68348..f837ad1d 100644 --- a/src/lib/components/post_pagination.svelte +++ b/src/lib/components/post_pagination.svelte @@ -7,7 +7,6 @@ + \ No newline at end of file diff --git a/src/lib/components/post_toc.svelte b/src/lib/components/post_toc.svelte index 03856656..e41a1571 100644 --- a/src/lib/components/post_toc.svelte +++ b/src/lib/components/post_toc.svelte @@ -55,6 +55,7 @@
    {#each toc as { depth, title, slug }}
  • + @@ -76,4 +77,4 @@ {/each}
- + \ No newline at end of file