4

My initial menu for my blogdown site is taken directly from the blogdown book.

[[menu.main]]
    name = "Home"
    url = "/"
    weight = 1
[[menu.main]]
    name = "About"
    url = "/about/"
    weight = 2
[[menu.main]]
    name = "GitHub"
    url = "https://github.com/rstudio/blogdown"
    weight = 3
[[menu.main]]
    name = "CV"
    url = "/vitae/"
    weight = 4
[[menu.main]]
    name = "Twitter"
    url = "https://twitter.com/rstudio"
    weight = 5

The index of my site automatically populates with any posts I add via Addins > New Post. If I alter my index.Rmd file in my main project directory (shown below) no changes occur on my front landing 'homepage'.

├── archetypes/
├── content/
├── data/
├── layouts/
├── public/
├── ...
├── config.toml
├── index.Rmd
└── my-website.Rproj

My index.Rmd file looks like this, although my website won't publish my intended paragraph on my main 'homepage'.

---
site: blogdown:::blogdown_site
---

# Intended first paragraph
Hi. Thank you for visiting my website... more words... etc

To further complicate matters, there is no _index.md file in my content/ directory. Could this be the issue? I'd like to post some introductory paragraphs before all my posts appear on the main page (homepage) of my blogdown website.

Display name
  • 4,153
  • 5
  • 27
  • 75

1 Answers1

5

Yes, you need to create _index.md under content/. Then the content of _index.md will be displayed on your homepage.

There was a minor issue with the hugo-lithium theme, which I just fixed on Github. In the old version, if _index.md is not empty, the list of posts will not be displayed. Now both the content and the list of posts will be displayed. If that is not what you want, you can certainly revert my change in layouts/_default/list.html.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
  • If I ever want to revert changes (I don't right now)... well... my `layouts/` directory is empty. Do I create a `_default/` directory inside of `layouts/`? Then create a file `list.html` inside the `_default` directory? And what do I put in the body of my `list.html` file? – Display name Dec 13 '18 at 21:20
  • Your files under `layouts/` will override those under the theme dir with the same names, so you just copy that `list.html` to your `layouts/_default/` and make changes there. – Yihui Xie Dec 14 '18 at 03:16
  • @JasonHunter - you might want to think about [accepting the answer](https://stackoverflow.com/help/someone-answers) – mhhollomon Dec 14 '18 at 14:50
  • 1
    Aha! I just realized there's a `/layouts/` directory and also a separate `/themes/hugo-lithium/layouts/` directory. Now it's starting to make sense. And I'll populate my `list.html` with the body from your *pre-Github-fix* `list.html` file, should I want the old behavior. – Display name Dec 14 '18 at 15:53