Skip to content

fix: add favicon.ico support#477

Open
GulshanJha00 wants to merge 4 commits into
NextCommunity:mainfrom
GulshanJha00:fix-favicon-clean
Open

fix: add favicon.ico support#477
GulshanJha00 wants to merge 4 commits into
NextCommunity:mainfrom
GulshanJha00:fix-favicon-clean

Conversation

@GulshanJha00
Copy link
Copy Markdown
Contributor

Fixes #134

Added favicon.ico support by:

  • adding a root favicon.ico file
  • configuring Eleventy passthrough copy
  • linking the favicon in the document head

This resolves the 404 issue for /favicon.ico.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a favicon to the site by updating the Eleventy configuration to copy the favicon file and adding the corresponding link tag to the index template. Feedback was provided to use the url filter for the favicon path to ensure correct resolution when the site is hosted in a sub-directory.

Comment thread src/index.njk Outdated
@jbampton jbampton self-assigned this May 11, 2026
@jbampton jbampton moved this to In progress in Next May 11, 2026
@jbampton jbampton added this to the Turbo milestone May 11, 2026
@jbampton jbampton requested a review from Copilot May 11, 2026 10:44
@jbampton jbampton moved this from In progress to Review in progress in Next May 11, 2026
@jbampton
Copy link
Copy Markdown
Member

/gemini review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds favicon support to the Eleventy site so /favicon.ico is available and referenced from the HTML head, addressing the reported 404.

Changes:

  • Add a <link rel="icon"> reference in src/index.njk.
  • Configure Eleventy passthrough copy for src/favicon.ico in .eleventy.js.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/index.njk Adds a favicon <link> tag in the page <head>.
.eleventy.js Copies src/favicon.ico to the output via passthrough copy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.njk
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Developer Directory</title>
<link rel="icon" type="image/x-icon" href="{{ '/favicon.ico' | url }}">
Comment thread .eleventy.js
@@ -4,6 +4,7 @@ module.exports = (eleventyConfig) => {
eleventyConfig.addShortcode("currentYear", () => new Date().getFullYear());
// Add this line to copy your external assets
Comment thread .eleventy.js
eleventyConfig.addShortcode("currentYear", () => new Date().getFullYear());
// Add this line to copy your external assets
eleventyConfig.addPassthroughCopy("src/assets");
eleventyConfig.addPassthroughCopy("src/favicon.ico");
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a favicon to the project by configuring Eleventy to copy the asset and adding the corresponding link tag to the main template. The review feedback points out an inconsistency where the new favicon link correctly uses the url filter for subpath deployment portability, but existing stylesheet links do not, which could lead to broken styles in those environments.

Comment thread src/index.njk
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Developer Directory</title>
<link rel="icon" type="image/x-icon" href="{{ '/favicon.ico' | url }}">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The addition of the url filter for the favicon is a good practice for supporting subpath deployments (e.g., GitHub Pages). However, I noticed that the existing stylesheet links on the following lines (11 and 12) do not use this filter. This creates an inconsistency where the favicon might load correctly on a subpath while the CSS fails. For full portability, you should consider applying the url filter to all internal assets in the <head>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Review in progress

Development

Successfully merging this pull request may close these issues.

404 not found for favicon.ico

3 participants