0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00

[ci] format

This commit is contained in:
FredKSchott 2022-08-15 04:28:38 +00:00 committed by fredkbot
parent 0e2f4d74b7
commit faa49db39b
3 changed files with 10 additions and 10 deletions

View file

@ -6,5 +6,5 @@ import sitemap from '@astrojs/sitemap';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'https://example.com', site: 'https://example.com',
integrations: [ mdx(), sitemap()], integrations: [mdx(), sitemap()],
}); });

View file

@ -6,8 +6,7 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
// Use Astro.glob() to fetch all posts, and then sort them by date. // Use Astro.glob() to fetch all posts, and then sort them by date.
const posts = (await Astro.glob('./blog/*.{md,mdx}')).sort( const posts = (await Astro.glob('./blog/*.{md,mdx}')).sort(
(a, b) => (a, b) => new Date(b.frontmatter.pubDate).valueOf() - new Date(a.frontmatter.pubDate).valueOf()
new Date(b.frontmatter.pubDate).valueOf() - new Date(a.frontmatter.pubDate).valueOf()
); );
--- ---

View file

@ -1,9 +1,10 @@
import rss from '@astrojs/rss'; import rss from '@astrojs/rss';
import {SITE_TITLE, SITE_DESCRIPTION} from '../config'; import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
export const get = () => rss({ export const get = () =>
title: SITE_TITLE, rss({
description: SITE_DESCRIPTION, title: SITE_TITLE,
site: import.meta.env.SITE, description: SITE_DESCRIPTION,
items: import.meta.glob('./blog/**/*.md'), site: import.meta.env.SITE,
}); items: import.meta.glob('./blog/**/*.md'),
});