blogger - 与 Blogger 永久链接格式完全匹配的 Hugo 永久链接格式是什么?
问题描述
我正在尝试从 Blogger 迁移到托管在 Google App Engine 上的 Hugo。我正在尝试重建的示例网址:
https://www.darianhickman.com/2017/03/one-year-of-uber-lyft-2016-5300.html
在我的 config.toml 文件中,我正在尝试:
[permalinks]
post = "/:year/:month/:title.html"
它很接近但失败了。示例 Hugo 生成的 url:
http://localhost:1313/2017/03/one-year-of-uber--lyft-2016-5300.html/
Hugo 的默认行为是将帖子放入带有 index.html 的文件夹中。我需要改变什么?
解决方案
Hugo 的默认行为是将帖子放入带有 index.html 的文件夹中。我需要改变什么?
在您的配置文件(通常命名为config.toml
)中,您需要启用名为“ugly URLs”的功能,如下所示:
uglyURLs = true
这样做会使 Hugo 以/my-post.html
. 默认情况下,Hugo 会将index.html
您提到的那些文件/my-post/
作为 URL 类型。
推荐阅读
- c# - 在不使用 AuthorizeAttribute 的情况下将 AuthorizationPolicy 绑定到 Controller/Action
- r - LOCF 插补以及如何填写缺失的条目
- webpack - 观看时如何告诉 webpack 将包放在特定文件夹中?
- python - python发布请求不呈现表
- node.js - 纱线“错误:EISDIR:对目录的非法操作,读取”
- google-oauth - 如何删除谷歌日历未经验证的应用程序屏幕?
- python - 基于 PySpark 的内联正则表达式匹配方法,如 Pandas
- kotlin - 调用 ConfigurationBuilder.newComponent() 时“没有足够的信息来推断类型变量 B”
- typescript - 键属于其他类型的对象的打字稿类型
- entity-framework - 如何使用 Entity Framework Core 先插入子数据,然后插入父数据和子插入身份