Enable local partial templates that override global template #1897
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.
Fixes #1893 by adding a
src_path
argument tofind_templates()
and passingpkg$src_path
to this argument whereverfind_templates()
is called.Two follow up questions:
Would you like this feature documented anywhere specific? I looked around for a good place but didn't find a good fit — perhaps at the end of Customize - Template Packages?
At this point
find_templates()
requirespkg
for 3 of its arguments. I could refactorfind_templates()
to takepkg
as an argument, likely the first argument in line with other functions in pkgdown. The only downside I see is that we'd end up calculatingtemplates_dir
a few more times than necessary if we calltemplates_dir(pkg)
insidefind_templates()
. I don't think that would have a noticeable impact, though.I'd be happy to add the refactoring to this PR if desired.