404 search + category pillar intros - #75
Merged
Merged
Conversation
Part A: rebuild the 404 page around Pagefind search. New custom template themes/Flex/templates/404.html extends base.html, loads pagefind-ui.css in the meta block and pagefind-ui.js + the external search-init.js in additional_js, and targets the same #search div /search/ uses. Curated recovery links (home, DevSecOps guide, categories, search) replace the old two-link body. No inline scripts or styles (csp_audit clean); page stays hidden/noindex. Part B: allow HTML in category intros (category.html now renders CATEGORY_INTROS with |safe) and expand the three well-populated categories (DevSecOps, Threat Intelligence, Projects) into pillar intros that link key posts with absolute URLs. Single-post categories keep one-line intros.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR bundles two related landing-page improvements. The pillar-intro copy in Part B is a DRAFT for review - see the flag below.
Part A: 404 page rebuilt around Pagefind search
A mistyped URL now lands on a recovery page instead of a two-link dead end.
themes/Flex/templates/404.htmlextendsbase.html, mirroringpagefind_search.html: it loadspagefind-ui.cssin themetablock andpagefind-ui.js+ the externalsearch-init.jsinadditional_js.#searchdiv thatsearch-init.jsinitializes, so the site-wide Pagefind index is reused as-is.articlescontext, so these are intentionally static, not a dynamic recent-posts list.content/pages/404.mdnow setsTemplate: 404. The page staysStatus: hidden, sobase.htmlemitsnoindex, nofollowand it stays out of the sitemap.csp_audit.pypasses.Part B: category pillar intros with links
category.htmlnow rendersCATEGORY_INTROS[...]through the|safefilter (autoescape was turning HTML/links into literal text). Every intro carries its own<p>blocks for consistency.https://rivassec.com/<slug>.htmlURLs (config strings cannot resolve{filename}).<p>.REVIEW FLAG: the pillar-intro copy is a draft. Please check voice and the specific posts linked before merge.
Verification
Built with
pelican content -o output -s publishconf.py. All green:output/404.htmlhas the#searchdiv, references/pagefind/pagefind-ui.jsand/theme/js/search-init.js, carriesnoindex, nofollow, no canonical, and no inline script code.output/category/{devsecops,threat-intelligence,projects}.htmlrender the intros with working<a>links (0 escaped-link occurrences).python3 -m unittest discover tests(38 tests OK).