Skip to content

Commit

Permalink
Revert "fix(post-asset): strip extensions better on permalink (#5153)"
Browse files Browse the repository at this point in the history
This reverts commit 8b95bbc.
  • Loading branch information
D-Sketon authored Oct 8, 2023
1 parent b267475 commit b3c4184
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/models/post_asset.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { Schema } = require('warehouse').default;
const { join, dirname } = require('path');
const { join } = require('path');

module.exports = ctx => {
const PostAsset = new Schema({
Expand All @@ -19,8 +19,8 @@ module.exports = ctx => {

// PostAsset.path is file path relative to `public_dir`
// no need to urlescape, #1562
// strip extensions better on permalink, #2134
return join(dirname(post.path), post.slug, this.slug);
// strip /\.html?$/ extensions on permalink, #2134
return join(post.path.replace(/\.html?$/, ''), this.slug);
});

PostAsset.virtual('source').get(function() {
Expand Down

0 comments on commit b3c4184

Please sign in to comment.