Skip to content

Commit fac1d39

Browse files
committed
docs: Fix namespace and deck logic in ContentEngine guide (#9262)
1 parent 2c9d72d commit fac1d39

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

learn/guides/devindex/frontend/ContentEngine.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,17 @@ doLoadStore() {
8484
}
8585
```
8686
87-
The `contentPath` is derived from the current "deck" (documentation set) via the StateProvider:
87+
The `contentPath` is defined centrally in the StateProvider, which tells the `TreeList` where to fetch the JSON from:
8888
8989
```javascript readonly
90-
// Portal.view.learn.MainContainerStateProvider.mjs
91-
case 'deck': {
92-
if (value) {
93-
const folder = value === 'learnneo' ? 'learn/' : `resources/data/deck/${value}/`;
94-
me.data.contentPath = Neo.config.basePath + folder
95-
}
96-
break
90+
// apps/devindex/view/learn/MainContainerStateProvider.mjs
91+
data: {
92+
contentPath: Neo.config.basePath + 'learn/guides/devindex/',
93+
// ...
9794
}
9895
```
9996
100-
This architecture allows Neo.mjs to power multiple documentation sets (like training decks or release notes) using the exact same rendering infrastructure.
97+
By decoupling the path from the component, the rendering engine remains highly reusable. (In fact, the main Neo.mjs Portal app uses this exact same architecture to dynamically serve multiple different "decks" of documentation).
10198
10299
---
103100
@@ -261,7 +258,7 @@ The Content Engine integrates seamlessly with Neo.mjs's hash-based routing syste
261258
The MainContainerController defines route patterns that map URL hashes to handler methods:
262259
263260
```javascript readonly
264-
// Portal.view.learn.MainContainerController.mjs
261+
// apps/devindex/view/learn/MainContainerController.mjs
265262
static config = {
266263
routes: {
267264
'/learn' : 'onRouteDefault',
@@ -313,14 +310,14 @@ async doFetchContent(record) {
313310
The `getContentPath` method constructs the full URL from the record's `id`:
314311
315312
```javascript readonly
316-
// Portal.view.learn.Component.mjs
313+
// apps/devindex/view/learn/Component.mjs
317314
getContentPath(record) {
318315
let path = this.getStateProvider().getData('contentPath');
319-
return path + `${record.id.replaceAll('.', '/')}.md`
316+
return path + `${record.id}.md`
320317
}
321318
```
322319
323-
For example, a record with `id: "guides/fundamentals/WorkerArchitecture"` and `contentPath: "/learn/"` resolves to `/learn/guides/fundamentals/WorkerArchitecture.md`.
320+
For example, a record with `id: "data-factory/Engine"` and `contentPath: ".../learn/guides/devindex/"` resolves to `.../learn/guides/devindex/data-factory/Engine.md`.
324321
325322
---
326323

0 commit comments

Comments
 (0)