Add export-story script and draft for Tiny Accident
This commit is contained in:
parent
7f7a62a391
commit
808f565e59
16 changed files with 678 additions and 15 deletions
|
|
@ -39,7 +39,7 @@ const authorsArray = [authors].flat();
|
|||
{lang === "tok" &&
|
||||
(authorsArray.length > 1 ? (
|
||||
<span>
|
||||
lipu ni li tan ni:{" "}
|
||||
lipu ni li tan jan ni:{" "}
|
||||
{authorsArray.slice(0, authorsArray.length - 1).map((author) => (
|
||||
<Fragment>
|
||||
<UserComponent lang="tok" user={author} />
|
||||
|
|
|
|||
|
|
@ -1,16 +1,20 @@
|
|||
---
|
||||
import { type CollectionEntry } from "astro:content";
|
||||
import { type Lang } from "../content/config";
|
||||
import { getEntry } from "astro:content";
|
||||
|
||||
type Props = {
|
||||
lang: Lang;
|
||||
user: CollectionEntry<"users">;
|
||||
};
|
||||
|
||||
const { user, lang } = Astro.props;
|
||||
let { user, lang } = Astro.props;
|
||||
if (user.data.isAnonymous) {
|
||||
user = await getEntry("users", "anonymous");
|
||||
}
|
||||
const username = user.data.nameLang[lang] || user.data.name;
|
||||
let link: string | null = null;
|
||||
if (!user.data.isAnonymous && user.data.preferredLink) {
|
||||
if (user.data.preferredLink) {
|
||||
if (user.data.preferredLink in user.data.links) {
|
||||
const preferredLink = user.data.links[user.data.preferredLink] as string | [string, string];
|
||||
if (typeof preferredLink === "string") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue