Refactor tu use astrowind:config virtual import
This commit is contained in:
@@ -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 ({
|
||||
|
@@ -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';
|
||||
|
||||
|
@@ -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) : '');
|
||||
|
||||
|
Reference in New Issue
Block a user