Blogdown: getting relative links to work

blogdown

#1

After I set up a blogdown site in my GitHub space, I cannot seem to get the links to my posts to connect correctly. So far, I have my site at

and I have my config.toml file set with

  • baseurl = "https://github.com/dsollberger/blog/public/"

(failed to work if I included "public/" or not in the baseurl). The post RMD files are back in

  • .../blog/content/post/

Do we really have to install a Hugo site in the master directory?


#2

I didn’t host my blog via GitHub, but if I’m reading things correctly I think you will need a “username.github.io” repository (with your actual username in place of “username”)…

I base this guess on the blogdown book chapter on GitHub but, as I said, I haven’t tried it so can’t verify. :grinning: Once you have that repository then your baseurl would be "https://username.github.io/".

You may also find this blog post useful (if you haven’t seen it already).


#3

Hi- @aosmith is right- you need to change the baseurl in your config file to https://dsollberger.github.io/. Check out Amber’s blog post: http://amber.rbind.io/blog/2016/12/19/creatingsite/

And this section in the blogdown book as @aosmith already suggested:
https://bookdown.org/yihui/blogdown/github-pages.html

You may also want to look into other options aside from GitHub pages, like Netlify (Yihui’s blog post on the topic). See this part of the blogdown book:
https://bookdown.org/yihui/blogdown/netlify.html

I also did a blog post documenting the steps using Netlify and GitHub here:
https://alison.rbind.io/post/up-and-running-with-blogdown/


#4

Thank you both for your help. You were right; going with the Netlify route was by far more practical. I was able to slap together a blogdown site at http://dsollberger.netlify.com/