在共享服务器上发布Blogdown网站时,防止重新编织旧的rmd文件 [英] Prevent re-knitting of old rmd files when publishing blogdown website on shared server

查看:481
本文介绍了在共享服务器上发布Blogdown网站时,防止重新编织旧的rmd文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了这篇文章blogdown文档,但我似乎找不到与我的案子相关的答案.

I read this post and the blogdown documentation, but I can't seem to find a relevant answer for my case.

编辑:我发现此博客文章描述了使用build_site(method="custom")的解决方法.我需要更改一些内容(在某些部分中从md更改为html,因为在我的情况下,最终的最终格式为html).它似乎适用于简单的Rmd,但是需要htmlwidgets的精美交互式图无法正确渲染.

I found this blog post describing a workaround using build_site(method="custom"). I needed to change a few things (from md to html in some parts, since the knitted final format is html in my case). It seems to work for simple Rmds, but fancy interactive plots requiring htmlwidgets don't render correctly.

我最近从Wordpress切换到了Hugo,并且拥有用于托管我的网站的共享服务器.我试图了解最好的工作流来推送更新.我正在使用blogdown::build_site()命令创建可发布的网站,但它会重新渲染所有旧的Rmd帖子,这需要花费更多时间.如何设置它以便仅重新创建新文件或编辑过的文件?如果我使用Netlify路由,由​​于版本控制和服务器端hugo功能,这将非常简单,但是我不知道如何实现类似的自托管解决方案.

I recently switched from Wordpress to Hugo and I have a shared server for hosting my website. I'm trying to understand the best workflow to push updates. I'm using blogdown::build_site() command to create a publication-ready website, but it re-renders all the old Rmd posts taking extra time. How can I set it up so it only recreates new or edited files? If I was using Netlify route, it would be pretty straightforward due to version control and server-side hugo function, but I don't know how to implement a similar solution for self-hosting.

在这种情况下,在共享服务器空间上处理Blogdown网站的良好工作流程是什么?我正在尝试使用WinSCP FTP同步功能,但是它需要比较所有文件,并且要花很长时间.据我所知,仅同步已编辑或新文件是不可能的.

Also in this context, what is a good workflow for dealing with blogdown sites on shared server space? I'm trying to use WinSCP FTP synchronization feature, but it needs to compare all the files and takes forever. It is not possible to sync only edited or new files as far as I know.

推荐答案

基本上,我要重复 您提到的帖子中的文档和我的回答:

Basically I'm repeating the documentation and my answer in the post you mentioned:

  1. 请勿使用blogdown::build_site()(再次,您很少需要使用此功能).

  1. Do not use blogdown::build_site() (again, you rarely need to use this function).

使用blogdown::serve_site()(连续)预览站点.

Use blogdown::serve_site() to (continuously) preview the site.

准备发布站点时,请运行blogdown::hugo_build(),然后发布public/目录.

When you are ready to publish the site, run blogdown::hugo_build(), and publish the public/ directory.

我希望这次清楚.

这篇关于在共享服务器上发布Blogdown网站时,防止重新编织旧的rmd文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆