【问题标题】:blogdown - how do I specify which page a post will appear onblogdown - 我如何指定帖子将出现在哪个页面上
【发布时间】:2019-05-14 23:45:41
【问题描述】:
baseurl = "/"
relativeurls = false
languageCode = "en-us"
title = "A Hugo website"
theme = "hugo-lithium"
googleAnalytics = ""
disqusShortname = ""
ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown", "_files$", "_cache$"]

[permalinks]
    post = "/:year/:month/:day/:slug/"

[[menu.main]]
    name = "Home"
    url = "/"
    weight = 1
[[menu.main]]
    name = "About"
    url = "/about/"
    weight = 2
[[menu.main]]
    name = "Blog"
    url = "/blog/"
    weight = 3

[params]
    description = "A website built through Hugo and blogdown."

    highlightjsVersion = "9.12.0"
    highlightjsCDN = "//cdnjs.cloudflare.com/ajax/libs"
    highlightjsLang = ["r", "yaml"]
    highlightjsTheme = "github"

    MathJaxCDN = "//cdnjs.cloudflare.com/ajax/libs"
    MathJaxVersion = "2.7.5"

[params.logo]
    url = "logo.png"
    width = 50
    height = 50
    alt = "Logo"

我正在使用带有 hugo-lithium 主题的稍微修改的 blogdown 默认 config.toml。如上所示。如何使我的“主页”和“关于”页面保持静态?并将我所有的帖子转移到我的“博客”页面上?我在blogdown book 中找不到任何解释这一点的东西。

我做了discover this SO answer,它解释了如何更改存储文件的目录。这不是我想要的(我认为)。我想知道如何实际指定post 所在的页面。

【问题讨论】:

    标签: r r-markdown hugo blogdown toml


    【解决方案1】:

    在 hugo 中,网站的布局反映了内容目录中文件的布局。因此,如果您在 content/blog/my-cool-post.md 中有一篇博文,它将显示为 https://example.com/blog/my-cool-post.html

    请参阅hugo docs 了解更多信息。

    因此,对于您的 about 文件,只需将其直接放在内容中,为 content/about.md

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多