问题
I have created a tutorial using Bookdown (which I think is a great format for it), and am currently in the process of creating a website using Blogdown (hugo-academic theme). I would like to be able to add this tutorial to a tutorials page as a Bookdown post, but I don't know if that's possible.
I'm new to Blogdown, so I haven't been able to find any solutions to this. If it's not possible, is there a way of changing the post link to a hyperlink that takes the user to a published Bookdown file (perhaps to bookdown.org)?
回答1:
From my point of view it makes more sense to keep the tutorials (written with bookdown
) separate from the rest of the website (written with blogdown
). One possible solution is to use the "portfolio" widget together with content that uses external_link
, similar to how "external projects" work. Since you do not want the tutorials widget on the home page, you need to do the following:
Create a directory
content/tutorial
containing directories for every individual tutorial. Each of these directories contains anindex.md
modeled after "external project", i.e. with anexternal_link
attribute.Create a second directory
content/tutorials
with anindex.md
widget page, c.f. https://sourcethemes.com/academic/docs/managing-content/#create-a-widget-pageCreate in the second directory a portfolio widget, e.g. by copying
projects.md
, where you setpage_type
totutorial
(the name of the first directory).
The crucial point is that you need two directories. One for the tutorials and one for the widgets. Full example is on GitHub. Of course, it would make sense to add a link to /tutorials/
(not /tutorial/
!) to your sites menu.
来源:https://stackoverflow.com/questions/57415416/is-there-a-way-to-embed-a-bookdown-document-as-a-blogdown-post