Skip to content

Commit

Permalink
fix(asset-id): Change source config,the source assets folder can't be…
Browse files Browse the repository at this point in the history
… generated

fix hexojs#3398
  • Loading branch information
xiaomingplus committed Dec 24, 2018
1 parent ccce9d6 commit ca38c7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/plugins/processor/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const common = require('./common');
const Promise = require('bluebird');
const yfm = require('hexo-front-matter');
const { extname } = require('path');
const { extname, relative } = require('path');
const { Pattern } = require('hexo-util');

module.exports = ctx => {
Expand Down Expand Up @@ -84,7 +84,7 @@ module.exports = ctx => {
}

function processAsset(file) {
const id = file.source.substring(ctx.base_dir.length).replace(/\\/g, '/');
const id = relative(ctx.base_dir, file.source).replace(/\\/g, '/');
const Asset = ctx.model('Asset');
const doc = Asset.findById(id);

Expand Down

0 comments on commit ca38c7c

Please sign in to comment.