Editing sidebar matter and nav links in blogdown site

blogdown

#1

Hi community,

I hope I’m posting in the right place. I’m currently trying to set up a blogdown site using Hugo and the Hyde theme (for now, I keep changing my mind about the theme). There’s currently

An elegant open source and mobile first theme for hugo made by @mdo. Originally made for Jekyll.

in the sidebar. How do I edit this part?

I’m using this blogdown book but I haven’t been able to find a solution. I’m sure I’m missing something obvious.

Also, is it possible to send the home page to my own .Rmd file? Say, to about instead?

Cheers


#2

Soooo, in the Jekyll version of this theme, it’s in the _config.yml, but I’m not 100% sure how Hugo works. Is it the description item in theme.toml?

I don’t know enough about Hugo or blogdown to know how to set the home page up, sorry :sweat_smile:

EDIT: I’m guessing that using an .Rmd as the home page works the same way as using a .md or other file—maybe you just name it index.Rmd, pop it in the root folder (actually, it could be content/_index.rmd in Hugo), and make sure it starts with a frontmatter block like:

+++
layout = "default"
+++

Here is my awesome home page content! With some R chunks, or whatever I wanna put in there...

The layout would be one of the ones provided by the theme… sorry, I know that’s a little vague! If someone with more Hugo knowledge wants to jump in, they might be able to give you a better answer :slightly_smiling_face:


#3

Thanks for helping out :sunny:

So, there wasn’t a _index.Rmd file already there. I tried making one, but that didn’t work. Perhaps there’s a blogdown command to help with index generation?


#4

Hmmm. If you serve the site using blogdown::serve_site() or the Serve Site add-in in RStudio, that should generate it and put the built site in public/. What does that look like (if we don’t put _index.rmd in there)?


#5

The sections of Hugo themes are driven by single html files. The names and usage is mostly consistent, but I’ve noticed that there are variances. In you case, I believe the side bar is controlled by the sidebar.html file located under the theme’s folder in the layouts/partials sub-folder. There are two options to edit/override this file, the first one is to change what you need in its current location, the second is to create the layouts/partials folders in your root project directory, copy the current side bar file there, and modify that one. Hugo has a hierarchy of places were it looks for its section sources, and layouts/ has higher priority than themes/[theme]/layouts/. Hope this helps.


#6

Thanks, @edgararuiz. Really helpful!