···11-export { default as BandcampWishlist } from "./BandcampWishlist.astro";
22-export { default as BlogPreviewCard } from "./BlogPreviewCard.astro";
33-export { default as Footer } from "./Footer.astro";
44-export { default as Head } from "./Head.astro";
55-export { default as LiberaPayDonate } from "./LiberaPayDonate.astro";
66-export { default as Link } from "./Link.astro";
77-export { default as Navigation } from "./Navigation.astro";
88-export { default as BlueskyComments } from "./BlueskyComments.svelte";
99-export { default as Button } from "./Button.svelte";
1010-export { default as ThemeToggle } from "./ThemeToggle.svelte";
11+export { default as BandcampWishlist } from './BandcampWishlist.astro';
22+export { default as BlogPreviewCard } from './BlogPreviewCard.astro';
33+export { default as Footer } from './Footer.astro';
44+export { default as Head } from './Head.astro';
55+export { default as LiberaPayDonate } from './LiberaPayDonate.astro';
66+export { default as Link } from './Link.astro';
77+export { default as Navigation } from './Navigation.astro';
88+export { default as BlueskyComments } from './BlueskyComments.svelte';
99+export { default as Button } from './Button.svelte';
···11+export function getCookie(name: string): string | null {
22+ const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
33+ return match ? decodeURIComponent(match[2]) : null;
44+}
55+66+export function setCookie(name: string, value: string, days?: number): void {
77+ let expires = '';
88+ if (days) {
99+ const date = new Date();
1010+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
1111+ expires = `; expires=${date.toUTCString()}`;
1212+ }
1313+ document.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;
1414+}
+1
src/utils/index.ts
···11export { default as formatDate } from "./formatDate";
22export { default as formatBlogTitleUrl } from "./formatBlogTitleUrl";
33+export * from './cookies';