-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(engine): reparse html if pageTree requests a second pass
- Loading branch information
Showing
14 changed files
with
140 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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,7 @@ | ||
--- | ||
'@rocket/engine': patch | ||
'@rocket/launch': patch | ||
'@rocket/spark': patch | ||
--- | ||
|
||
Improve title tag handling |
This file contains 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 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 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 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 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
7 changes: 7 additions & 0 deletions
7
packages/engine/test-node/fixtures/05-menu/17-title-tag/docs/index.rocket.js
This file contains 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,7 @@ | ||
/* START - Rocket auto generated - do not touch */ | ||
export const sourceRelativeFilePath = 'index.rocket.js'; | ||
import { layout, html } from './recursive.data.js'; | ||
export { layout, html }; | ||
/* END - Rocket auto generated - do not touch */ | ||
|
||
export default () => html` <h1>Welcome to Rocket</h1> `; |
10 changes: 10 additions & 0 deletions
10
...ges/engine/test-node/fixtures/05-menu/17-title-tag/docs/pageTreeData.rocketGenerated.json
This file contains 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,10 @@ | ||
{ | ||
"title": "Welcome to Rocket | Rocket", | ||
"h1": "Welcome to Rocket", | ||
"name": "Welcome to Rocket", | ||
"menuLinkText": "Welcome to Rocket", | ||
"url": "/", | ||
"outputRelativeFilePath": "index.html", | ||
"sourceRelativeFilePath": "index.rocket.js", | ||
"level": 0 | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/engine/test-node/fixtures/05-menu/17-title-tag/docs/recursive.data.js
This file contains 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,28 @@ | ||
import { PageTree } from '@rocket/engine'; | ||
import { html } from 'lit'; | ||
|
||
const pageTree = new PageTree({ | ||
inputDir: new URL('./', import.meta.url), | ||
outputDir: new URL('../__output', import.meta.url), | ||
}); | ||
|
||
await pageTree.restore(); | ||
|
||
const titleWrapperFn = title => (title ? `${title} | Rocket` : ''); | ||
|
||
export const layout = data => { | ||
const title = titleWrapperFn(pageTree.getPage(data.sourceRelativeFilePath)?.model?.name); | ||
return html` | ||
<html> | ||
<head> | ||
<title-server-only>${title}</title-server-only> | ||
</head> | ||
</html> | ||
<body> | ||
<main>${data.content()}</main> | ||
</body> | ||
</html> | ||
`; | ||
}; | ||
|
||
export { html }; |
This file contains 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 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 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 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 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