From 8796f52c9d688f59de47fc7e386ba927f0e6e09a Mon Sep 17 00:00:00 2001 From: "Jocelyn Badgley (Twipped)" Date: Tue, 7 Apr 2020 10:32:32 -0700 Subject: [PATCH] POSTMATCH --- build/post.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/post.js b/build/post.js index 6e40d41..d33b452 100644 --- a/build/post.js +++ b/build/post.js @@ -6,7 +6,7 @@ const Page = require('./page'); const slugify = require('./lib/slugify'); 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+)/; function arrayify (input) { if (!input) return []; @@ -28,21 +28,21 @@ module.exports = exports = class Post extends Page { } _dir (dir) { - // if the file name matches the postmatch pattern, then this needs to be /p/ file - const match = this.name.match(postmatch); + // if the file name matches the POSTMATCH pattern, then this needs to be /p/ file + const match = this.name.match(POSTMATCH); if (match) { return [ 'tweets', match[2] ]; } - dir = dir.replace(postmatch, '$2').split('/'); + dir = dir.replace(POSTMATCH, '$2').split('/'); dir = without(dir, 'posts', '_images'); dir.unshift('tweets'); return dir; } _out () { - var isIndexPage = (this.name === 'index' || this.name.match(postmatch)); + var isIndexPage = (this.name === 'index' || this.name.match(POSTMATCH)); var isClean = isCleanUrl(this.ext); if (isClean && isIndexPage) {