Pkgdown: Provide way to override title of home page

Created on 9 Jan 2019  Â·  18Comments  Â·  Source: r-lib/pkgdown

Since package title might not always be appropriate (since CRAN might require quoting)

feature front end help wanted wip

All 18 comments

Ah something else I'd like to see implemented! Would it be ok to make it work via a title field of the config?

Then in data_home()

pagetitle = pkg$desc$get("Title")[[1]]

could become

pagetitle = pkg$meta[["title"]] %||% pkg$desc$get("Title")[[1]]

?

If so I can make a PR.

Yes, that looks like the right change. Can you make a PR?

Will do, will just wait for my other PR to be merged in order to have learned lessons and not make the same mistakes twice! :-)

This has to be re-opened cf https://github.com/r-lib/pkgdown/pull/1005#issuecomment-492178755: my implementation used a param name that was already used for something else, so I've opened a PR removing my changes as requested by @jayhesselberth.

I suggest we make it a subcomponent of home:

home:
  title: "This is my package title"

So there would be a "general" title and a title under home, correct?

@maelle do you want to take another stab at this?

Yes exactly (sorry for out of order reply)

Yep, will try to next week!

Btw would a similar parameter for "og:description" make sense? The Description field from DESCRIPTION also contains quotes.

I mean tweaking

opengraph = list(description = pkg$desc$get("Description")[[1]])

into

opengraph = list(description = pkg$meta$home[["description"]] %||% pkg$desc$get("Description")[[1]])

I can open a separate issue (or add that to my open PR) if of interest.

Is that used on every page or just the home page?

Great — please wrap that up into your PR too.

Would it be too extreme for pkgdown to unquote all quoted words of Title and Description (uncranify them) by default? Only for the ' quotes. Users might still want to use the home fields in config for more customization (or to requote words). 🤔

Oh yes, that's a good idea!

In a separate PR or the same?

I think it can be in the same PR since it's going to touch the same code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nschiett picture nschiett  Â·  6Comments

espinielli picture espinielli  Â·  3Comments

GegznaV picture GegznaV  Â·  9Comments

ycphs picture ycphs  Â·  6Comments

maelle picture maelle  Â·  6Comments