Add meta description and squish content
- Adds a
<meta name="description">tag to the generated HTML (with the same content as the<meta property="og:description">tag) which pleases Lighthouse. - Normalizes whitespace chars within content extracted from the DESCRIPTION file fields (like
TitleandDescription).
Do you want to finish this one off next? It'll need a rebase/merge to begin.
And worth checking if https://github.com/r-lib/desc/blob/master/NEWS.md#breaking-change resolves the squishing issue.
And worth checking if https://github.com/r-lib/desc/blob/master/NEWS.md#breaking-change resolves the squishing issue.
Yeah, it does (I've submitted that PR :smile: ). So it would be ok to require desc >= 1.4.0 in DESCRIPTION?
@salim-b yup, that'd be fine.
I've replaced all occurences of
desc$get("<NAME>")[[1]]
with
desc$get_field(
key = "<NAME>",
default = NA_character
)
and increased the min. desc pkg version to v1.4.0.
The default = NA_character arg ensures no unintended errors arise in case a "<NAME>" field is unset/missing (same behaviour as for the old desc$get("<NAME>")[[1]]).
It's easier to review code if you keep changes more closely aligned to the purpose of the PR. Here the goal is to improve page descriptions, so I think it would be better to avoid changes not related to that goal.
Ok, I understand. I just wanted to unify pkgdown's internal behaviour by always using desc$get_field() instead of desc$get() to retrieve single DESCRIPTION field values and thought it would really make sense to do it here while we're at it.