-
-
Notifications
You must be signed in to change notification settings - Fork 104
Abstract out site-wide variables into a single include #178
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
Conversation
|
I tested a bunch of pages and it seems to work. Nice! The build time is now around three times as long. That's okay for me. BTW: HTML comments like <!-- Site-wide variables -->appear in the resulting HTML file. So, you could use Liquid comments instead: {% comment %} Site-wide variables {% endcomment %} |
IMHO, liquid comments make the source file too cumbersome to read, since there's no syntax highlighting, and it looks exactly like the actual content when visually scanning the file. Since the HTML comments are harmless, I think it's worth just leaving them in, but I'm open to being convinced otherwise. |
|
After implementing @marmarek's suggested changes regarding the assignment of |
Also, this is yet another reason to minify our output (along with #177). |
|
PipelineRetry |
I can confirm this. Also, I tested some of the non-translated pages and they seem to be good (I'm also not set up to test the translated website). |
Maybe a good compromise would be to rename this file to |
|
@marmarek, I don't see any actual failures in the CI log, yet it says it failed. |
The file contains HTML comments, and all of our other files, even those that are mostly in liquid with just a bit of HTML, have the .html extension.
Ok, the new CI log lists a lot of failures. Looks like something went wrong with the doc index... |
|
I have downloaded the built site (you can do that by clicking "browse" on the right). I'm looking at _site/doc/index.html and I see few issues:
|
|
I have no idea why this is happening. Apparently I handled this merge commit incorrectly, but I have no idea what I should have done differently. |
|
|
|
Maybe it should be outside of that conditional part? It uses |
Ahhh, I see. Thank you.
Ok, sounds good. |
|
Ah, same thing with the team link. Fixing. |
|
Looks like we're all good now! Merging. |
I now see this on the official website. Has this been forgotten or is it intentionally? Shouldn't it be sufficient to include the variables once in I could open a new pull request for that. |
|
Being on the very current commit, I get two build warnings by Jekyll:
So, what is wrong here? Should the mentioned files have other layouts? Or was it wrong to delete the mentioned layouts? |
Oh, wait, I think the mistake is on my side. I didn't check out the correct submodules/commits, I guess. |
I tried it out now and it's a bad idea: Almost everything vanishes. However, it "shows" (in a sense) the snippets that are missing in the data files for translations. |
Not forgotten. Since As I said above, the comments themselves are harmless (#178 (comment)), and it's better to remove them by minifying our output (#178 (comment), QubesOS/qubes-issues#6731). Of course, another option is simply to remove the comments entirely, but I don't think we should uncomment our code just to avoid seeing comments in the unminified output. That would seem perverse. |
BTW, it's not just from |
|
This comment itself is rather harmless. But it shows the |
Right, as I said above (#178 (comment)): Since |
However, as I also mentioned above (#178 (comment)), the actual build time, in practice, has not increased compared to what it was before. |
|
As long as I don't think we need to fix it now. But IMO we will need it one day. Maybe create an issue with low priority? |
Done: QubesOS/qubes-issues#6734 The layout idea is a good one. I will experiment with that. (Update: After a quick test, no dice. Same result as @tokideveloper.) |
|
Maybe we could leave all the includings of {% if architecture == nil or architecture.size == 0 %}
...
{% endif %}It can also be any other variable that is set in |
It works! 🎉 It saves some build time (from 13 sec to 11 sec on my machine) and also the number of actual variable "updates" has been reduced. However, I wonder if I should insert these checks not for the whole thing but for every single variable separately. What do you think? |
I'd go with a single check for all. Less clutter and still should do the job. |
|
Okay, stay tuned for my PR. |
I don't understand. Why does this work? |
Oh, I guess that's precisely the point? |
Exactly. Sometimes, variables which save pages (like
Just to be on the safe side. 🙂 |
Opened: #179 |
Known issues:
variables.liquidis itself still repetitive. I tried aforloop instead of repeating myself but couldn't get it to work.CC: @marmarek, @tokideveloper, @maiska