Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP1universalStack: universal
templatesscopeshared-layout
Place page-specific markup only on the pages that need it, not a shared template
Adding a feature placeholder to a shared template leaks it onto every page that template renders; scope it to the intended page instead.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codehtml
| 1 | <!-- index.njk is shared by frontpage, authors, latest, ... --> |
| 2 | <!-- FEATURE frontpage-only-widget --><!-- FEATURE_END frontpage-only-widget --> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codehtml
| 1 | <!-- frontpage.njk only --> |
| 2 | <!-- FEATURE frontpage-only-widget --><!-- FEATURE_END frontpage-only-widget --> |
Explanation (EN)
Objašnjenje (HR)