mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 15:26:17 +00:00
Libraryify slugify
This commit is contained in:
parent
dbce40d195
commit
98b9fd7934
@ -10,8 +10,7 @@ const Handlebars = require('handlebars');
|
|||||||
const HandlebarsKit = require('hbs-kit');
|
const HandlebarsKit = require('hbs-kit');
|
||||||
HandlebarsKit.load(Handlebars);
|
HandlebarsKit.load(Handlebars);
|
||||||
|
|
||||||
const slugs = require('slugify');
|
const slugify = require('./lib/slugify');
|
||||||
const slugify = (s) => slugs(s, { remove: /[*+~.,()'"!?:@/\\]/g }).toLowerCase();
|
|
||||||
const striptags = require('string-strip-html');
|
const striptags = require('string-strip-html');
|
||||||
|
|
||||||
const markdownIt = require('markdown-it');
|
const markdownIt = require('markdown-it');
|
||||||
|
5
build/lib/slugify.js
Normal file
5
build/lib/slugify.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
const slugs = require('slugify');
|
||||||
|
|
||||||
|
module.exports = exports = function slugify (s) {
|
||||||
|
return slugs(s, { remove: /[*+~.,()'"!?:@/\\]/g }).toLowerCase();
|
||||||
|
};
|
@ -3,8 +3,7 @@ const path = require('path');
|
|||||||
const { without } = require('lodash');
|
const { without } = require('lodash');
|
||||||
const { resolve, isCleanUrl, TYPE, ENGINE } = require('./resolve');
|
const { resolve, isCleanUrl, TYPE, ENGINE } = require('./resolve');
|
||||||
const Page = require('./page');
|
const Page = require('./page');
|
||||||
const slugs = require('slugify');
|
const slugify = require('./lib/slugify');
|
||||||
const slugify = (s) => slugs(s, { remove: /[*+~.,()'"!?:@/\\]/g }).toLowerCase();
|
|
||||||
const pkg = require(resolve('package.json'));
|
const pkg = require(resolve('package.json'));
|
||||||
|
|
||||||
const postmatch = /(\d{4}-\d\d-\d\d)\.\d{4}\.(\w+)/;
|
const postmatch = /(\d{4}-\d\d-\d\d)\.\d{4}\.(\w+)/;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user