Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit f71fbea

Browse files
committed
fix: missing client apis for feed
1 parent b2bbac7 commit f71fbea

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

docs/client-api/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,18 @@ Get the comment service
134134
#### `$service.email.enabled`
135135
136136
Whether email (newsletter) service is enabled.
137+
138+
### $service.feed
139+
140+
#### `$service.feed.rss`
141+
142+
whether RSS feed is enabled.
143+
144+
#### `$service.feed.atom`
145+
146+
whether Atom feed is enabled.
147+
148+
#### `$service.feed.json`
149+
150+
whether JSON feed is enabled.
151+

src/node/handleOptions.ts

+12
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ export function handleOptions(
194194
const services = {
195195
comment: { enabled: false, service: '' },
196196
email: { enabled: false },
197+
feed: { rss: false, atom: false, json: false },
197198
};
198199

199200
if (options.sitemap && options.sitemap.hostname) {
@@ -246,6 +247,17 @@ export function handleOptions(
246247
directories.forEach(dir => {
247248
defaultFeedOptions.posts_directories.push(dir.dirname);
248249
});
250+
251+
services.feed = { rss: true, atom: true, json: true };
252+
if (options.feed.feeds) {
253+
if (options.feed.feeds.rss2 && options.feed.feeds.rss2.enable === false)
254+
services.feed.rss = false;
255+
if (options.feed.feeds.atom1 && options.feed.feeds.atom1.enable === false)
256+
services.feed.atom = false;
257+
if (options.feed.feeds.json1 && options.feed.feeds.json1.enable === false)
258+
services.feed.json = false;
259+
}
260+
249261
const feedOptions = Object.assign({}, defaultFeedOptions, options.feed);
250262
plugins.push(['vuepress-plugin-feed', feedOptions]);
251263
}

0 commit comments

Comments
 (0)