Small fixes
This commit is contained in:
parent
13540a651a
commit
612e92df82
|
@ -20,7 +20,7 @@ export default defineConfig({
|
|||
},
|
||||
}),
|
||||
],
|
||||
devToolbar: { enabled: false },
|
||||
// devToolbar: { enabled: false },
|
||||
server: {
|
||||
port: 12499,
|
||||
host: true,
|
||||
|
|
|
@ -33,6 +33,8 @@ const uniqueId = getRandomId();
|
|||
object-fit: cover;
|
||||
object-position: 50% 0;
|
||||
|
||||
z-index: -1;
|
||||
|
||||
mask-image: linear-gradient(to bottom, rgba(0 0 0 / 30%) 0%, transparent 100%);
|
||||
|
||||
@media (min-width: 110vh) {
|
||||
|
|
|
@ -35,8 +35,8 @@ const { t, getLocalizedUrl } = await getI18n(Astro.locals.currentLocale);
|
|||
}
|
||||
|
||||
<div id="toolbar" class="hide-scrollbar">
|
||||
<a href={getLocalizedUrl("/search")}>
|
||||
<Button icon="material-symbols:search" ariaLabel={t("header.topbar.search.tooltip")} />
|
||||
<a href={getLocalizedUrl("/search")} aria-label={t("header.topbar.search.tooltip")}>
|
||||
<Button icon="material-symbols:search" />
|
||||
</a>
|
||||
<div class="separator"></div>
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ switch (collectionSlug) {
|
|||
break;
|
||||
|
||||
case Collections.Languages:
|
||||
await refreshLocales()
|
||||
await refreshLocales();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -19,7 +19,7 @@ export const refreshWordings = async () => {
|
|||
};
|
||||
|
||||
export const refreshCurrencies = async () => {
|
||||
cache.currencies = (await payload.getCurrencies()).map(({ id }) => id)
|
||||
cache.currencies = (await payload.getCurrencies()).map(({ id }) => id);
|
||||
};
|
||||
|
||||
export const refreshLocales = async () => {
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
import {
|
||||
isNodeLinkNode,
|
||||
isNodeListNode,
|
||||
isNodeParagraphNode,
|
||||
isNodeTextNode,
|
||||
type RichTextContent,
|
||||
type RichTextNode,
|
||||
} from "src/shared/payload/payload-sdk";
|
||||
import { cache } from "src/utils/cachedPayload";
|
||||
|
||||
export const formatLocale = (code: string): string =>
|
||||
|
@ -22,3 +30,20 @@ export const formatInlineTitle = ({
|
|||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const formatRichTextToString = (content: RichTextContent): string => {
|
||||
const formatNode = (node: RichTextNode): string => {
|
||||
if (isNodeParagraphNode(node)) {
|
||||
return node.children.map(formatNode).join("");
|
||||
} else if (isNodeListNode(node)) {
|
||||
return "LIST";
|
||||
} else if (isNodeTextNode(node)) {
|
||||
return node.text;
|
||||
} else if (isNodeLinkNode(node)) {
|
||||
return node.children.map(formatNode).join("");
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
return content.root.children.map(formatNode).join("\n\n");
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue