Installations
npm install hexo-generator-anything
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
14.17.2
NPM Version
6.14.13
Score
49.2
Supply Chain
97.7
Quality
74.9
Maintenance
100
Vulnerability
99.3
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
1,989
Last Day
3
Last Week
13
Last Month
23
Last Year
217
GitHub Statistics
2 Stars
71 Commits
1 Forks
3 Watching
1 Branches
1 Contributors
Package Meta Information
Latest Version
1.0.12
Package Id
hexo-generator-anything@1.0.12
Unpacked Size
30.22 kB
Size
8.00 kB
File Count
11
NPM Version
6.14.13
Node Version
14.17.2
Total Downloads
Cumulative downloads
Total Downloads
1,989
Last day
200%
3
Compared to previous day
Last week
225%
13
Compared to previous week
Last month
283.3%
23
Compared to previous month
Last year
-56.7%
217
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
hexo-generator-anything
Hexo plugin to generate index pages from custom front matter variables.
:information_source: This project is a fork from hexo-index-anything by Levi Wheatcroft, who is no longer maintaining the project. I have refactored the code and introduced some new features ... see below.
Introduction
Suppose you have an author variable in your front matter, this plugin will generate an overview page of all authors (called INDEX) and for each author, a listing page with all posts by that author (POSTS).
You can define multiple indexes to be created, by configuring several index-mappings
out of your Frontmatter variables (see Configuration).
Example
The Frontmatter data of the following two posts...
../source/_posts/post-1.md
1--- 2title: First Post 3author: Maria 4---
../source/_posts/post-2.md
1--- 2title: Second Post 3author: Jonas 4---
../source/_posts/post-3.md
1--- 2title: Third Post 3author: Jonas 4---
... will lead to:
-
../output/author/index.html
INDEX file with a link list of all authors -
../output/author/maria.html
POSTS file with list of all posts from Maria, here 'First Post' only -
../output/author/jonas.html
POSTS file with list of all posts from Jonas, here 'Second Post' and 'Third Post'
If you have activated the Hexo configuration attribute post_asset_folder
, then the output will be:
../output/author/index.html
../output/author/maria/index.html
../output/author/jonas/index.html
Installation
npm install hexo-generator-anything --save
Configuration
_config.yml
To configure the plugin, add following section to your Hexo's root _config.yml
:
1anything: 2 layout_index: anything-index 3 layout_posts: anything-posts 4 index_mappings: 5 - variable: author 6 path: author 7 - variable: my-other-variable 8 path: others 9
The settings in depth:
Settings | Description |
---|---|
layout_index | EJS template for processing INDEX file (if not set, Hexo's default index.ejs will be used) |
layout_posts | EJS template for processing POSTS file (if not set, Hexo's default index.ejs will be used) |
index_mappings | List of Anything mappings |
... variable | Frontmatter variable in your posts to generate an index of |
... path | Part of the path of the output files, which represents the index |
You can find examples for layout_index.ejs
and layout_posts.ejs
in the package samples
folder under /node_modules/hexo-generator-anything/
after installation. Place the files in your Hexo's layout folder.
Additional Markdown Files
For generating the INDEX page, you can enrich the information about each author (variable value = key), by providing a Markdown file in in your sources folder: ../source/anything/{index}/{key}
.
To stay with the example above, we have in index called authors
and two keys: maria
and jonas
:
1|- source 2| |- _anything 3| | |- authors 4| | | |-> maria.md 5| | | |-> jonas.md
Each of these files has to have at least one Frontmatter variable called title
, where you can overwrite the default key string (value of the index variable in the posts). You can extend the Frontmatter with as many variables as you want and use it in your INDEX EJS template.
The content of the MD file will also be available in the data for generating the INDEX page.
Example:
1--- 2title: Marias Posts 3avatar: ./photos/maria.jpg 4email: maria@my-domain.com 5--- 6 7Maria is writer of the month. Don't miss her tweets on [https://twitter.com/maria](https://twitter.com/maria)
The INDEX page itself, may have a linked Markdown file too, to provide content or additional data:
1|- source 2| |- _anything 3| | |- authors 4| | | |-> index.md 5| | | |-> ...
Usage
Install, configure, then run hexo generate
as usual.
Contributing
Yes, please ... fork the project, make your changes and submit pull requests against the main branch.
Demo
I have created this project for my blog and I use it to group some posts into series. You can see the result at: https://kiko.io/series
More Information
I have a section for this project on my blog with posts regarding this project (automatically generated by this plugin ;) at http://kiko.io/projects/hexo-generator-anything
History
1.0.5
- Path fix (Lowercase)
1.0.4
- Replaced vulnerable string.js library
1.0.3
- Refactorings
- Introducing Markdown file for INDEX page
titleSeparator
setting removed- Updated samples
1.0.1/2
- Markdown data fix
1.0.0
- Initial version
License
MIT : http://opensource.org/licenses/MIT
Codebase Vizualization
For an inactive diagram, please visit Repo Visualization App...
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/Create Vizualizing Codebase Diagram.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/kristofzerbe/hexo-generator-anything/Create Vizualizing Codebase Diagram.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/Create Vizualizing Codebase Diagram.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/kristofzerbe/hexo-generator-anything/Create Vizualizing Codebase Diagram.yml/main?enable=pin
- Info: 0 out of 1 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/Create Vizualizing Codebase Diagram.yml:1
- Info: no jobLevel write permissions found
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Score
3.2
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More