Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Minor typo,
But while I was reading the vignette, some thoughts occured to me. Just thought I'd share them as the timing seems right (actively working on pkgdown 2.1, and closed more than 100 issues in a few weeks(?!) you are a machine!)
I wanted to share my thoughts on my last pain point when iterating and customizing a site locally:
init_site()
or noinit_site()
.typical site customization workflow
In this type of workflow, now allowed with #2439 and #2571, I find step 0.1 to be the most nebulous
usethis::use_pkgdown()
0.1
init_site()
(only needed sometimes?)build_home()
In short, I'd want to know what special edits to site config (1) requires manually running
init_site()
(0.1).I would use your answer to add this to
?init_site
, as it seems sufficient. BUT, ideally, it would be great to identify these special cases, if there was a way for pkgdown to be smart about this, therefore acheiving the end goal I had when I opened #2439 and #2329.You don't do site customization this often, but when you do, it is more fun if it's not too difficult!
In very long words, my unfiltered thoughts on
init_site()
When iterating on theming or customizing a site, sometimes you need to run
init_site()
, (which can take a longer) (especially on Windows with no SSD, copying files is sooo slow, I don't understand why). So, it is slow to call this a lot.I see that in the vignette, it is required to call
init_site()
when changing font for previewing. I guess it is required in other contexts, what are they? And when is it not required? AFAIR, iterating by changing bslib variables in template doesn't requireinit_site()
.I wonder if you could add to
?init_site
a section like that.When do you need to run
init_site()
.When you don't have to (since we made that redundant in #2439
usethis::use_pkgdown()
+build_site()
instead.build_site()
._pkgdown.yml
Maybe a more agile
refresh_site()
orinit_site(lazy = TRUE)
could be introduced that would only do the required things? (a la usethis::use_github_action()
, Callinguse_github_action()
asks (or lets you and informs) overwrite R-CMD-check.yml.Personally, I am leveraging
usethis::write_over()
in my workflows. I wonder if pkgdown could have something similar.refresh_site()
could be called in thebuild_*()
functions, similar to what we did in Avoid creation of faulty site #2439, a lazy alternative toinit_site()
.AFAICT,
init_site(lazy = TRUE)
would have to do something if.init_site()
_pkgdown.yml
changedinit_site(lazy = FALSE)
refresh_site()
would know about this and would inform + overwrite logo favicons. Otherwise, does nothing.docs/
Since pkgdown keeps a copy of pkgdown.yml in the
docs/
folder, it would just be to a few targeted comparisons, between_pkgdown.yml
anddocs/_pkgdown.yml
Do inform of how
init_site(lazy = TRUE)
handled special components.etc.
Here are my thoughts on
init_site()
for context.(Disclaimer: I haven't followed all your latest development on pkgdown after 2.0.9 release) I opened,
init_site()
was the main friction point left for me, as I don't like calling it (I find it long to run, and I am never sure if it really has to do all the things it does, what it overwrites andOverall, it is just not clear to me when you have to build everything from scratch, and when things are fine and you can preview your site, and it will show your recent additions.
I ended up calling unlink("docs/", recursive = TRUE) way too many times, as I didn't know