gpt4 book ai didi

javascript - Assemble.io assemble-middleware-permalinks 不起作用,组装任务没有输出

转载 作者:行者123 更新时间:2023-11-28 01:10:19 25 4
gpt4 key购买 nike

编辑:已解决,见下文。

无法让“漂亮的 URL”与基于 Assemble.io 的网站一起使用。注释掉 assemble-middleware-permalinks 后,它可以将页面很好地组装到我指定的文件夹中(如 index.html、about.html 等)。

完整控制台输出:

# grunt

Running "clean:build" (clean) task
Cleaning ./dist...OK

Running "copy:assets" (copy) task
Created 2 directories, copied 13 files

Running "uglify:vendor" (uglify) task
File ./dist/development/assets/js/components.js created: 129.64 kB → 128.88 kB

Running "sass:dist" (sass) task
File dist/development/assets/css/main.css created.

Running "assemble:pages" (assemble) task

#

我的组装任务:

assemble: {

options: {
flatten: true,
plugins: [
'assemble-contrib-permalinks',
'assemble-middleware-sitemap'
],

permalinks: {
structure: ':basename/index.html'
},

// Templates
layoutdir: opt.layouts,
partials: opt.layouts + '/partials/*.hbs',
layout: 'default.hbs',

// data: opt.data + '/*.{json,yml}',
// assets: opt.dev + '/assets',

sitemap: {
homepage: opt.homepage,
changefreq: 'monthly',
priority: '0.8',
robot: false,
relativedest: true
},

},

pages: {
files: [
{
src: opt.pages + '/*.{hbs,md}',
dest: opt.dev + '/'
},
]
}
}

最佳答案

我终于让它工作了:

问题是 assemble-middlewear-permalinks v0.4.0 及更高版本需要 Assmble v0.5.0,但尚未准备好供公众使用(请参阅: https://github.com/assemble/assemble-middleware-permalinkshttps://github.com/assemble/grunt-assemble )。

修复方法是安装 assemble-contrib-permalinks (v0.3.6) 并使用它。我还为可能遇到此问题的其他人更新了汇编任务代码。

关于javascript - Assemble.io assemble-middleware-permalinks 不起作用,组装任务没有输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24525452/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com