【问题标题】:How do I get theme to apply for Hugo/Netlify website?如何获得主题以申请 Hugo/Netlify 网站?
【发布时间】:2019-09-15 11:55:00
【问题描述】:

使用 hugo-geo theme 和 RStudio,我在 Netlify 上构建了一个 website。我的代码在 GitHub (https://github.com/kathryn2/Website) 上。

我遇到的问题:初始页面效果很好。左窗格上的超链接都按预期工作。从左窗格中选择单个帖子时(例如,https://k22daugherty.netlify.com/post/how-heavily-armed-is-your-state/),格式完全是废话。就好像没有主题,网站不知道该做什么。我尝试查看是否缺少编织降价页面,当我这样做时,我会收到无法找到图像的错误。这是我第一次尝试使用 Rmarkdown(尽管我已经习惯了使用 Python 的 JupyterNotebook),所以任何明显的修复都值得一提。

任何帮助表示赞赏!

【问题讨论】:

  • 确切的错误信息是什么?你能在发生这个错误的地方放一个 rmarkdown 块吗?
  • 缺乏编织是什么导致主题无法延续?图片正在显示,所以我认为的问题是主题不一致。
  • 这是我得到的输出:处理文件:2016-12-17-how-heavily-armed-is-your-state.Rmd |............. ..................................................... ..| 100%没有R代码的普通文本
  • 输出文件:2016-12-17-how-heavily-armed-is-your-state.knit.md /Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS 2016-12-17-how-heavily-armed-is-your-state.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output 2016-12-17-how-heavily- armed-is-your-state.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template
  • /Users/kathryn_daugherty/Library/R/3.5/library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable 'theme:bootstrap' - -include-in-header /var/folders/gb/t5w_mwv15mv1rqgt0c4n0m500000gn/T//Rtmpg23VDM/rmarkdown-str1e676a4a20ac.html --mathjax --variable 'mathjax-url:mathjax.rstudio.com/latest/…' pandoc: 无法获取 /post/2016- 12-17-如何高度武装-是-你的-state_files/Firearms_Data_KAD.png

标签: r markdown hugo blogdown


【解决方案1】:

尝试以下方法:

从第 23 行修改 this file

<link rel="stylesheet" href="/css/style.css">

<link rel="stylesheet" href="public/css/style.css">

如果它不起作用,请注意您的 github 存储库应该是 public 文件夹,而不是您创建 R 项目和使用 blogdown 的整个文件夹。

【讨论】:

  • 我做了这个编辑,但在公开之前有一个反斜杠。对两个索引文件执行此操作:(1) github.com/kathryn2/Website/blob/master/public/post/index.html (2) github.com/kathryn2/Website/blob/master/public/post/… 问题仍然存在。另外,github repo应该是什么意思...?您能否澄清哪些文件夹/文件位于错误的文件夹中?我不太确定如何解决...
  • 当您使用 blogdown 和 Hugo 时(我的意思是,当使用 serve 功能时),许多文件夹和文件会自动创建。但是文件夹 public 是您的网站所在的位置。从您的github repository 仅上传 public 文件夹中的文件。尝试使用 public 中的所有文件创建一个新存储库(但不要上传文件夹,您需要这些文件)。您必须上传 all this 启用 gh-page 分支,看看现在内容是否按预期显示。
  • 我让它工作了。不完全确定如何,但你的建议确实有很大帮助。谢谢!!!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-09-24
  • 1970-01-01
  • 2022-10-13
  • 1970-01-01
相关资源
最近更新 更多