1

I am wondering why after running 'build' my nunjucks pages (other than index.njk) are getting output into separate folders? For example, if I have a file 'src/products.njk', it will be output to 'dist/products/index.html'.

For example

src
|-- index.njk
|-- products.njk
dist
|-- index.html
|-- products
           |-- index.html

If there is an advantage to this type of renaming could you explain it to me?

Can this be overriden so that the file remains in the same output folder as 'dist/products.html'? Or is that an unwise thing to do?

4

1 回答 1

1

因为它被视为现代最佳实践,不让用户去/products.html,但让/products足够了。

这也允许更轻松地迁移到不同的堆栈,因为您不会被绑定到一种文件类型。

在这里查看 W3c 关于 URL 样式的说法,以及Eleventy 文档必须说的更多信息。

于 2020-07-24T14:46:14.270 回答