-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Build: use partialCached #1951
base: gh-pages
Are you sure you want to change the base?
Build: use partialCached #1951
Conversation
layouts/_default/baseof.html
Outdated
@@ -165,7 +165,7 @@ <h1 data-pagefind-meta="title">About{{ if (isset .Params "subtitle") }} - {{ .Pa | |||
{{ end }} | |||
</div> | |||
</div> | |||
{{ partial "footer.html" . }} | |||
{{ partialCached "footer.html" . }} |
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 believe that this would break the /search
page, as there is a line in footer.html
that is contingent on the current page section.
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.
@dotnetCarpenter could you have a look whether the search
page renders correctly?
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.
@dotnetCarpenter I had a look, and it does not look good:
In my hands, you need this to fix it:
{{ partialCached "footer.html" . }} | |
{{ if eq (.Scratch.Get "section") "search" }} | |
{{ partial "footer.html" . }} | |
{{ else }} | |
{{ partialCached "footer.html" . }} | |
{{ end }} |
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.
@dotnetCarpenter see #1955.
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.
@dscho I'll take a look :)
That is a nice improvement! If we can make it work even with the search page (think: https://git-scm.com/search/results?search=site&language=en), I am all for it! |
537f293
to
e001151
Compare
@dscho it seems that varying by "section" works. That is, create a new cached version for each section. But now I'm not seeing any speed improvement in build time. I think, without any measurable performance boost in build time, this PR only complicates matters and should be closed. I'm extremely new to hugo, so there might be something worth salvaging here but I don't think so. |
+ footer.html + monitor.html This gives a 11% (9 seconds) speedup, when building the site, on my system.
Create a new cached footer for each section set in baseof.html. This makes sure that pagefind/pagefind-ui.js is included if the section is "search".
c248ec5
to
eaeefd7
Compare
All tests pass with #1955 on Kali linux with:
|
I believe that this tests https://git-scm.com/ by default. To test the local site, you need to set |
Right. A much better idea might be to move this line from
Since this is the only conditional code in For what it's worth, I believe that I did things quite sub-optimally with Hugo; It feels as if the proper way would not end up with a huge |
I ran the test with
Perhaps EDITHmm for some reason there are two versions of each result. One with a trailing |
Hmm. The received string seems bogus: If you call <html lang="en">
<head>
<meta charset="utf-8">
<title>Redirecting…</title>
<link rel="canonical" href="https://git-scm.com/docs/git-add/fr">
<meta http-equiv="refresh" content="0; url=https://git-scm.com/docs/git-add/fr">
<meta name="robots" content="noindex">
</head>
<body>
<script>window.location.replace(document.querySelector("link[rel='canonical']").href + window.location.search + window.location.hash)</script>
<h1>Redirecting…</h1>
<a href="https://git-scm.com/docs/git-add/fr">Click here if you are not redirected.</a>
</body>
</html> So why does your Playwright instance not follow that redirect? |
Oh, did you perchance turn off "ugly" URLs? |
How about rebasing on top of |
Changes
Context
This gives a 11% (9 seconds) speedup, when building the site, on my system.