Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(post-asset): strip extensions better on permalink" #5308

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading