We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7edbf25 commit 8b95bbcCopy full SHA for 8b95bbc
1 file changed
lib/models/post_asset.js
@@ -1,7 +1,7 @@
1
'use strict';
2
3
const { Schema } = require('warehouse').default;
4
-const { join } = require('path');
+const { join, dirname } = require('path');
5
6
module.exports = ctx => {
7
const PostAsset = new Schema({
@@ -19,8 +19,8 @@ module.exports = ctx => {
19
20
// PostAsset.path is file path relative to `public_dir`
21
// no need to urlescape, #1562
22
- // strip /\.html?$/ extensions on permalink, #2134
23
- return join(post.path.replace(/\.html?$/, ''), this.slug);
+ // strip extensions better on permalink, #2134
+ return join(dirname(post.path), post.slug, this.slug);
24
});
25
26
PostAsset.virtual('source').get(function() {
0 commit comments