mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 15:26:17 +00:00
17 lines
345 B
JavaScript
17 lines
345 B
JavaScript
|
|
||
|
const { without } = require('lodash');
|
||
|
const Asset = require('./asset');
|
||
|
|
||
|
const postmatch = /(\d{4}-\d\d-\d\d)\.\d{4}\.(\w+)/;
|
||
|
|
||
|
module.exports = exports = class PostAsset extends Asset {
|
||
|
|
||
|
_dir (dir) {
|
||
|
dir = dir.replace(postmatch, '$2').split('/');
|
||
|
dir = without(dir, 'posts', '_images');
|
||
|
dir.unshift('p');
|
||
|
return dir;
|
||
|
}
|
||
|
|
||
|
};
|