Refactor tu use astrowind:config virtual import

This commit is contained in:
prototypa
2024-03-29 00:49:47 -04:00
parent f6d5e6cb39
commit 6b14879507
22 changed files with 28 additions and 30 deletions

View File

@@ -2,7 +2,7 @@ import type { PaginateFunction } from 'astro';
import { getCollection } from 'astro:content';
import type { CollectionEntry } from 'astro:content';
import type { Post } from '~/types';
import { APP_BLOG } from '~/utils/config';
import { APP_BLOG } from 'astrowind:config';
import { cleanSlug, trimSlash, BLOG_BASE, POST_PERMALINK_PATTERN, CATEGORY_BASE, TAG_BASE } from './permalinks';
const generatePermalink = async ({

View File

@@ -1,6 +1,6 @@
import slugify from 'limax';
import { SITE, APP_BLOG } from '~/utils/config';
import { SITE, APP_BLOG } from 'astrowind:config';
import { trim } from '~/utils/utils';

View File

@@ -1,13 +1,11 @@
import { I18N } from '~/utils/config';
import { I18N } from 'astrowind:config';
const formatter: Intl.DateTimeFormat =
I18N?.dateFormatter ||
new Intl.DateTimeFormat('en', {
year: 'numeric',
month: 'short',
day: 'numeric',
timeZone: 'UTC',
});
export const formatter: Intl.DateTimeFormat = new Intl.DateTimeFormat(I18N?.language, {
year: 'numeric',
month: 'short',
day: 'numeric',
timeZone: 'UTC',
});
export const getFormattedDate = (date: Date): string => (date ? formatter.format(date) : '');