fix(route): did no match the version and date (#13942)
* fix(route): did no match the version and date * Update latest.js * Update latest.js ---------
This commit is contained in:
parent
ea24778c47
commit
082bb3d847
|
|
@ -20,13 +20,15 @@ module.exports = async (ctx) => {
|
|||
|
||||
const title = item.text();
|
||||
const device = item.parent().find('h2').text();
|
||||
const matchVersion = title.match(/(v[\d.]+)/);
|
||||
const matchDate = title.match(/\((.*?)\)/);
|
||||
|
||||
return {
|
||||
title: `[${device}] ${title}`,
|
||||
link: currentUrl,
|
||||
guid: `${currentUrl}#${device}-${title.match(/(v[\d.]+)/)[1]}`,
|
||||
guid: `${currentUrl}#${device}-${matchVersion?.[1] ?? title}`,
|
||||
description: item.next().html(),
|
||||
pubDate: parseDate(title.match(/\((.*?)\)/)[1].replace(/(st|nd|rd|th)?,/, ''), ['MMMM D YYYY', 'MMM D YYYY']),
|
||||
pubDate: parseDate(matchDate?.[1].replace(/(st|nd|rd|th)?,/, ''), ['MMMM D YYYY', 'MMM D YYYY']),
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue