New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hexo-generator-index

Package Overview
Dependencies
Maintainers
8
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-generator-index - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

4

lib/generator.js
'use strict';
const pagination = require('hexo-pagination');
const { sort } = require('timsort');

@@ -8,2 +9,5 @@ module.exports = function(locals) {

const posts = locals.posts.sort(config.index_generator.order_by);
sort(posts.data, (a, b) => (b.sticky || 0) - (a.sticky || 0));
const paginationDir = config.pagination_dir || 'page';

@@ -10,0 +14,0 @@ const path = config.index_generator.path || '';

17

package.json
{
"name": "hexo-generator-index",
"version": "1.0.0",
"version": "2.0.0",
"description": "Index generator for Hexo.",

@@ -19,3 +19,3 @@ "main": "index",

"engines": {
"node": ">=8.6.0"
"node": ">=10.13.0"
},

@@ -34,11 +34,12 @@ "repository": "hexojs/hexo-generator-index",

"chai": "^4.2.0",
"eslint": "^6.0.1",
"eslint-config-hexo": "^3.0.0",
"hexo": "^3.0.0",
"mocha": "^6.0.2",
"nyc": "^14.1.1"
"eslint": "^7.1.0",
"eslint-config-hexo": "^4.1.0",
"hexo": "^5.0.0",
"mocha": "^8.0.1",
"nyc": "^15.0.0"
},
"dependencies": {
"hexo-pagination": "1.0.0"
"hexo-pagination": "1.0.0",
"timsort": "^0.3.0"
}
}

@@ -9,2 +9,4 @@ # hexo-generator-index

It generates an archive of posts on your homepage, according to the `index` or `archive` layout of your theme.
## Installation

@@ -17,2 +19,3 @@

## Options
Add or modify the following section to your root _config.yml file

@@ -25,2 +28,3 @@

order_by: -date
pagination_dir: page
```

@@ -39,2 +43,18 @@

## Usage
The `sticky` parameter in the post [Front-matter](https://hexo.io/docs/front-matter) will be used to pin the post to the top of the index page. Higher `sticky` means that it will be ranked first.
```yml
---
title: Hello World
date: 2013/7/13 20:46:25
sticky: 100
---
```
## Note
If your theme define a non-archive `index` layout (e.g. About Me page), this plugin would follow that layout instead and not generate an archive. In that case, use [hexo-generator-archive](https://github.com/hexojs/hexo-generator-archive) to generate an archive according to the `archive` layout.
## License

@@ -41,0 +61,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc