【问题标题】:(Hugo) Load dynamic Content from Raw GitHub(Hugo) 从原始 GitHub 加载动态内容
【发布时间】:2016-04-20 03:19:56
【问题描述】:

有没有办法从原始的 GitHub 用户内容动态地将内容加载到 Hugo 中?

例如

如果在静态站点中的 repo 中有 about.md(在其他页面中),但我宁愿没有重复,这将有助于可维护性。

【问题讨论】:

    标签: github dynamic-content hugo


    【解决方案1】:

    查看此处描述的 base64 模板函数的示例:

    https://gohugo.io/templates/functions/

    {{ $resp := getJSON "https://api.github.com/repos/spf13/hugo/readme" }} {{ $resp.content | base64Decode | markdownify }}

    【讨论】:

      猜你喜欢
      • 2020-10-07
      • 1970-01-01
      • 2020-03-31
      • 2018-12-16
      • 2021-04-02
      • 2013-03-29
      • 2011-06-14
      • 2014-02-23
      • 2017-12-22
      相关资源
      最近更新 更多