File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,20 @@ export default defineConfig({
6262 svelte ( ) ,
6363 sitemap ( ) ,
6464 Compress ( {
65- CSS : true ,
65+ CSS : {
66+ lightningcss : {
67+ minify : true ,
68+ sourceMap : false ,
69+ drafts : {
70+ nesting : true ,
71+ } ,
72+ errorRecovery : true , // 添加错误恢复选项
73+ } ,
74+ } ,
6675 HTML : {
6776 'html-minifier-terser' : {
6877 removeAttributeQuotes : false ,
78+ decodeEntities : true , // 解码 HTML 实体
6979 } ,
7080 } ,
7181 Image : false ,
Original file line number Diff line number Diff line change 11import rss from '@astrojs/rss' ;
22import type { APIContext } from 'astro' ;
3- import MarkdownIt from 'markdown-it' ;
4- import sanitizeHtml from 'sanitize-html' ;
53
64import { siteConfig } from '@/config' ;
75import { getSortedPosts } from '@utils/content-utils' ;
86
9- const parser = new MarkdownIt ( ) ;
10-
117export async function GET ( context : APIContext ) {
128 const blog = await getSortedPosts ( ) ;
139
@@ -20,12 +16,15 @@ export async function GET(context: APIContext) {
2016 title : post . data . title ,
2117 pubDate : post . data . published ,
2218 description : post . data . description || '' ,
23- link : `/posts/${ post . slug } /` ,
24- content : sanitizeHtml ( parser . render ( post . body ) , {
25- allowedTags : sanitizeHtml . defaults . allowedTags . concat ( [ 'img' ] ) ,
26- } ) ,
19+ link : `${ context . site } /posts/${ post . slug } /` ,
2720 } ;
2821 } ) ,
29- // customData: `<language>${siteConfig.lang}</language>`,
22+ customData : `
23+ <language>${ siteConfig . lang . replace ( '_' , '-' ) } </language>
24+ <follow_challenge>
25+ <feedId>${ import . meta. env . FOLLOW_FEEDID } </feedId>
26+ <userId>${ import . meta. env . FOLLOW_USERID } </userId>
27+ </follow_challenge>
28+ ` ,
3029 } ) ;
3130}
You can’t perform that action at this time.
0 commit comments