-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #558 from o1-labs/feature/tutorial-4-ghpages
Add scripts for GitHub Pages Deployment in Tutorial 4
- Loading branch information
Showing
35 changed files
with
2,868 additions
and
143 deletions.
There are no files selected for viewing
243 changes: 133 additions & 110 deletions
243
examples/zkapps/04-zkapp-browser-ui/contracts/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
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,25 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
// This script modifies the built CSS files and prepends the repo-name to the asset URLs. | ||
// to be compatible with GitHub Pages deployment. | ||
const cssDir = path.join(__dirname, '/out/_next/static/css'); | ||
// Update your repository name here if it is different from the project name. | ||
let repoURL = '04-zkapp-browser-ui'; | ||
const files = fs.readdirSync(cssDir); | ||
|
||
files.forEach((file) => { | ||
if (path.extname(file) === '.css') { | ||
const filePath = path.join(cssDir, file); | ||
|
||
const data = fs.readFileSync(filePath, 'utf8'); | ||
|
||
const singleQuoteRegex = new RegExp(`url\\(\\s*'\\/(?!${repoURL})`, 'g'); | ||
const doubleQuoteRegex = new RegExp(`url\\(\\s*"\\/(?!${repoURL})`, 'g'); | ||
|
||
let result = data.replace(singleQuoteRegex, `url('/${repoURL}/`); | ||
result = result.replace(doubleQuoteRegex, `url("/${repoURL}/`); | ||
|
||
fs.writeFileSync(filePath, result, 'utf8'); | ||
} | ||
}); |
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
Empty file.
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 @@ | ||
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="/04-zkapp-browser-ui/_next/static/css/ad2354abebf7054a.css" as="style"/><link rel="stylesheet" href="/04-zkapp-browser-ui/_next/static/css/ad2354abebf7054a.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/04-zkapp-browser-ui/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/04-zkapp-browser-ui/_next/static/chunks/webpack-683523282bec2506.js" defer=""></script><script src="/04-zkapp-browser-ui/_next/static/chunks/framework-305cb810cde7afac.js" defer=""></script><script src="/04-zkapp-browser-ui/_next/static/chunks/main-15ee87a5f6d80118.js" defer=""></script><script src="/04-zkapp-browser-ui/_next/static/chunks/pages/_app-7e7a1410ed9b0062.js" defer=""></script><script src="/04-zkapp-browser-ui/_next/static/chunks/pages/_error-54de1933a164a1ff.js" defer=""></script><script src="/04-zkapp-browser-ui/_next/static/IbSPwN67V1Yvix1r0yGn1/_buildManifest.js" defer=""></script><script src="/04-zkapp-browser-ui/_next/static/IbSPwN67V1Yvix1r0yGn1/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"IbSPwN67V1Yvix1r0yGn1","assetPrefix":"/04-zkapp-browser-ui","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html> |
1 change: 1 addition & 0 deletions
1
...es/zkapps/04-zkapp-browser-ui/ui/out/_next/static/IbSPwN67V1Yvix1r0yGn1/_buildManifest.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...ples/zkapps/04-zkapp-browser-ui/ui/out/_next/static/IbSPwN67V1Yvix1r0yGn1/_ssgManifest.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 @@ | ||
self.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB(); |
1 change: 1 addition & 0 deletions
1
examples/zkapps/04-zkapp-browser-ui/ui/out/_next/static/chunks/189.07c0688e525e16bd.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
examples/zkapps/04-zkapp-browser-ui/ui/out/_next/static/chunks/542.7802e7ade35d48e9.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
6f40d98
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs2 – ./
docs2-git-main-minadocs.vercel.app
docs2-minadocs.vercel.app
docs.minaprotocol.com