[Blog] - 404 for favicon and JS assets #767
Labels
No Label
administration
Akkoma
Android
Bare metal
bug
Communication
Community
Cryptpad
Discussion
Documentation
duplicate
enhancement
etherpad
Feature request
Feedback
finances
Fixed
forgejo
fun_project
Goal 2024
help wanted
Howto
🤔️ Investigate
ios
jitsi
lacre
Lacre Test
ldap
Lemmy
LibreTranslate
low prio
Lufi
macos
Mail
Merch
monitoring
movim
needs_refine
New Auth
Nextcloud
nice to have
on hold
proposal
question
Ready
refined
Roundcube
searX
spam-protection
Staging Server
Themes
TOR
Urgent!
Website
windows
wontfix
xmpp
Yearly Report
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Disroot/Disroot-Project#767
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After noticing that the blog is missing a favicon I've checked the browser's console and found out that a 404 error was returned for the following assets:
I'm new to Grav, but after checking Vagrantfile and bootstrap.sh I discovered that although the blog uses a distinct theme, these assets are requested from the main theme (
.../themes/disroot/...
instead of.../themes/disrootblog/...
). This is caused by the fact that{{ theme_url }}
variable is most probably returning the relative URL to the main theme, as defined in the Global system configuration file (system.yaml) without taking into account that for blog the theme is set using Themer plugin.Anyway, by using the
theme://
stream as recommended in the Grav Documentation these errors can be fixed.The favicon
As mentioned above, by changing
with
the favicon will be requested from the blog theme (https://disroot.org/user/themes/disrootblog/images/favicon.ico). However, this ico is not Disroot related; it is actually the one included by default in Lingonberry theme.
Of course, the file can be replaced with your favicon.png that is already used for 'disroot' theme.
An alternative quick (but dirty) fix would be to just change the extension from 'ico' to 'png' and this will make the blog request the existing favicon from 'disroot' theme.
From my point of view, the favicon is the kind of asset that should not be linked to a theme but rather included in the Website repository (though, I don't know how it should be according to the Grav way).
Anyway, it's up to you to decide how this should be fixed in the Disroot way.
BTW: I've also found the following nginx alias configuration within the disroot.lan.conf:
I think this is currently wrong.
JS assets
Again, replacing
with
will fix the 404 errors.
However, I don't know if you actually need to load these JavaScript files (since everything seems to work without them, I would assume they are actually not needed).
flexslider.min.js
is only needed for blog posts with slideshow and quickly searching the current sources I did not found such a post; however, the theme do support such a feature.global.js
has some functions related to navigation toggle menu, scroll to the top, video resizing and loads the FlexSlider.PR is ready, thanks a lot @floss4good (as for nginx, we don't use that one on prod)
@meaz, on Tuesday I noticed that a fix for this issue was deployed on prod (and the blog is now having a favicon).
What I also noticed is that the blog's favicon.ico does not look the same as the website's favicon.png. I don't know if this was on purpose or not, so I'm mentioning it here.
Nice. Thanks. I've updated that, it just needs to be approved by team.
Assuming that the mentioned update was pushed through blog theme PR 14, please note that you have updated the
disroot_logo.png
(that is displayed within the header) and not thefavicon.ico
(that is displayed by the web browser as tab icon).The logo from the header was also different, indeed (don't ask me why, but in this case I assumed that it is so by design), but my comment from yesterday was referring to the favicon (again, it was just a remark, I don't know if according to your design the favicon should or should not be the same for both the website and the blog).
Edit:
OK, I see that you created also a PR for website theme in order to update the favicon also there. Sorry for the above.