Hello,
I would like to set up an preview site for my repo https://github.com/jy95/docusaurus-json-schema-plugin for pull requests.
So I took my Github actions “documentation” as an starting base but got this :
Page Not Found. Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.
Downloading my assets throws me a “Error during download”
What can you suggest me to fix that situation ?
For info, reproducible branch is https://github.com/jy95/docusaurus-json-schema-plugin/pull/57
Here are my config files :
# netlify.toml
[build.environment]
NODE_VERSION = "18"
[context.deploy-preview]
command = "npm install netlify-cli@13.2.2 -g && npm install && npm run build && npm link && cd testsite && npm link docusaurus-json-schema-plugin --save && npm install --prefer-dedupe && npm run build && netlify deploy --prod --dir build --auth $NETLIFY_AUTH_TOKEN"
environment = { NETLIFY_SITE_ID = "b99768d3-7f47-4cc9-9ff1-ad23a359dadc" }
docusaurus.config.js :
const path = require("path")
const isDeployPreview = !!process.env.NETLIFY
const baseUrl = isDeployPreview ? "/" : "/docusaurus-json-schema-plugin/"
// With JSDoc @type annotations, IDEs can provide config autocompletion
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: "Docusaurus JSON Schema Plugin",
tagline: "JSON Schema plugin viewer / editor in Docusaurus",
url: "https://jy95.github.io",
baseUrl: baseUrl,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
trailingSlash: false, // Needed for Gh pages - https://github.com/facebook/docusaurus/issues/5026
organizationName: "jy95", // Usually your GitHub org/user name.
projectName: "docusaurus-json-schema-plugin", // Usually your repo name.
themeConfig: {
navbar: {
title: "JSON Schema viewer / editor",
logo: {
alt: "My Site Logo",
src: "img/project_icon.svg",
},
items: [
{
to: "docs/demo/",
activeBasePath: "docs",
label: "Demos",
position: "left",
},
{
to: "playground",
label: "Playground",
position: "left",
},
{
label: "Github",
position: "right",
to: "https://github.com/jy95/docusaurus-json-schema-plugin",
},
],
},
footer: {
style: "dark",
links: [],
copyright: `Copyright © ${new Date().getFullYear()}. Built with Docusaurus.`,
},
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
// https://docusaurus.io/docs/markdown-features/code-blocks#npm2yarn-remark-plugin
remarkPlugins: [
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
],
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
editUrl:
"https://github.com/jy95/docusaurus-json-schema-plugin/tree/main/testsite/",
},
// Optional: disable the blog plugin
blog: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
},
],
],
themes: [["docusaurus-json-schema-plugin", {}]],
// Ugly trick to deal with "Invalid hook"
plugins: [
() => ({
name: "resolve-react",
configureWebpack() {
return {
resolve: {
alias: {
// assuming root node_modules is up
react: path.resolve("../node_modules/react"),
},
},
}
},
}),
],
}
Thanks in advance