我正在尝试使用为此建立一个博客..我需要一个标签系统,搜索后我在 lektor文档上找到了一个名为lektor 的插件lektor CMSlektor-tags
我遵循文档中的每一步,付出了很多努力,甚至访问了 github存储库,看看是否还有其他未包含在文档中的内容。
我的问题是,当我尝试访问时,localhost:5000/{the_tag_name}我localhost:5000/python总是听到404 Not Found这样的话
在服务器上找不到请求的 URL。如果您手动输入 URL,请检查拼写并重试。
这就是我到目前为止所做的:
使用前lektor-tags:
我将博客文章的路径更改/posts为/blog。
models/blog.ini添加了slug 格式[children]
[children]
model = blog-post
order_by = pub_date, title
slug_format = {{ (this.pub_date|dateformat('YYYY/M/') if this.pub_date) ~ this._id }}
Run Code Online (Sandbox Code Playgroud)
创建了 3 个帖子,一切正常。
此时我想使用标签系统,所以我选择使用lektor-tags,我所做的是:
安装
lektor plugins add lektor-tags
Run Code Online (Sandbox Code Playgroud)
configs/tags.ini使用此配置创建:
parent = /
url_path = {{ this.parent.url_path }}{{ …Run Code Online (Sandbox Code Playgroud)