Skip to content

Conversation

@funnicus
Copy link
Contributor

@funnicus funnicus commented Jan 23, 2025

Hey!

I've enjoyed the GoTHH stack so far! However, there might be a problem for people who want to expand the template app further in their own projects.

Problem: Relative paths in the stylesheet and script links cause the app to load CSS and JS files from incorrect paths when fetching resources in routes of 2 segments or more (so /a/b/). This leads to CSS and JavaScript not working on those pages. Illustration below (file fetched from /activities and not /).

Screenshot 2025-01-23 at 18 36 06

Suggested fix: Easy fix would be to change the paths from relative to root relative paths. This fixes the problem.

Example:

Change this
<link href="static/css/style.css" rel="stylesheet" type="text/css">
To this
<link href="/static/css/style.css" rel="stylesheet" type="text/css">
Screenshot 2025-01-23 at 18 36 27

@tomanagle tomanagle merged commit be71fd6 into TomDoesTech:main Jan 30, 2025
6 checks passed
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.

2 participants