From e5654e73aa5c51d2bbf007b3a2835523e73f6e8b Mon Sep 17 00:00:00 2001 From: fossabot Date: Sun, 17 Sep 2023 04:50:22 -0600 Subject: [PATCH 1/4] Add license scan report and status Signed off by: fossabot --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ab45f95..0927352 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # hexo-plugin-aurora +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauroral-ui%2Fhexo-plugin-aurora.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauroral-ui%2Fhexo-plugin-aurora?ref=badge_shield) + This plugin is used for [aurora-ui/hexo-theme-aurora](https://github.com/auroral-ui/hexo-theme-aurora) to do the following: @@ -11,3 +13,7 @@ This plugin is used for [aurora-ui/hexo-theme-aurora](https://github.com/auroral - Multi-language support > This plugin can only to be used with **hexo-theme-aurora** only! + + +## License +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauroral-ui%2Fhexo-plugin-aurora.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauroral-ui%2Fhexo-plugin-aurora?ref=badge_large) \ No newline at end of file From 6923d2a69c8ca2e7b4860f83da2400f9af4e0cf4 Mon Sep 17 00:00:00 2001 From: Benny Guo Date: Wed, 1 Nov 2023 23:41:08 +0800 Subject: [PATCH 2/4] chore: removed github repo update for package.json version --- package.json | 2 +- release.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 60e6e29..349535c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-plugin-aurora", - "version": "1.8.3", + "version": "0.0.0-semantic-release", "description": "A plugin for Hexo Aurora theme", "main": "index.js", "keywords": [ diff --git a/release.config.js b/release.config.js index 82ce945..5bc917b 100644 --- a/release.config.js +++ b/release.config.js @@ -13,7 +13,7 @@ module.exports = { [ '@semantic-release/git', { - assets: ['CHANGELOG.md', 'data/**', 'lib/**', 'index.js', 'package.json'], + assets: ['CHANGELOG.md', 'data/**', 'lib/**', 'index.js'], message: 'chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}' } From f3896ccd0f2c80e115d499f2947f123cd7bad6e6 Mon Sep 17 00:00:00 2001 From: Benny Guo Date: Wed, 1 Nov 2023 23:42:16 +0800 Subject: [PATCH 3/4] fix: category and post generator missing config options --- lib/generators/category.js | 58 ++++++++++++++++++-------------------- lib/generators/post.js | 6 ++-- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/lib/generators/category.js b/lib/generators/category.js index 443739f..ba5187f 100644 --- a/lib/generators/category.js +++ b/lib/generators/category.js @@ -1,24 +1,20 @@ -const pagination = require('hexo-pagination') -const { - categoryMapper, - categoryPageMapper, - postListMapper -} = require('../helpers/mapper') +const pagination = require('hexo-pagination'); +const { categoryMapper, categoryPageMapper, postListMapper } = require('../helpers/mapper'); class CategoryGenerator { - data = [] - posts = [] - configs = {} + data = []; + posts = []; + configs = {}; constructor(categories, posts, configs) { - this.data = categories.length > 0 ? categories : [] - this.posts = posts - this.configs = configs - this.reduceCategories() - for(let cat of this.data) { + this.data = categories.length > 0 ? categories : []; + this.posts = posts; + this.configs = configs; + this.reduceCategories(); + for (let cat of this.data) { cat.data.postlist.sort(function (a, b) { - return a.date< b.date? 1 : -1; - }) + return a.date < b.date ? 1 : -1; + }); } } @@ -27,26 +23,26 @@ class CategoryGenerator { data.push({ path: 'api/categories.json', data: JSON.stringify([]) - }) + }); } else { data.push({ path: 'api/categories.json', data: JSON.stringify(this.data.map(categoryMapper)) - }) - const categoryPages = this.data.map(categoryPageMapper) - data = data.concat(categoryPages) + }); + const categoryPages = this.data.map(categoryPageMapper); + data = data.concat(categoryPages); } - return data + return data; } reduceCategories() { - if (this.count() <= 0) return - const categories = this.data - const posts = this.posts - const configs = this.configs + if (this.count() <= 0) return; + const categories = this.data; + const posts = this.posts; + const configs = this.configs; this.data = categories.reduce(function (result, item) { - if (!item.length) return result + if (!item.length) return result; return result.concat( pagination(item.path, posts, { @@ -57,17 +53,17 @@ class CategoryGenerator { count: item.posts.length, path: 'api/categories/' + item.slug + '.json', postlist: item.posts.map((post) => { - return postListMapper(post, configs) + return postListMapper(post, configs); }) } }) - ) - }, []) + ); + }, []); } count() { - return this.data.length + return this.data.length; } } -module.exports = CategoryGenerator +module.exports = CategoryGenerator; diff --git a/lib/generators/post.js b/lib/generators/post.js index a420956..62abf4c 100644 --- a/lib/generators/post.js +++ b/lib/generators/post.js @@ -235,7 +235,7 @@ class PostGenerator { // To keep the list post count event, use 13 instead of 12 const pageSize = this.isFeature ? 12 : 13; const pageCount = Math.ceil(length / pageSize); - const postData = filteredData.map(postListMapper); + const postData = filteredData.map((item) => postListMapper(item, this.configs)); for (let i = 0; i < length; i += pageSize) { pageJson.push({ @@ -267,7 +267,7 @@ class PostGenerator { // To keep the list post count event, use 13 instead of 12 const pageSize = this.isFeature ? 12 : 13; const pageCount = Math.ceil(length / pageSize); - const postData = filteredData.map(postListMapper); + const postData = filteredData.map((item) => postListMapper(item, this.configs)); for (let i = 0; i < length; i += pageSize) { pageJson.push({ @@ -313,7 +313,7 @@ class PostGenerator { if (this.count() <= 0) return data; data.push({ path: 'api/features.json', - data: JSON.stringify(this.features.map(postListMapper)) + data: JSON.stringify(this.features.map((item) => postListMapper(item, this.configs))) }); return data; } From 3ec0f0ee09837c4708f5bf965215e91e71a17033 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 1 Nov 2023 20:59:55 +0000 Subject: [PATCH 4/4] chore(release): set `package.json` to 1.8.4 [skip ci] ## [1.8.4](https://github.com/auroral-ui/hexo-plugin-aurora/compare/v1.8.3...v1.8.4) (2023-11-01) ### Bug Fixes * category and post generator missing config options ([f3896cc](https://github.com/auroral-ui/hexo-plugin-aurora/commit/f3896ccd0f2c80e115d499f2947f123cd7bad6e6)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08556e2..9e6b3b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.8.4](https://github.com/auroral-ui/hexo-plugin-aurora/compare/v1.8.3...v1.8.4) (2023-11-01) + + +### Bug Fixes + +* category and post generator missing config options ([f3896cc](https://github.com/auroral-ui/hexo-plugin-aurora/commit/f3896ccd0f2c80e115d499f2947f123cd7bad6e6)) + ## [1.8.3](https://github.com/auroral-ui/hexo-plugin-aurora/compare/v1.8.2...v1.8.3) (2023-09-16)