Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
OzakIOne committed Jul 25, 2024
1 parent c79902b commit 5454916
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/docusaurus-plugin-content-blog/src/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type {
Author,
BlogPost,
BlogFeedItem,
FeedOptions,
} from '@docusaurus/plugin-content-blog';

async function generateBlogFeed({
Expand Down Expand Up @@ -187,9 +188,7 @@ async function addXmlStyleSheet({

const {contentPath} = contentPaths;
const fileName = path.parse(xslPath).name;
console.log(xslPath);
const isDefault = xslPath === 'rss.xslt' || xslPath === 'atom.xslt';
console.log('isDefault:', isDefault);
const directoryPath = isDefault
? path.join(__dirname, '../assets/')
: contentPath;
Expand Down Expand Up @@ -220,17 +219,13 @@ async function createBlogFeedFile({
feed,
feedType,
generatePath,
xslt,
atomXslt,
rssXslt,
feedOptions: {atomXslt, rssXslt, xslt},
contentPaths,
}: {
feed: Feed;
feedType: FeedType;
generatePath: string;
xslt: boolean;
atomXslt: string;
rssXslt: string;
feedOptions: FeedOptions;
contentPaths: BlogContentPaths;
}) {
let feedDetails = (() => {
Expand Down Expand Up @@ -307,9 +302,7 @@ export async function createBlogFeedFiles({
feed,
feedType,
generatePath: path.join(outDir, options.routeBasePath),
xslt: options.feedOptions.xslt,
atomXslt: options.feedOptions.atomXslt,
rssXslt: options.feedOptions.rssXslt,
feedOptions: options.feedOptions,
contentPaths,
}),
),
Expand Down

0 comments on commit 5454916

Please sign in to comment.