feat: add extend_post_content.html hook partials for post sections#1846
Conversation
|
|
use comments.html? |
|
Thanks for the suggestion! I considered using |
|
it is not about how minimal the change is but about how many extend templates we can add for each template which user is not wiling to override for their own convenience. |
b3e504b to
2a980c8
Compare
…end-single-partials
…dityatelange#1846) Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
…#1) * Add SVG for YesWeHack (adityatelange#1791) * Fix awkward wrapping in post metadata (adityatelange#1790) The previous shared styling applied flex layout to both `.post-meta` and `.breadcrumbs`, causing awkward line breaks in post metadata where separators and reading time would appear at the start of new lines. This change keeps the shared color and font-size styling, but only applies flex layout to `.breadcrumbs`. Post metadata (author, date, reading time) uses the default block flow which handles inline content with separators more naturally. Fixes adityatelange#1789 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com> * Add social icon for Nostr (adityatelange#1694) * Fix extra closing tag in strava in partials/svg (adityatelange#1794) * fix(post_meta): default to localized date formatting (adityatelange#1552) Fixes adityatelange#1611 See Hugo docs: https://gohugo.io/functions/time/format/#localization * update margin properties for consistency in toc and footer * fix(post_content): add margin for improved spacing * fix(post_meta): update i18n_list display style for better alignment * fix(translation_list): wrap translation label in a span for better styling fix(post_meta): add span tags for reading time, word count, and author metadata fix(edit_post): wrap edit link in a span for consistent styling * fix(i18n_list): change display property to inline-flex coz it breaks when there are more than one translations * fix(toc): remove bottom margin for improved layout consistency * fix(entry-cover): remove color property for link to enhance visibility * Add iNaturalist icon to partials/svg (adityatelange#1795) * Add iNaturalist icon to partials/svg * Clean up SVG by removing mask definitions Removed unused mask definitions from SVG for inaturalist icon. --------- Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * add the name of the alt. output format as title (adityatelange#1793) * Added social icon for Unity (adityatelange#1760) * Added social icon for Unity SVG source: https://icons.getbootstrap.com/icons/unity/ * refactor --------- Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * Allow disabling Language Toggle in header (adityatelange#1633) Add `site.Params.disableLangToggle` to disable language switch toggle if set to true. * Revert "Add iNaturalist icon to partials/svg (adityatelange#1795)" (adityatelange#1803) This reverts commit 6bb8198. * Use data-theme attribute for theme switching and set color-scheme (adityatelange#1808) - Update theme toggle and initialization scripts to set data-theme attribute - Replace CSS selectors using .dark class with [data-theme="dark"] and [data-theme="light"] attribute selectors - Set CSS color-scheme variable alongside theme colors for better native control appearance - Removes redundant styles --------- Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * Fix Forced reflow in menu scroll handler A forced reflow occurs when JavaScript queries geometric properties (such as offsetWidth) after styles have been invalidated by a change to the DOM state. This can result in poor performance. https://pagespeed.web.dev/analysis/https-adityatelange-github-io-hugo-PaperMod/n5w29pnr5o?form_factor=mobile * Refactor theme decision logic into head.html for faster script execution. * Fix defaultTheme selection as we are using data-theme attribute Refactor code for selecting class for body as list * Update catalan i18n file with additional data (adityatelange#1813) * Update LICENSE Add current year 2026 * Add support for llms.txt The llms.txt file is an industry standard that helps LLMs index content more efficiently hugo.yml => ```yml outputFormats: llms: mediaType: "text/plain" baseName: "llms" isPlainText: true notAlternative: true outputs: home: - HTML - RSS - JSON - llms ``` * [PATCH] tpl/tplimpl: Improve embedded templates - Do not include the Hugo version in RSS feeds from gohugoio/hugo@10a8448 * [PATCH] tpl: Remove RSS deprecation site.Author check The check itself creates a warning which I guess was not intended. We could possibly make that work, but it has been deprecated since Hugo 0.98, so just remove the usage. from gohugoio/hugo@e07028c * [PATCH] tpl/tplimpl: Improve locale value in opengraph.html from gohugoio/hugo@87ab7f7 * [PATCH] tpl/tplimpl: Plainify title and description in twitter_cards.html from gohugoio/hugo@74ab839 * [PATCH] tpl/tplimpl: Trim descriptions rather than just chomp from gohugoio/hugo@0398458 * Move permissions from workflow level to job level * Allow certain pages to be excluded from RSS feed (adityatelange#1833) * Allow certain pages to be excluded from RSS feed This line adds support for the possibility to exclude a certain page from the RSS feed by adding a param to the front matter: ``` --- hiddenInRss: true --- ``` --------- Co-authored-by: Gerrit Beine <mail@gerritbeine.com> Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * Update font size for h2 in first-entry header * Add audio and video shortcodes with basic controls; enhance CSS for media elements * Update kofi icon thanks to simpleicons * Refactor SVG paths for improved readability and maintainability * Fix padding for the first social icon in the home info * Move md content styles to a dedicated CSS * Refactor CSS class names from .post-content to .md-content * Add styling for .post-content with color and margin properties * Update home_info layout to use md-content class for entry content; adjust styles for improved consistency * Refactor entry content rendering in home_info to use RenderString with display options * Update PR template to clarify issue linking instructions * Add GitHub Actions workflow for build checks * Add workflow_dispatch input for Hugo version in build-check workflow * Refactor README.md for clarity and organization; update features section and improve formatting * Update README.md and adjust shield labels and resource table layout * Remove scrollbar styles and related conditions from head.html - Deprecates var `site.Params.assets.disableScrollBarStyle` * Remove focus outline 0 from footer and search styles * Update terms.html to use LinkTitle instead of Name * Enhance terms-tags styles for better layout and spacing * Update profile mode styles for improved spacing - Change gap in profile_inner from 10px to 1rem - Adjust button styles for consistent padding * Fix social icon padding in main and post-entry styles * Update footer styles for improved scroll-to-top button - Adjust top-link padding and transition effects - Replace SVG icon with a more detailed chevron design * Update Hugo version default to latest in gh-pages workflow * Update Go version to 1.16 in go.mod * Refactor CSS class names for consistency and clarity - Update selectors from IDs to classes in header, search, and zmedia styles. - Ensure consistent usage of class names across relevant files. * Update theme.toml for homepage and tag consistency - Correct homepage URL - Add missing tags and features * Improve table of contents - Convert the `.toc` class to a `<details>` element - Update styles for improved accessibility and interaction * Refactor top-link visibility and positioning in footer - Update CSS for top-link to use rem units - Modify HTML to include 'hidden' class for initial state - Adjust JavaScript to toggle visibility using class * Adjust scroll threshold for top link visibility * Adjust blockquote styling * style(header): rename .nav to .header-nav for semantic consistency * style(breadcrumbs): update markup to use <nav> for improved semantics and add SVG seperator * style(post-single): adjust margin for post title, description and meta * style(md-content): update margin and border-radius for consistency * style(paginav): improve layout and spacing for navigation links * style(footer, md-content, post-entry, post-single): update link styles for better visibility * style(md-content): adjust code element padding and border-radius * style(entry-cover): enhance layout with border-radius and gap * style(post-single): update link styles for post-meta * style(audio): enhance audio element styling for better presentation * style(footer, md-content, post-entry): increase text-underline-offset for links * style(header): adjust logo-switches visibility based on theme/lang toggle * style(header): enhance logo and theme switch layout for better alignment * fix(header): show language separator only if we have translations * fix(header): correct logic for language and theme toggle visibility * Add eBird social icon svg (adityatelange#1848) * style(header): simplify margin and padding for header navigation * style(md-content): adjust margins and paddings for better spacing * style(list.html): update div class for post content * style(post-entry): add border-radius to entry link for consistency * style(md-content): adjust table padding and border for improved layout * style(md-content): refine link styling and hover effects for consistency * style(post-entry): fix content gap variable for home info section * style(terms.css): adjust gap and border-radius for consistency * style(post-entry): enhance hover effects and transition timing for entries * style(search.css): refine search results styling and hover effects * style(fastsearch.js): improve search result item layout and add icons * style(header.css): enhance active menu item styling with underline effects * ci(workflows): upgrade checkout and configuration actions to latest versions * refactor(fastsearch): improve search initialization and result rendering - refactored search index loading to use async/await for better readability - improved result rendering logic to handle empty results and focus management - added debounce to search input for performance optimization - defined default options for Fuse.js to streamline configuration * Implement new template system added with Hugo v0.146.0 (adityatelange#1858) * feat(layouts): move all files in layouts/_default up to the layouts/ root. * feat(layouts): rename layouts/partials folder to layouts/_partials * feat(layouts): rename layouts/shortcodes folder to layouts/_shortcodes * feat(taxonomy): add new taxonomy layout template A template named taxonomy.html used to be a candidate for both Page kind term and taxonomy, now it’s only considered for taxonomy. * refactor(breadcrumbs): simplify breadcrumb generation using ancestors method * style(breadcrumbs): add additional chevron icon for breadcrumb navigation * style(author): adjust indentation for better readability * style(header): add separator styling for nav * style(header): reduce icon size for theme toggle buttons * style(anchored_headings): refactor for better readability * refactor(edit_post): improve edit post URL handling and readability * docs(footer): update credit message for Hugo and PaperMod in footer * style(post_meta): adjust indentation for better readability * style(translation_list): improve indentation and use .Param * style(taxonomy): improve indentation for better readability * feat: add extend_post_content.html hook partials for post sections (adityatelange#1846) Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * Reformat resource links in README.md Updated resource links to use a table format for better readability. Signed-off-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * style(post-single): adjust padding for details summary element --------- Signed-off-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Co-authored-by: HitCat <54847071+HiitCat@users.noreply.github.com> Co-authored-by: adam jones <domdomegg+git@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Anthony Accioly <1591739+aaccioly@users.noreply.github.com> Co-authored-by: Mohammad Etemaddar <mohammad.etemaddar@gmail.com> Co-authored-by: David Guillot <david@guillot.me> Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Co-authored-by: Strubbl <97055+Strubbl@users.noreply.github.com> Co-authored-by: Akram El Hadri <admin@toolbuddy.net> Co-authored-by: jamesnulliu <jamesnulliu@gmail.com> Co-authored-by: Huang, Zhaoquan <zhaoquan2008@hotmail.com> Co-authored-by: Javi Mollà <javimollamico@gmail.com> Co-authored-by: Joe Mooring <joe.mooring@veriphor.com> Co-authored-by: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com> Co-authored-by: Gerrit Beine <gbeine@users.noreply.github.com> Co-authored-by: Gerrit Beine <mail@gerritbeine.com> Co-authored-by: Liam Cox <liamcox@tuta.com> Co-authored-by: Minh-Hieu Pham <43398131+henrypham67@users.noreply.github.com>
…#1) * Add SVG for YesWeHack (adityatelange#1791) * Fix awkward wrapping in post metadata (adityatelange#1790) The previous shared styling applied flex layout to both `.post-meta` and `.breadcrumbs`, causing awkward line breaks in post metadata where separators and reading time would appear at the start of new lines. This change keeps the shared color and font-size styling, but only applies flex layout to `.breadcrumbs`. Post metadata (author, date, reading time) uses the default block flow which handles inline content with separators more naturally. Fixes adityatelange#1789 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com> * Add social icon for Nostr (adityatelange#1694) * Fix extra closing tag in strava in partials/svg (adityatelange#1794) * fix(post_meta): default to localized date formatting (adityatelange#1552) Fixes adityatelange#1611 See Hugo docs: https://gohugo.io/functions/time/format/#localization * update margin properties for consistency in toc and footer * fix(post_content): add margin for improved spacing * fix(post_meta): update i18n_list display style for better alignment * fix(translation_list): wrap translation label in a span for better styling fix(post_meta): add span tags for reading time, word count, and author metadata fix(edit_post): wrap edit link in a span for consistent styling * fix(i18n_list): change display property to inline-flex coz it breaks when there are more than one translations * fix(toc): remove bottom margin for improved layout consistency * fix(entry-cover): remove color property for link to enhance visibility * Add iNaturalist icon to partials/svg (adityatelange#1795) * Add iNaturalist icon to partials/svg * Clean up SVG by removing mask definitions Removed unused mask definitions from SVG for inaturalist icon. --------- Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * add the name of the alt. output format as title (adityatelange#1793) * Added social icon for Unity (adityatelange#1760) * Added social icon for Unity SVG source: https://icons.getbootstrap.com/icons/unity/ * refactor --------- Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * Allow disabling Language Toggle in header (adityatelange#1633) Add `site.Params.disableLangToggle` to disable language switch toggle if set to true. * Revert "Add iNaturalist icon to partials/svg (adityatelange#1795)" (adityatelange#1803) This reverts commit 6bb8198. * Use data-theme attribute for theme switching and set color-scheme (adityatelange#1808) - Update theme toggle and initialization scripts to set data-theme attribute - Replace CSS selectors using .dark class with [data-theme="dark"] and [data-theme="light"] attribute selectors - Set CSS color-scheme variable alongside theme colors for better native control appearance - Removes redundant styles --------- Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * Fix Forced reflow in menu scroll handler A forced reflow occurs when JavaScript queries geometric properties (such as offsetWidth) after styles have been invalidated by a change to the DOM state. This can result in poor performance. https://pagespeed.web.dev/analysis/https-adityatelange-github-io-hugo-PaperMod/n5w29pnr5o?form_factor=mobile * Refactor theme decision logic into head.html for faster script execution. * Fix defaultTheme selection as we are using data-theme attribute Refactor code for selecting class for body as list * Update catalan i18n file with additional data (adityatelange#1813) * Update LICENSE Add current year 2026 * Add support for llms.txt The llms.txt file is an industry standard that helps LLMs index content more efficiently hugo.yml => ```yml outputFormats: llms: mediaType: "text/plain" baseName: "llms" isPlainText: true notAlternative: true outputs: home: - HTML - RSS - JSON - llms ``` * [PATCH] tpl/tplimpl: Improve embedded templates - Do not include the Hugo version in RSS feeds from gohugoio/hugo@10a8448 * [PATCH] tpl: Remove RSS deprecation site.Author check The check itself creates a warning which I guess was not intended. We could possibly make that work, but it has been deprecated since Hugo 0.98, so just remove the usage. from gohugoio/hugo@e07028c * [PATCH] tpl/tplimpl: Improve locale value in opengraph.html from gohugoio/hugo@87ab7f7 * [PATCH] tpl/tplimpl: Plainify title and description in twitter_cards.html from gohugoio/hugo@74ab839 * [PATCH] tpl/tplimpl: Trim descriptions rather than just chomp from gohugoio/hugo@0398458 * Move permissions from workflow level to job level * Allow certain pages to be excluded from RSS feed (adityatelange#1833) * Allow certain pages to be excluded from RSS feed This line adds support for the possibility to exclude a certain page from the RSS feed by adding a param to the front matter: ``` --- hiddenInRss: true --- ``` --------- Co-authored-by: Gerrit Beine <mail@gerritbeine.com> Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * Update font size for h2 in first-entry header * Add audio and video shortcodes with basic controls; enhance CSS for media elements * Update kofi icon thanks to simpleicons * Refactor SVG paths for improved readability and maintainability * Fix padding for the first social icon in the home info * Move md content styles to a dedicated CSS * Refactor CSS class names from .post-content to .md-content * Add styling for .post-content with color and margin properties * Update home_info layout to use md-content class for entry content; adjust styles for improved consistency * Refactor entry content rendering in home_info to use RenderString with display options * Update PR template to clarify issue linking instructions * Add GitHub Actions workflow for build checks * Add workflow_dispatch input for Hugo version in build-check workflow * Refactor README.md for clarity and organization; update features section and improve formatting * Update README.md and adjust shield labels and resource table layout * Remove scrollbar styles and related conditions from head.html - Deprecates var `site.Params.assets.disableScrollBarStyle` * Remove focus outline 0 from footer and search styles * Update terms.html to use LinkTitle instead of Name * Enhance terms-tags styles for better layout and spacing * Update profile mode styles for improved spacing - Change gap in profile_inner from 10px to 1rem - Adjust button styles for consistent padding * Fix social icon padding in main and post-entry styles * Update footer styles for improved scroll-to-top button - Adjust top-link padding and transition effects - Replace SVG icon with a more detailed chevron design * Update Hugo version default to latest in gh-pages workflow * Update Go version to 1.16 in go.mod * Refactor CSS class names for consistency and clarity - Update selectors from IDs to classes in header, search, and zmedia styles. - Ensure consistent usage of class names across relevant files. * Update theme.toml for homepage and tag consistency - Correct homepage URL - Add missing tags and features * Improve table of contents - Convert the `.toc` class to a `<details>` element - Update styles for improved accessibility and interaction * Refactor top-link visibility and positioning in footer - Update CSS for top-link to use rem units - Modify HTML to include 'hidden' class for initial state - Adjust JavaScript to toggle visibility using class * Adjust scroll threshold for top link visibility * Adjust blockquote styling * style(header): rename .nav to .header-nav for semantic consistency * style(breadcrumbs): update markup to use <nav> for improved semantics and add SVG seperator * style(post-single): adjust margin for post title, description and meta * style(md-content): update margin and border-radius for consistency * style(paginav): improve layout and spacing for navigation links * style(footer, md-content, post-entry, post-single): update link styles for better visibility * style(md-content): adjust code element padding and border-radius * style(entry-cover): enhance layout with border-radius and gap * style(post-single): update link styles for post-meta * style(audio): enhance audio element styling for better presentation * style(footer, md-content, post-entry): increase text-underline-offset for links * style(header): adjust logo-switches visibility based on theme/lang toggle * style(header): enhance logo and theme switch layout for better alignment * fix(header): show language separator only if we have translations * fix(header): correct logic for language and theme toggle visibility * Add eBird social icon svg (adityatelange#1848) * style(header): simplify margin and padding for header navigation * style(md-content): adjust margins and paddings for better spacing * style(list.html): update div class for post content * style(post-entry): add border-radius to entry link for consistency * style(md-content): adjust table padding and border for improved layout * style(md-content): refine link styling and hover effects for consistency * style(post-entry): fix content gap variable for home info section * style(terms.css): adjust gap and border-radius for consistency * style(post-entry): enhance hover effects and transition timing for entries * style(search.css): refine search results styling and hover effects * style(fastsearch.js): improve search result item layout and add icons * style(header.css): enhance active menu item styling with underline effects * ci(workflows): upgrade checkout and configuration actions to latest versions * refactor(fastsearch): improve search initialization and result rendering - refactored search index loading to use async/await for better readability - improved result rendering logic to handle empty results and focus management - added debounce to search input for performance optimization - defined default options for Fuse.js to streamline configuration * Implement new template system added with Hugo v0.146.0 (adityatelange#1858) * feat(layouts): move all files in layouts/_default up to the layouts/ root. * feat(layouts): rename layouts/partials folder to layouts/_partials * feat(layouts): rename layouts/shortcodes folder to layouts/_shortcodes * feat(taxonomy): add new taxonomy layout template A template named taxonomy.html used to be a candidate for both Page kind term and taxonomy, now it’s only considered for taxonomy. * refactor(breadcrumbs): simplify breadcrumb generation using ancestors method * style(breadcrumbs): add additional chevron icon for breadcrumb navigation * style(author): adjust indentation for better readability * style(header): add separator styling for nav * style(header): reduce icon size for theme toggle buttons * style(anchored_headings): refactor for better readability * refactor(edit_post): improve edit post URL handling and readability * docs(footer): update credit message for Hugo and PaperMod in footer * style(post_meta): adjust indentation for better readability * style(translation_list): improve indentation and use .Param * style(taxonomy): improve indentation for better readability * feat: add extend_post_content.html hook partials for post sections (adityatelange#1846) Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * Reformat resource links in README.md Updated resource links to use a table format for better readability. Signed-off-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> * style(post-single): adjust padding for details summary element --------- Signed-off-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Co-authored-by: HitCat <54847071+HiitCat@users.noreply.github.com> Co-authored-by: adam jones <domdomegg+git@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Anthony Accioly <1591739+aaccioly@users.noreply.github.com> Co-authored-by: Mohammad Etemaddar <mohammad.etemaddar@gmail.com> Co-authored-by: David Guillot <david@guillot.me> Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Co-authored-by: Strubbl <97055+Strubbl@users.noreply.github.com> Co-authored-by: Akram El Hadri <admin@toolbuddy.net> Co-authored-by: jamesnulliu <jamesnulliu@gmail.com> Co-authored-by: Huang, Zhaoquan <zhaoquan2008@hotmail.com> Co-authored-by: Javi Mollà <javimollamico@gmail.com> Co-authored-by: Joe Mooring <joe.mooring@veriphor.com> Co-authored-by: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com> Co-authored-by: Gerrit Beine <gbeine@users.noreply.github.com> Co-authored-by: Gerrit Beine <mail@gerritbeine.com> Co-authored-by: Liam Cox <liamcox@tuta.com> Co-authored-by: Minh-Hieu Pham <43398131+henrypham67@users.noreply.github.com>
…dityatelange#1846) Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>



What does this PR change? What problem does it solve?
Adds an
extend_post_content.htmlhook partial at a key injection point insingle.html, after the post body and before the footer.Currently, injecting custom content into
single.html(e.g., quizzes, flashcard widgets, custom sections after post body) requires copying the entirelayouts/_default/single.htmlinto the project as a full override. This creates an ongoing maintenance burden — every upstream change tosingle.htmlrequires a manual diff and re-merge.This PR adds a single no-op stub partial that users can override in their own
layouts/partials/without touching the base layout:{{- partial "extend_post_content.html" . }}The stub ships empty (comments only), so existing sites are completely unaffected. This follows the same pattern already established by
extend_head.htmlandextend_footer.htmlin PaperMod.Was the change discussed in an issue or in the Discussions before?
Yes. Closes #1845
PR Checklist
Commit quality assessment: The commit is solid — minimal, focused, zero-breaking-changes, and consistent with PaperMod's existing
extend_head.html/extend_footer.htmlpattern. The stub file comments clearly explain the purpose and override mechanism. Good to go.