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

Swap updated favicons #502

Merged
merged 6 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
{% include description.html %}
{% include sharing-image.html %}
<link rel="canonical" href="{{ site.url }}{{ site.baseurl }}{{ page.url | replace:'index.html',''}}">
<link rel="shortcut icon" type="image/png" href="{{ site.baseurl }}/assets/images/favicon.png">
<link rel="apple-touch-icon" href="{{ site.baseurl }}/assets/images/apple-touch-icon.png">
<link rel="icon" href="{{ site.baseurl }}/assets/images/favicon.ico" sizes="32x32">
<link rel="icon" href="{{ site.baseurl }}/assets/images/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="{{ site.baseurl }}/assets/images/apple-touch-favicon.png">
<link rel="manifest" href="/manifest.webmanifest">
Copy link
Contributor

Choose a reason for hiding this comment

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

Even though we aren't serving at a subpath, for style I'd recommend including {{ site.baseurl }} here, that is, <link rel="manifest" href="{{ site.baseurl }}/manifest.webmanifest">. Right now, that's just set to "", so when Jekyll builds, the full URL becomes "/manifest.webmanifest", just like you have it. But, if we were to have Github pages serve at a subpath like it does by default (e.g. https://harvard-lil.github.io/website-static), we'd set baseurl to /website-static and when Jekyll builds, this URL would become "/website-static/manifest.webmanifest", and everything would continue to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for spotting this — this was a small oversight I planned to fix before marking this PR as ready for review

<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/main.css?cache-buster=17">
<link rel="alternate" href="{{ site.baseurl }}/blog/feed/" type="application/rss+xml" title="RSS Feed">
{% include custom-css.html %}
Expand Down
Binary file added app/assets/images/apple-touch-favicon.png
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this image includes 20px of padding between the logo and the edge of the container per Evil Martian recommendations for how Apple displays touch icons. But, if we determine this isn't desirable, easy to change.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/images/apple-touch-icon.png
Binary file not shown.
Binary file added app/assets/images/favicon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/favicon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/favicon.ico
Binary file not shown.
Binary file removed app/assets/images/favicon.png
Binary file not shown.
15 changes: 15 additions & 0 deletions app/assets/images/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions app/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "The Library Innovation Lab at Harvard University",
"icons": [
{ "src": "/assets/images/favicon-192.png", "type": "image/png", "sizes": "192x192" },
{ "src": "/assets/images/favicon-512.png", "type": "image/png", "sizes": "512x512" }
]
}
Copy link
Contributor Author

@tinykite tinykite Feb 27, 2024

Choose a reason for hiding this comment

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

Building a PWA manifest is a big topic, so this isn't intended to be comprehensive for all what we would need to support an offline mode (and specifically to branding, for example, would we want to specify a maskable icon?). This is the minimum that Evil Martians recommends, so it felt like an easy add that we could adopt and update with a more comprehensive information in the future.

Edit: After running a Lighthouse test to validate these icons, I decided we should support maskable icons. More details in the PR description above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same, I'd recommend adding {{ site.baseurl }} to these paths too. If you add

---
---

to the top of the file, Jekyll will make the substitution during build :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for spotting this. As a quick heads-up, I'm still working on polishing this — it's not yet ready for review

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also appreciate the heads-up about Jekyll's substitution process!

Loading