我在建立雨果主题学术团体-Linked here时遇到了麻烦。这是对实验室小组学术套餐的绝佳修改。我一直与开发人员联系,他们指出使用示例的主题在他们的终端上效果很好(不是通过RStudio呈现的),这使我认为RStudio呈现主题的方式。标准的学术主题效果很好。
该模板仅产生一个未格式化的网站(如下)。通过“构建站点”选项运行时,以及在浏览器中运行时,这会在本地查看器中发生。当此主题在其他程序中运行时,它可以正确呈现,因此似乎是RStudio问题。
可复制
方法1:
启动新的Rstudio blogdown网站(需要安装blogdown):使用hugo主题“ biaslab / hugo-academic-group”启动项目,然后运行Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: post/single.html:19:19: executing "post/single.html" at <partial "authors" .Params.authors>: error calling partial
。
这将产生以下错误themes
。 RStudio会生成未格式化的网站。
(https://stackoverflow.com/image.jpg)
方法2: 根据主题开发者在GitHub上的自述文件的建议,我使用学术主题创建了一个新网站(或者可以使用任何主题/空白主题)
从Github下载学术小组主题到exampleSite
文件夹中,然后将root
文件夹的所有内容复制到您网站的void read_file(string iname, vector<int>& result) {
ifstream ist {iname}; // ist reads from the file named iname
if (!ist) error("can't open input file ",iname);
for (int temp; ist >> temp; )
result.push_back(temp);
if (ist.fail()) {
ist.clear(ios_base::failbit);
}
}
void write_file(string& oname, string& input1, const vector<int>& result) {
ofstream ost {oname}; // ost writes to a file named oname
if (!ost) error("can't open output file ",oname);
double sum = 0;
for (int i=0; i<result.size(); ++i)
sum += result[i];
ost << sum;
}
int main()
{
string input = "a.txt";
string output = "b.txt";
vector<int> result;
read_file(input, result);
write_file(output, input, result);
}
中,覆盖在那里。
以这种方式运行时,不再有错误,但是,该网站仍然呈现未格式化的内容(与上面相同)。在浏览器而不是RStudio本地查看器中运行时,格式问题仍然存在。