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

Add SVG favicon. #1230

Merged
merged 1 commit into from
Jun 23, 2020
Merged

Add SVG favicon. #1230

merged 1 commit into from
Jun 23, 2020

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented May 18, 2020

This adds an SVG favicon which inverts on browsers/operating systems that support "dark" media query.

Dark:
image

Light:
image

This doesn't really work on Safari, which has it's own collection of images I'm not in the mood to add. Mostly tested with Firefox and Chrome, Windows and macOS. My Linux system doesn't seem to have a dark/light switch I can easily find.

Closes #1223
Closes #1219

Copy link
Member

@Xanewok Xanewok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks neat, good job!

@@ -415,7 +416,6 @@ fn make_data(
"description".to_owned(),
json!(config.book.description.clone().unwrap_or_default()),
);
data.insert("favicon".to_owned(), json!("favicon.png"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this also somehow be replaced?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In index.hbs I replaced {{ favicon }} with just the literal text favicon.png and favicon.svg. There didn't seem to be a reason to have this because it is a fixed value and is not configurable.

@ehuss ehuss merged commit d4df7e7 into rust-lang:master Jun 23, 2020
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to use favicon.svg? Add a white glow or background on the favicon.
3 participants