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
| { outputPath: "./build/index.html" } | |
| { outputPath: "./build/about/index.html" } |
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
| /* Step 4: Build pages into .html files with appropriate paths */ | |
| for (const page of pages) { | |
| const { path } = page; | |
| let outputPath: string; | |
| if (path === HOME_PATH) { | |
| outputPath = `${buildPath}/index.html`; | |
| } else { | |
| outputPath = `${buildPath}${path}/index.html`; |
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
| /* Step 3: Generate templates for html content */ | |
| const isHomePath = (path: string) => path === HOME_PATH; | |
| const getStylesheetHref = (path: string) => { | |
| return isHomePath(path) ? STYLESHEET_PATH : `../${STYLESHEET_PATH}`; | |
| } | |
| const getFaviconSvg = (favicon: string) => ` | |
| <svg xmlns="http://www.w3.org/2000/svg"> | |
| <text y="32" font-size="32">${favicon ? favicon : '🦕'}</text> |
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
| const getHtmlByPage = ({ path, name, html }: Page) => ` | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>${name} | ${title}</title> | |
| <link rel="stylesheet" href="${getStylesheetHref(path)}"> | |
| <link rel="icon" href="/favicon.svg"> | |
| </head> | |
| <body> | |
| <div id="title"> |
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
| /* Step 3: Generate templates for html content */ | |
| const isHomePath = (path: string) => path === HOME_PATH; | |
| const getStylesheetHref = (path: string) => { | |
| return isHomePath(path) ? STYLESHEET_PATH : `../${STYLESHEET_PATH}`; | |
| } | |
| const getFaviconSvg = (favicon: string) => ` | |
| <svg xmlns="http://www.w3.org/2000/svg"> | |
| <text y="32" font-size="32">${favicon ? favicon : '🦕'}</text> |
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
| /* Step 3: Generate templates for html content */ | |
| const isHomePath = (path: string) => path === HOME_PATH; | |
| const getStylesheetHref = (path: string) => { | |
| return isHomePath(path) ? STYLESHEET_PATH : `../${STYLESHEET_PATH}`; | |
| } | |
| const getFaviconSvg = (favicon: string) => ` | |
| <svg xmlns="http://www.w3.org/2000/svg"> | |
| <text y="32" font-size="32">${favicon ? favicon : '🦕'}</text> |
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
| /* Step 3: Generate templates for html content */ | |
| const isHomePath = (path: string) => path === HOME_PATH; | |
| const getStylesheetHref = (path: string) => { | |
| return isHomePath(path) ? STYLESHEET_PATH : `../${STYLESHEET_PATH}`; | |
| } |