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 more info about favicon.ico. #897

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wieczorek1990
Copy link

So basically I am going through the docs and found a problem for novice users.

I am linking the article about Xcode working directory paths for use case when running from Xcode. (here)
I am adding the sample for testing a favicon ready website.

Thanks.

@@ -35,6 +35,35 @@ let fileMiddleware = FileMiddleware(
app.middleware.use(fileMiddleware)
```

If running from Xcode please set the project schema run option working directory.
See [here](https://docs.vapor.codes/getting-started/xcode/#custom-working-directory) for more information.
Copy link
Member

Choose a reason for hiding this comment

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

You need to use an 'local' link to another markdown file, not an absolute link. The current link doesn't work with localization

Copy link
Author

Choose a reason for hiding this comment

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

Addressed in 02e694e.

@wieczorek1990
Copy link
Author

wieczorek1990 commented Sep 4, 2023 via email

@wieczorek1990
Copy link
Author

Need translations.


To see the `favicon.ico` in action prepare a route in `/Sources/App/routes.swift` like this:

```swift
Copy link
Member

Choose a reason for hiding this comment

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

While I agree that the current docs are pretty unhelpful. I think it might be better to change the existing favicon.ico example to be a different type of file.

Copy link
Author

Choose a reason for hiding this comment

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

The favicon.ico icon is always added at some point in a process of building a full-feature website. It think it should stay.

Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

We already have a section on the FileMiddleware so we should just link to that.

I agree however that we should add the note about setting the custom working directory alongside though

@wieczorek1990
Copy link
Author

I moved the favicon sample to advanced/middleware.md.

@Joannis
Copy link
Member

Joannis commented Sep 18, 2023

@0xTim

Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

I'm going to open this up to the community - personally I don't see what the extra example adds to the current image example.

We should however link the mention on FileMiddleware in the folder structure to the FileMiddleware docs page

@Joannis Joannis removed their request for review November 14, 2023 15:11
Comment on lines +38 to +41
If running from Xcode please set the project schema run option working directory.
See [here](xcode.md#custom-working-directory) for more information.


Copy link
Member

Choose a reason for hiding this comment

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

I would present this note like this:

Suggested change
If running from Xcode please set the project schema run option working directory.
See [here](xcode.md#custom-working-directory) for more information.
!!! info
If running from Xcode please set the project schema run option working directory.
See [here](xcode.md#custom-working-directory) for more information.

Copy link
Member

Choose a reason for hiding this comment

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

@wieczorek1990 Also check this. 😉

@alemohamad
Copy link
Member

Personally I don't think that the example code adds much. This can be the same for favicon, styles, javascript, images or any other file saved in the /public folder.

@wieczorek1990
Copy link
Author

wieczorek1990 commented Dec 13, 2024 via email

@alemohamad
Copy link
Member

Every professional modern website has a favicon.

Sure! But I don't think there should be an example of this in the docs.

Maybe another way to raise awareness that there should be one is to provide a default favicon in the base project, instead of adding an example that applies to any file stored in the public folder.

@wieczorek1990
Copy link
Author

wieczorek1990 commented Dec 13, 2024 via email

@alemohamad
Copy link
Member

Maybe we need more separated pages where we explain how to add favicon, CSS, HTML, JS files. People search and they should find recipes when they ask.

I understand what you mean. For this there's the Leaf documentation in the Folder Structure section. Maybe we could name this in that section, but as far as I understand Leaf doesn't have a custom tag to reference resources in the public folder.

What do you think about this approach?

@wieczorek1990
Copy link
Author

wieczorek1990 commented Dec 13, 2024 via email

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

Successfully merging this pull request may close these issues.

5 participants