r-lib / pkgdown

Generate static html documentation for an R package
https://pkgdown.r-lib.org/
Other
717 stars 335 forks source link

articles yml does not control articles section dropdown menu #1011

Closed CrumpLab closed 4 years ago

CrumpLab commented 5 years ago

This issue is similar to #995 and #325

This minimal example shows what appears to be a problem the yml for controlling the dropdown navigation for articles.

The yml below should do the following, but it does not: 1) rename the "articles" tab, 2) write a line of text in the article dropdown tab, and 3) re-order the listed articles to show Article2 before Article1. Additionally, deleting one of the articles from the list under menu does not eliminate it from the dropdown navigation.

navbar:
  components:
    articles:
      text: New Name for Articles not showing
      menu:
      - text: This Text doesn't show
      - text: Article2
        href: articles/Article2.html
      - text: Article1
        href: articles/Article1.html

link to minimal example:

https://github.com/CrumpLab/pkgdownMenuProblem

Many apologies if this has already been solved. I've attempted to read all of the issues and documentation, and still can't get it to work, so started to wonder if there was a bug, thanks for all the great work on pkgdown!

CrumpLab commented 5 years ago

It seems that changing the name of the vignettes folder to something else allows the yml controlling the articles dropdown to function as intended.

E.g., if I change vignettes to something, and then run pkgdown::build_site(), the .rmds in something appear to get rendered and put into an articles folder in docs. These are displayed in the Articles dropdown, and the menu description in the yml for articles now seems to work properly (e.g., respects order of articles, adds additional text, and omits articles not listed).

It wasn't clear to me from the documentation that .rmds in folders that are not in a vignettes would get rendered. But, at least the desired functionality is working by not including a vignettes folder.

hadley commented 5 years ago

Can you please make your reprex a bit more minimal? You should only need navbar > components > articles

CrumpLab commented 5 years ago

Thanks for the feedback, I edited and shortened the original comment, I hope this is closer to what you had in mind.

hadley commented 5 years ago

Perfect - do you mind making the same changes to https://github.com/CrumpLab/pkgdownMenuProblem/blob/master/_pkgdown.yml ? That'll make it faster for me to run down the problem when I next have time to work on it.

CrumpLab commented 5 years ago

done