Repository navigation
improve: prefetch next post + KG og fix #421
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🤖 get_repo_knowledge executed:
get_repo_knowledge dominicusin/dominicusin.github.io /tmp/coderabbit-repo-knowledge/dominicusin-dominicusin-github-io-fa795971/conventionsLength of output: 2076
🏁 Script executed:
Repository: dominicusin/dominicusin.github.io
Length of output: 6515
🏁 Script executed:
Repository: dominicusin/dominicusin.github.io
Length of output: 6400
Align the prefetch target with the visible Next link.
When
invertPaginationis enabled, the visible Next link uses.PrevInSection, butlayouts/partials/head.htmlalways prefetches.NextInSection. Apply the same selection logic so the browser prefetches the page used by the visible Next link.🤖 Prompt for AI Agents
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🤖 get_repo_knowledge executed:
get_repo_knowledge dominicusin/dominicusin.github.io /tmp/coderabbit-repo-knowledge/dominicusin-dominicusin-github-io-fa795971/conventionsLength of output: 2076
🏁 Script executed:
Repository: dominicusin/dominicusin.github.io
Length of output: 3249
🌐 Web query:
WHATWG HTML link element rel prefetch as attribute permitted💡 Result:
The use of the
asattribute with<link rel="prefetch">is generally discouraged and should not be used, even though it is technically permitted as an optional attribute in some older resource hint specifications [1][2]. According to modern documentation and developer best practices, theasattribute is explicitly required forrel="preload"and may be used withrel="modulepreload", but it should not be set for other types of link elements, includingrel="prefetch"[3][4]. While the W3C "Resource Hints" specification (which is often superseded by or integrated into the HTML Standard) once identified theasattribute as optional forprefetchlinks [1][2], the current WHATWG HTML Standard and developer guides like MDN emphasize that the attribute's function is specific topreloadandmodulepreloadfor request matching, Content Security Policy (CSP) application, and setting correctAcceptheaders [3][4]. Usingasonrel="prefetch"does not provide the same benefits and is contrary to standard usage patterns [3][4].Citations:
🌐 Web query:
site:html.spec.whatwg.org "as attribute" "prefetch" link💡 Result:
In HTML, the as attribute is not used with the prefetch link type. The as attribute is specifically required for the preload link type to inform the browser about the type of resource being loaded, allowing it to prioritize the request appropriately [1][2][3]. While both prefetch and preload are used to fetch resources ahead of time, they have distinct purposes and technical requirements: 1. Prefetch (rel="prefetch"): Used to preemptively fetch resources that the user is likely to need for a future navigation [1][2]. Because the browser determines the priority of these resources based on its own internal heuristics, the as attribute is not used with prefetch [1][2]. 2. Preload (rel="preload"): Used to preemptively fetch resources that are necessary for the current page load. The as attribute is mandatory for preload to specify the destination (e.g., script, style, image, font), which enables the browser to set the correct request priority and enforce content security policies [1][2][3]. If you mistakenly include an as attribute on a link element with rel="prefetch", it will typically have no functional effect on the prefetch behavior, as the attribute is defined only for the preload and modulepreload link types [3].
Citations:
Remove
as="document"from therel="prefetch"link.The HTML standard defines
asforpreloadandmodulepreload, not forprefetch.rel="prefetch"is sufficient for this document prefetch.🤖 Prompt for 6F2F AI Agents