-
Notifications
You must be signed in to change notification settings - Fork 547
Global refactor of themes section #2129
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
Open
tblivet
wants to merge
48
commits into
PrestaShop:9.x
Choose a base branch
from
tblivet:feat/themes-refactor
base: 9.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
2f5935c
feat: theme refactor
tblivet c62c10b
feat: add claude context
tblivet 49e1f54
feat: add aliases for redirections
tblivet 76c9d2a
feat: improve claude context
tblivet 58a23d7
fix: 1
tblivet deef5d3
fix: 2
tblivet 2d8c354
fix: 3
tblivet 71fbfbf
fix: 4
tblivet 4f13238
fix: 5
tblivet e511256
fix: 6
tblivet c3cc00c
fix: 7
tblivet d28a6aa
fix: 8
tblivet 1f93c7d
fix: 9
tblivet 242fe30
fix: 10
tblivet 546a22f
fix: 11
tblivet e17802d
fix: 12
tblivet 80bbbbc
fix: 13
tblivet d0b8cd7
fix: 14
tblivet f7db44c
fix: 15
tblivet 5b55559
fix: 16
tblivet 787a52e
fix: 17
tblivet c5790c1
fix: 18
tblivet 5896dbb
fix: 19
tblivet 1fe6186
fix: 20
tblivet c687847
fix: 21
tblivet 512f44f
fix: 22
tblivet bd8410f
fix: 23
tblivet 75fe2da
fix: 24
tblivet 82acafa
fix: 25
tblivet 955ab43
fix: 26
tblivet 061060b
fix: 27
tblivet f3a039c
fix: 28
tblivet 8bafe8e
fix: 29
tblivet d58b5eb
fix: 30
tblivet 1f191bb
fix: 31
tblivet fe5eb33
fix: 32
tblivet f0816c4
fix: 33
tblivet 772a8bd
fix: 34
tblivet 5102e44
fix: 35
tblivet 392119e
fix: 36
tblivet ec4b24f
fix: 37
tblivet d53a6af
fix: 38
tblivet 40a0a97
fix: 39
tblivet ebdefed
fix: 40
tblivet 87b067c
fix: 41
tblivet db00327
fix: 42
tblivet 1abfcc8
feat: unify AI context
tblivet 71beae5
feat: unify AI context
tblivet 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Automatically read the docs architecture guidelines | ||
| read: | ||
| - CONTEXT.md |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # AI Context for PrestaShop Developer Docs | ||
|
|
||
| For all content editing, page creation, or structural decisions in this project, you MUST first read and strictly abide by the rules defined in the `CONTEXT.md` file located at the root of this repository. | ||
|
|
||
| Do not answer or generate content until you have parsed that file. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # AI Context for PrestaShop Developer Docs | ||
|
|
||
| For all content editing, page creation, or structural decisions in this project, you MUST first read and strictly abide by the rules defined in the `CONTEXT.md` file located at the root of this repository. | ||
|
|
||
| Do not answer or generate content until you have parsed that file. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # AI Context for PrestaShop Developer Docs | ||
|
|
||
| For all content editing, page creation, or structural decisions in this project, you MUST first read and strictly abide by the rules defined in the `CONTEXT.md` file located at the root of this repository. | ||
|
|
||
| Do not answer or generate content until you have parsed that file. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| .idea/ | ||
| .claude/ |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # AI Context for PrestaShop Developer Docs | ||
|
|
||
| For all content editing, page creation, or structural decisions in this project, you MUST first read and strictly abide by the rules defined in the `CONTEXT.md` file located at the root of this repository. | ||
|
|
||
| Do not answer or generate content until you have parsed that file. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # AI Context for PrestaShop Developer Docs | ||
|
|
||
| For all content editing, page creation, or structural decisions in this project, you MUST first read and strictly abide by the rules defined in the `CONTEXT.md` file located at the root of this repository. | ||
|
|
||
| Do not answer or generate content until you have parsed that file. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # AI Context for PrestaShop Developer Docs | ||
|
|
||
| For all content editing, page creation, or structural decisions in this project, you MUST first read and strictly abide by the rules defined in the `CONTEXT.md` file located at the root of this repository. | ||
|
|
||
| Do not answer or generate content until you have parsed that file. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # PrestaShop Developer Docs — AI System Context | ||
|
|
||
| ## Project | ||
|
|
||
| Hugo static site. Source is Markdown with YAML front matter. Built with the [Hugo Relearn theme](https://mcshelby.github.io/hugo-theme-relearn/). Deployed at https://devdocs.prestashop-project.org/. | ||
|
|
||
| Each major PrestaShop version has its own branch (`8.x`, `9.x`, …). The `9.x` branch uses `/9/` as the content path prefix. If you are working on another branch, update the version prefix accordingly. | ||
|
|
||
| ## Hugo Conventions | ||
|
|
||
| ### Front matter (required on every page) | ||
|
|
||
| ```yaml | ||
| --- | ||
| title: Page Title # Required. Displayed as heading and in nav. | ||
| menuTitle: Short Title # Optional. Shorter title for the sidebar. | ||
| weight: 10 # Required. Controls ordering (lower = higher). | ||
| chapter: true # Optional. Section landing pages only. | ||
| showOnHomepage: true # Optional. Shows on the docs home page. | ||
| useMermaid: true # Optional. Only when page uses Mermaid diagrams. | ||
| aliases: # Optional. Hugo redirect aliases (see Redirects below). | ||
| - /9/old/path | ||
| --- | ||
| ``` | ||
|
|
||
| ### Shortcodes | ||
|
|
||
| ``` | ||
| {{% notice note %}} → Supplementary information | ||
| {{% notice info %}} → Important contextual information | ||
| {{% notice tip %}} → Best practice or recommendation | ||
| {{% notice warning %}} → Breaking change, deprecation, common pitfall | ||
| {{% children /%}} → Auto-list child pages (section landing pages) | ||
| {{< relref "/9/..." >}} → Internal cross-reference — always use relref, never raw paths | ||
| {{< minver v="9.1" >}} → Minimum version badge | ||
| ``` | ||
|
|
||
| ### Images | ||
|
|
||
| Stored in `img/` relative to the section. From a depth-1 page (e.g. `themes/concepts/page.md`) the path is `../../img/filename.png`. From depth-2 (e.g. `themes/concepts/templates/page.md`) it is `../../../img/filename.png`. | ||
|
|
||
| ### Internal links | ||
|
|
||
| Always use `{{< relref "/9/section/page" >}}`. Never use relative paths. | ||
|
|
||
| ## Redirects | ||
|
|
||
| When a page is moved or renamed, add an `aliases` key to the **new page's** front matter. Hugo generates a redirect HTML file at the old path automatically. | ||
|
|
||
| ```yaml | ||
| aliases: | ||
| - /9/section/old/path/to/page | ||
| ``` | ||
|
|
||
| Multiple aliases are supported as a list. Use the full path from root including `/9/`. | ||
|
|
||
| **Do not remove aliases once added** — external sites and search engines may link to old URLs. | ||
|
|
||
| ## Writing Style & Typography | ||
|
|
||
| - Present tense, active voice, second person ("you"). | ||
| - "must" for requirements, "should" for recommendations, "can" for options. | ||
| - No emojis. No marketing language. No merchant-facing guidance. | ||
| - Lead with the most important information (inverted pyramid). | ||
| - One concept per page when possible. | ||
| - Audience: theme developers and module developers. Not merchants. | ||
| - No em dashes (`—`). Use `:` to introduce an explanation or list, `,` for a mid-sentence aside, and `.` to start a new sentence. Exception: table cells used as empty-value placeholders. | ||
|
|
||
| ## No Duplicate Content | ||
|
|
||
| Each concept must live in exactly one place. If two pages need to cover the same information, the second page links to the first — it does not repeat the content. | ||
|
|
||
| - Do not copy explanations, code examples, or configuration tables across pages | ||
| - Do not summarize a page's content on another page — link to it instead | ||
| - If you find duplicated content during an edit, remove it from the less authoritative page and add a link | ||
|
|
||
| ## Themes Section | ||
|
|
||
| When working inside `themes/`, additional context applies. See `themes/CONTEXT.md` for the themes section map, technology stack rules (Bootstrap 5.3, BEM, Smarty 4, no jQuery, `data-ps-*` attributes), and what not to document. |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # AI Context for PrestaShop Developer Docs — Themes Section | ||
|
|
||
| For all content editing, page creation, or structural decisions inside `themes/`, you MUST first read and strictly abide by the rules defined in the `CONTEXT.md` file located at the root of this repository, then read `themes/CONTEXT.md` for themes-specific rules. | ||
|
|
||
| Do not answer or generate content until you have parsed both files. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Themes Section — AI System Context | ||
|
|
||
| This file is loaded in addition to the root `CONTEXT.md` when working inside `themes/`. | ||
|
|
||
| ## Section map | ||
|
|
||
| | Directory | Purpose | | ||
| |-----------|---------| | ||
| | `getting-started/` | Fast path: requirements, quick start, environment setup | | ||
| | `concepts/` | Generic PrestaShop theme system mechanics (any theme) | | ||
| | `hummingbird/` | Reference theme implementation (self-contained) | | ||
| | `create-a-theme/` | Step-by-step how-to guides | | ||
| | `guidelines/` | Universal rules: coding standards, browser compat, accessibility | | ||
| | `reference/` | Pure lookup tables: template variables, JS events, Smarty helpers | | ||
| | `distribution/` | Validation and export | | ||
|
|
||
| ### concepts/ vs hummingbird/ | ||
|
|
||
| - `concepts/` = mechanics that apply to **any** PrestaShop theme | ||
| - `hummingbird/` = Hummingbird-specific implementation details | ||
| - Cross-reference between the two with "For Hummingbird specifics, see..." / "For how the API works, see..." | ||
|
|
||
| ## Documentation guidelines | ||
|
|
||
| ### Technology stack | ||
|
|
||
| - **Hummingbird** is the reference theme. Always use it as the example implementation. | ||
| - **Bootstrap 5.3**, not Bootstrap 4. Never document BS4 patterns as current. | ||
| - **BEM** naming convention for CSS classes. Do not mention RSCSS. | ||
| - **Smarty 4** template engine. Use `{extends}` / `{block}` inheritance, not `{include}` patterns. | ||
| - **No jQuery** in theme code. jQuery is loaded by `core.js` for module backward compatibility only. New theme code must use vanilla JavaScript. | ||
| - **`data-ps-*` attributes** for JavaScript DOM hooks, not `.js-` prefixed classes. | ||
| - **Web Platform Baseline** as the browser compatibility reference, not fixed version numbers. | ||
| - **Accessibility (EAA / WCAG 2.2 AA)** is a hard requirement, not optional. | ||
|
|
||
| ### What not to document | ||
|
|
||
| - Classic theme directory structure or code examples | ||
| - `_dev/` folder (Classic-specific build artifact) | ||
| - Bourbon, RSCSS, or any deprecated CSS methodology | ||
| - jQuery usage patterns for new code | ||
| - Fixed browser version lists (e.g. "Chrome 90+") | ||
| - PHP coding standards: those belong in core contribution docs | ||
| - PrestaShop 1.6 or 1.7 patterns unless explaining a migration path | ||
| - Merchant-facing guidance: audience is theme and module developers only | ||
|
|
||
| `reference/` pages contain no narrative: pure lookup tables only. All explanatory content belongs in `concepts/` or `hummingbird/`. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| title: Theme concepts | ||
| menuTitle: Concepts | ||
| weight: 10 | ||
| chapter: true | ||
| showOnHomepage: true | ||
| --- | ||
|
|
||
| # Theme concepts | ||
|
|
||
| This section explains how the PrestaShop theme system works. These concepts apply to **any** PrestaShop theme. They are not specific to Hummingbird or any other theme implementation. | ||
|
|
||
| | Page | Description | | ||
| |------|-------------| | ||
| | [Theme structure]({{< relref "/9/themes/concepts/theme-structure" >}}) | Directory layout, `theme.yml` reference, core assets | | ||
| | [Templates]({{< relref "/9/themes/concepts/templates" >}}) | Layouts, inheritance, listing pages, head, notifications | | ||
| | [Asset management]({{< relref "/9/themes/concepts/asset-management" >}}) | CSS/JS registration API, per-page assets, module integration | | ||
| | [Theme hooks]({{< relref "/9/themes/concepts/hooks" >}}) | Extension points for modules in the front office | | ||
| | [Overrides]({{< relref "/9/themes/concepts/overrides" >}}) | Module template/asset overrides and JS selector overrides | | ||
| | [Translation]({{< relref "/9/themes/concepts/translation" >}}) | Internationalization for theme wordings | | ||
| | [RTL support]({{< relref "/9/themes/concepts/rtl" >}}) | Right-to-left language stylesheet handling | | ||
|
|
||
| For Hummingbird-specific architecture and conventions, see the [Hummingbird section]({{< relref "/9/themes/hummingbird" >}}). |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.