-
Notifications
You must be signed in to change notification settings - Fork 9
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
chore: Cleanup setup and base css #27
base: production
Are you sure you want to change the base?
chore: Cleanup setup and base css #27
Conversation
Awesome! Thanks a lot for working on this. I will need some time (a few days) to look at this. In the mean time, I also added some people who are closely involved with the site and might want to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks great, thanks a lot for doing this.
I checked it on desktop and mobile (iPhone Chrome, small screen) and it looks good.
|
||
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/default/default.css" /> | ||
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/default/app.css" /> | ||
<link rel="stylesheet" href="/css/default/default.css"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm not a Hugo expert, so I did a bit of research what's the idiomatic way to reference assets.
{{ .Site.BaseURL }}/foo
is definitely not the idiomatic way, so thanks for fixing it.
I think the idiomatic way is resources.Get + r.RelPermalink, example: https://github.com/luizdepra/hugo-coder/blob/52b14a50f716cb7e69df8d0804f1b68aeec8a08c/layouts/_default/baseof.html#L41
In the short term, it doesn't give us any immediate value. But long-term:
- For JS assets, it makes it very easy to enable minification, if we want.
- For image assets, resizing
- For all asset types, resource integrity
I think it would also make it easier to serve drafts of the site on non-root URLs (eg example.com/foulab-draft/) just by changing a path in a single config file.
what do you think about switching to resources API throughout?
Maybe let's wait for @0x5c to also chime in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it work with a local deployment? A potential developer's workflow could be putting file:///home/user/foulab-dot-org-hugo/public/index.html
into the address bar, as of right now it works pretty well with a slight config override.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried a few things and I'm basically running into different problems every time.
The use of a variable as per the github link just doesn't work at all
{{ $script := resources.Get "js/status.js" }}
<script src="{{ $script.RelPermalink }}"></script>
This gives me an error about nil pointer evaluating resource.Resource.RelPermalink
I found alternatives for Site.BaseURL that will basically give me the same problem it did. There's something wrong in Hugo itself, because BaseURL as well as urls.absUrl just somehow don't work as expected.
So, for example, with the following code:
<link rel="stylesheet" href="{{ absLangURL "css/default/default.css" }}">
<link rel="stylesheet" href="{{ absLangURL "css/default/app.css" }}">
And running hugo serve -p 3000
I get a proper server running on http://localhost:3000
but the HTML in the head just... don't care.
Running with a --baseURL=https://c0c01e372d48.ngrok.app/
for example, seems to work except that it doesn't, it forcefully appends the port to the end:
And without a port specified, letting the default, I just get a default port like https://c0c01e372d48.ngrok.app:62492/
(not sure when it decided to move away from 1313 but it sure did decide this), and I can't really test whether this would work or not since rebinding ngrok to a different port generates a new address so now I'm sort of stuck with an infinite loop of "not working".
All in all, my point here is that Hugo's system is pretty broken, and honestly, the only situation right now where this would matter would be if the baseURL somehow isn't on the root of the domain. BaseURLs really only matter when you're on some subfolder in a more complex configuration or if you're on a share hosting where you can't be on the root.
Basically, getting frustrated over trying to go around Hugo's broken system just to fix a non-problem isn't how I want to spend my days 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it work with a local deployment? A potential developer's workflow could be putting
file:///home/user/foulab-dot-org-hugo/public/index.html
into the address bar, as of right now it works pretty well with a slight config override.
Using file://
to locally develop isn't a thing we do in 2024. There are many, many trivial ways to start a proper thin local web server on a local machine, from using python's SimpleHTTPServer
module, to VSCode's Live Server, to a ton of single-executable light http servers. This is a non-problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
many trivial ways to start a proper thin local web server on a local machine
Most trivially, considering we already have to use that tool to build the site; hugo serve
which does both the site regeneration and serving, with live updates too
It looks though like there might be a bug in hugo or holes in our config/shortcodes; gohugoio/hugo#8896 and related forum thread
<a href="mailto:[email protected]" title="Mailing List"> | ||
<img class="icons" src="/img/eml.png" alt="Link to Mailing List"> | ||
</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still active?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not a question I can personally answer 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's been there since inception of the Hugo version of the site, 6 years ago:
<a href="mailto:[email protected]" title="Mailing List"> |
I don't have any tacit knowledge about this, I don't have admin access to that mailing list, if it even still exists.
So I suggest deleting this. Thanks for checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking on riseup's list server, it seems there's no longer a list with that name. Should be safe to remove
@0x5c should we wait for you to look at this and weigh in; or [if we iron out all the kinks] you don't mind if we merge without your feedback? |
I'm getting to it at the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be best to avoid commiting local editor-specific configs to a public repo.
It will create conflicts for anyone who has to locally edit theirs
For those settings which are relevant to style, using EditorConfig is the normal way to automatically communicate them to editors. It is supported out of the box by numerous editors, including VSCode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be a blocker for merging, but the question of whether or not (and if so, why) shopify is still needed despite having Zeffy now should be raised with the funding/etc people
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall hearing some time ago that the lab was trying to move away from patreon, something about payment problems and unneeded complexity. Same as the Shopify code, shouldn't be a blocker but should be raised with the funding people.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/default/default.css" /> | ||
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/default/app.css" /> | ||
<link rel="stylesheet" href="/css/default/default.css"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
many trivial ways to start a proper thin local web server on a local machine
Most trivially, considering we already have to use that tool to build the site; hugo serve
which does both the site regeneration and serving, with live updates too
It looks though like there might be a bug in hugo or holes in our config/shortcodes; gohugoio/hugo#8896 and related forum thread
|
||
#nav { | ||
width: 150px; | ||
background-color: grey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new background colour makes the nav fail even more on the WCAG contrast guidelines for text
Current: 4.6:1
The PR: 3.94:1
<a href="mailto:[email protected]" title="Mailing List"> | ||
<img class="icons" src="/img/eml.png" alt="Link to Mailing List"> | ||
</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking on riseup's list server, it seems there's no longer a list with that name. Should be safe to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason that the site has two CSS files, both seemingly applied globally? This setup dates from the start of the hugo-based website, but is there anything obvious that would prevent merging them? (should not be a blocker)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, still planning on working on this? |
Context
This PR makes some cleanup in the theme and layout, to start updating the site code to more modern standards.
There's still a lot of problems and downsides to using Hugo, but at least, now we're less based on 1997 standards. Or at least, it's a start.
Preview
Can be viewed on cloudflare.
Screenshot:
Things that were changed: