Skip to content

[BUG] html 格式后缀与 md 冲突,导致不能正常显示页面或者文章 #377

Answered by Lruihao
Mejituu asked this question in Q&A
Discussion options

You must be logged in to vote

提供一种方案

  1. 开启 uglyURLs = true

  2. outputFormats 新增一个类型 HTMLPretty

    [HTMLPretty]
      mediaType = "text/html"
      isHTML = true
      noUgly = true
  3. outputs修改 部分输出类型为 HTMLPretty

    home = ["HTML", "RSS", "JSON", "BaiduUrls"]
    page = ["HTML", "MarkDown"]
    section = ["HTMLPretty", "RSS"]
    taxonomy = ["HTMLPretty"]
    term = ["HTMLPretty", "RSS"]
  4. 由于 posts 和 其他页面都是 page,所以 page 单独设置 url,例如:url: /about/

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Mejituu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Q&A question and answer
2 participants
Converted from issue

This discussion was converted from issue #271 on November 12, 2023 04:02.