-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add script to copy homepage into website dir #3295
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
<ul> | ||
<li><fast-anchor appearance="lightweight" href="https://explore.fast.design">Components</fast-anchor></li> | ||
<li><fast-anchor appearance="lightweight" href="#">Integration</fast-anchor></li> | ||
<li><fast-anchor appearance="lightweight" href="https://www.fast.design/docs/en/contributing/install">Documentation</fast-anchor></li> | ||
<li><fast-anchor appearance="lightweight" href="/docs/fast-foundation/getting-started">Documentation</fast-anchor></li> | ||
<li><fast-anchor appearance="lightweight" href="https://discord.gg/FcSNfg4">Community</fast-anchor></li> | ||
</ul> | ||
<fast-anchor class="github-link" slot="end" appearance="lightweight" href="https://github.com/microsoft/fast-dna/"> | ||
|
@@ -45,7 +45,7 @@ | |
<fast-badge slot="badge" class="section-badge">ADAPTIVE UI SYSTEM, UTILITIES, & TOOLS</fast-badge> | ||
<h1 class="section-heading-hero">The adaptive interface system for modern web experiences</h1> | ||
<p slot="body">Interfaces bult with FAST adapt to your design system and can be used with any modern UI Framework by leveraging industry standard Web Components.</p> | ||
<fast-button slot="action" appearance="accent">Get started</fast-button> | ||
<fast-button slot="action" appearance="accent" href="/docs/fast-foundation/getting-started">Get started</fast-button> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this one makes sense to have direct to the getting started, but the one above should probably go to the docs intro. Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll have another PR to cover the rest of the page's links. |
||
</site-section-header> | ||
</div> | ||
</section> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
|
||
const appDir = path.resolve(__dirname, "./src/app"); | ||
const publicDir = path.resolve(__dirname, "./src/public"); | ||
const outDir = path.resolve(__dirname, "./www"); | ||
|
||
module.exports = { | ||
entry: { | ||
|
@@ -16,8 +15,8 @@ module.exports = { | |
resolve: { | ||
extensions: [".svg", ".ts", ".tsx", ".js"], | ||
alias: { | ||
svg: path.resolve(__dirname, "src/app/svg") | ||
} | ||
svg: path.resolve(__dirname, "src/app/svg"), | ||
}, | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
|
@@ -59,19 +58,18 @@ module.exports = { | |
{ | ||
loader: "svg-inline-loader", | ||
options: { | ||
removeSVGTagAttrs: false | ||
} | ||
} | ||
] | ||
} | ||
removeSVGTagAttrs: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new CleanWebpackPlugin(), | ||
new HtmlWebpackPlugin({ | ||
title: "FAST website", | ||
title: "FAST", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you inform more in the title for SEO? "FAST - An adaptive UI design system" for example on the home page or whatever our tagline may be? |
||
template: path.resolve(publicDir, "index.html"), | ||
contentBase: outDir, | ||
}), | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,19 @@ module.exports = { | |
async: true, | ||
}, | ||
], | ||
themes: ["@docusaurus/theme-live-codeblock"], | ||
themes: [require.resolve("@docusaurus/theme-live-codeblock")], | ||
themeConfig: { | ||
navbar: { | ||
logo: { | ||
alt: "FAST-DNA", | ||
src: "img/logo.svg", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good candidate for the CDN |
||
|
||
// FIXME: #3299 Docusaurus displays a blank page when clicking the logo link without workaround | ||
target: "_blank", | ||
...(process.env.NODE_ENV === "production" && { | ||
href: "https://www.fast.design", | ||
target: "_self", | ||
}), | ||
}, | ||
links: [ | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// FIXME: #3298 Merge fast-website and website projects to replace temporary build/copy script | ||
|
||
/* eslint-env node */ | ||
/* eslint-disable @typescript-eslint/typedef */ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
/* eslint-disable @typescript-eslint/explicit-function-return-type */ | ||
const { spawn } = require("child_process"); | ||
const path = require("path"); | ||
const copyfiles = require("copyfiles"); | ||
|
||
const projectPath = path.resolve(__dirname, "../../fast-website"); | ||
const staticPath = path.resolve(__dirname, "../static"); | ||
const indexPath = path.resolve(projectPath, "dist/index.html"); | ||
|
||
const copyConfig = { flat: true, verbose: true, up: true }; | ||
|
||
function copyBundle() { | ||
copyfiles([indexPath, staticPath], copyConfig, () => { | ||
console.log("Copied homepage files to static"); | ||
}); | ||
|
||
copyfiles( | ||
[`${projectPath}/dist/bundle/*`, `${staticPath}/bundle`], | ||
copyConfig, | ||
() => { | ||
console.log("Copied homepage files to static"); | ||
} | ||
); | ||
} | ||
|
||
// Run `yarn build` in the fast-website project | ||
const yarnBuild = spawn("yarn", ["build"], { cwd: projectPath }); | ||
|
||
yarnBuild.stdout.on("data", data => console.log(`stdout: ${data}`)); | ||
yarnBuild.stderr.on("data", data => console.log(`stderr: ${data}`)); | ||
yarnBuild.on("error", error => console.log(`error: ${error.message}`)); | ||
|
||
yarnBuild.on("close", exitCode => { | ||
console.log(`child process exited with code ${exitCode}`); | ||
if (exitCode !== 0) { | ||
process.exit(exitCode); | ||
} | ||
|
||
copyBundle(); | ||
}); |
This file was deleted.
This file was deleted.
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.
Should probably go to
/docs/introduction
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.
Good catch Rob. We'll want everything to be relative so that when they the same files move through the Front Door into staging environment or production the entire site is functional.