小编WaL*_*oui的帖子

Lektor CMS:无法让 lektor-tags 正常工作,在服务器上找不到请求的 URL

我正在尝试使用为此建立一个博客..我需要一个标签系统,搜索后我在 lektor文档上找到了一个名为lektor 的插件lektor CMSlektor-tags

我遵循文档中的每一步,付出了很多努力,甚至访问了 github存储库,看看是否还有其他未包含在文档中的内容。

我的问题是,当我尝试访问时,localhost:5000/{the_tag_name}localhost:5000/python总是听到404 Not Found这样的话

在服务器上找不到请求的 URL。如果您手动输入 URL,请检查拼写并重试。

这就是我到目前为止所做的:

使用lektor-tags

  1. 我将博客文章的路径更改/posts/blog

  2. 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. 创建了 3 个帖子,一切正常。

此时我想使用标签系统,所以我选择使用lektor-tags,我所做的是:

  1. 安装

    lektor plugins add lektor-tags
    
    Run Code Online (Sandbox Code Playgroud)
  2. configs/tags.ini使用此配置创建:

    parent = /
    url_path = {{ this.parent.url_path }}{{ …
    Run Code Online (Sandbox Code Playgroud)

python tags blogs lektor static-site-generation

5
推荐指数
1
解决办法
286
查看次数

标签 统计

blogs ×1

lektor ×1

python ×1

static-site-generation ×1

tags ×1