Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically build favicon once #949

Closed
cboettig opened this issue Dec 24, 2018 · 6 comments · Fixed by #1049
Closed

Automatically build favicon once #949

cboettig opened this issue Dec 24, 2018 · 6 comments · Fixed by #1049

Comments

@cboettig
Copy link

@cboettig cboettig commented Dec 24, 2018

It looks like find_logo() prefers the svg type logo, and using a vector graphic when available makes sense. However, it seems that pkgdown will only create a favicon (and apple-touch icons etc) if I manually supply a logo.png as well. Is this the expected behavior? (i.e. a user ought to provide both svg and png hexes?) Would it be possible to automate the favicon png creation from the svg, or would that be introducing an undesirable dependency load? Apologies if I've overlooked somewhere that already documents all of this!

@hadley
Copy link
Member

@hadley hadley commented Dec 26, 2018

I wonder if we can send a .svg to realfavicongenerator? Otherwise, a PR to do the conversion would be great!

@jayhesselberth
Copy link
Collaborator

@jayhesselberth jayhesselberth commented Dec 26, 2018

Just confirmed that realfavicongenerator will convert SVG files.

@jayhesselberth
Copy link
Collaborator

@jayhesselberth jayhesselberth commented Dec 26, 2018

@cboettig I just confirmed that a logo in man/figures/logo.svg works as-is. Did you get an error when you tried this? Note that created favicons are written to the pkgdown/ directory.

@cboettig
Copy link
Author

@cboettig cboettig commented Dec 28, 2018

Yes, looks like this could have been a user error on my part; build_favicon() does work with just the svg. Minor note, but I think build_favicon() ought to be adding pkgdown/ dir to .Rbuildignore automatically as well?

Looks like build_site() doesn't call build_favicon() by default either, which I think may have confused me. Should it?

jayhesselberth added a commit that referenced this issue Dec 28, 2018
@jayhesselberth
Copy link
Collaborator

@jayhesselberth jayhesselberth commented Dec 28, 2018

I updated the build-ignore suggestions.

build_favicon() only needs to be called once per-site (unless the logo changes) and so probably shouldn't be something build_site() calls every time.

@cboettig
Copy link
Author

@cboettig cboettig commented Dec 28, 2018

Great. Sure we don't want to rebuild the favicon each time, but I wonder if build_site() should have some logic to detect that we have a logo.svg but no pkgdown dir with favicons, and thus can build it the first time automatically? Users might otherwise not discover this cool feature! (e.g. scanning through our recent rOpenSci submissions, many have hex logos but basically none have hexes. Also I only build_site appears on the pkgdown Addin menu in RStudio).

@hadley hadley changed the title favicon from logo.svg? Automatically build favicon once May 17, 2019
@hadley hadley added this to the pkgdown 1.4 milestone May 17, 2019
jayhesselberth added a commit that referenced this issue May 31, 2019
jayhesselberth added a commit that referenced this issue Jun 1, 2019
jayhesselberth added a commit that referenced this issue Jul 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants