feat: add hexo next context support (#4724)
This commit is contained in:
@@ -3,7 +3,7 @@ const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = `http://${ctx.params.url}`;
|
||||
const res = await got.get(`${url}/archives`);
|
||||
const res = await got.get(`${url}/archives/`);
|
||||
const $ = cheerio.load(res.data);
|
||||
|
||||
const list = $('.post-header');
|
||||
@@ -18,7 +18,7 @@ module.exports = async (ctx) => {
|
||||
const storyLink = each.find('.post-title-link').attr('href');
|
||||
const item = {
|
||||
title: each.find('[itemprop=name]').text(),
|
||||
link: encodeURI(`${url}${storyLink}`),
|
||||
link: encodeURI(new URL(storyLink, url)),
|
||||
};
|
||||
const key = item.link;
|
||||
const value = await ctx.cache.get(key);
|
||||
|
||||
Reference in New Issue
Block a user