-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Willy Brauner
committed
Nov 17, 2022
1 parent
7f83490
commit 72ae8d5
Showing
10 changed files
with
65 additions
and
50 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
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
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,21 @@ | ||
/** | ||
* Replace strings | ||
* @param layout | ||
* @param meta | ||
* @param app | ||
* @param ssrStaticProps | ||
* @param globalData | ||
* @return {string} | ||
*/ | ||
export const prepareTemplate = (layout, { meta, app, ssrStaticProps, globalData }) => { | ||
if (!layout) return "" | ||
return layout | ||
.replaceAll(`<!--meta-title-->`, meta?.title ?? "") | ||
.replaceAll(`<!--meta-description-->`, meta?.description ?? "") | ||
.replaceAll(`<!--meta-imageUrl-->`, meta?.imageUrl ?? "") | ||
.replaceAll(`<!--meta-url-->`, meta?.url ?? "") | ||
.replaceAll(`<!--meta-siteName-->`, meta?.siteName ?? "") | ||
.replace(`<!--app-html-->`, app) | ||
.replace(`"<!--ssr-static-props-->"`, JSON.stringify(ssrStaticProps)) | ||
.replace(`"<!--ssr-global-data-->"`, JSON.stringify(globalData)) | ||
} |
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
File renamed without changes.
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