Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexo-generator-tag

Package Overview
Dependencies
Maintainers
8
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-generator-tag - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0-rc1

4

index.js
/* global hexo */
'use strict';
var assign = require('object-assign');
hexo.config.tag_generator = assign({
hexo.config.tag_generator = Object.assign({
per_page: hexo.config.per_page == null ? 10 : hexo.config.per_page

@@ -8,0 +6,0 @@ }, hexo.config.tag_generator);

'use strict';
var pagination = require('hexo-pagination');
const pagination = require('hexo-pagination');
module.exports = function(locals) {
var config = this.config;
var perPage = config.tag_generator.per_page;
var paginationDir = config.pagination_dir || 'page';
var tags = locals.tags;
var tagDir;
const config = this.config;
const perPage = config.tag_generator.per_page;
const paginationDir = config.pagination_dir || 'page';
const orderBy = config.tag_generator.order_by || '-date';
const tags = locals.tags;
let tagDir;
var pages = tags.reduce(function(result, tag) {
const pages = tags.reduce((result, tag) => {
if (!tag.length) return result;
var posts = tag.posts.sort('-date');
var data = pagination(tag.path, posts, {
const posts = tag.posts.sort(orderBy);
const data = pagination(tag.path, posts, {
perPage: perPage,

@@ -18,0 +19,0 @@ layout: ['tag', 'archive', 'index'],

{
"name": "hexo-generator-tag",
"version": "0.2.0",
"version": "1.0.0-rc1",
"description": "Tag generator for Hexo.",

@@ -8,5 +8,4 @@ "main": "index",

"eslint": "eslint .",
"jscs": "jscs .",
"test": "mocha test/index.js",
"test-cov": "istanbul cover --print both _mocha -- test/index.js"
"test-cov": "nyc npm run test"
},

@@ -16,2 +15,6 @@ "directories": {

},
"files": [
"index.js",
"lib/"
],
"repository": "hexojs/hexo-generator-tag",

@@ -27,15 +30,15 @@ "homepage": "http://hexo.io/",

"devDependencies": {
"chai": "^3.5.0",
"chai": "^4.2.0",
"hexo": "^3.1.1",
"mocha": "^2.4.5",
"istanbul": "^0.4.2",
"eslint": "^1.10.3",
"jscs": "^2.9.0",
"eslint-config-hexo": "^1.0.2",
"jscs-preset-hexo": "^1.0.1"
"mocha": "^6.0.2",
"eslint": "^6.0.1",
"eslint-config-hexo": "^3.0.0",
"nyc": "^14.1.1"
},
"dependencies": {
"hexo-pagination": "0.0.2",
"object-assign": "^4.0.1"
"hexo-pagination": "1.0.0-rc1"
},
"engines": {
"node": ">=8.6.0"
}
}
# hexo-generator-tag
[![Build Status](https://travis-ci.org/hexojs/hexo-generator-tag.svg?branch=master)](https://travis-ci.org/hexojs/hexo-generator-tag) [![NPM version](https://badge.fury.io/js/hexo-generator-tag.svg)](http://badge.fury.io/js/hexo-generator-tag) [![Coverage Status](https://img.shields.io/coveralls/hexojs/hexo-generator-tag.svg)](https://coveralls.io/r/hexojs/hexo-generator-tag?branch=master)
[![Build Status](https://travis-ci.org/hexojs/hexo-generator-tag.svg?branch=master)](https://travis-ci.org/hexojs/hexo-generator-tag)
[![NPM version](https://badge.fury.io/js/hexo-generator-tag.svg)](https://www.npmjs.com/package/hexo-generator-tag)
[![Coverage Status](https://img.shields.io/coveralls/hexojs/hexo-generator-tag.svg)](https://coveralls.io/r/hexojs/hexo-generator-tag?branch=master)

@@ -18,5 +20,7 @@ Tag generator for [Hexo].

per_page: 10
order_by: -date
```
- **per_page**: Posts displayed per page. (0 = disable pagination)
- **order_by**: Posts order. (Order by date descending by default)

@@ -27,2 +31,2 @@ ## License

[Hexo]: http://hexo.io/
[Hexo]: http://hexo.io/

Sorry, the diff of this file is not supported yet

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