Skip to content
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

Build new website for documentation #156

Merged
merged 10 commits into from
Feb 27, 2024
Merged

Build new website for documentation #156

merged 10 commits into from
Feb 27, 2024

Conversation

JanMa
Copy link
Member

@JanMa JanMa commented Feb 22, 2024

This PR adds a new website built with Docusaurus in the /website folder.

I have tried to integrate our Markdown docs with the already existing website WIP and was not able to produce anything satisfying. So I had a look at how OpenTofu built their website and it turns out they are using Docusaurus instead of NextJS.

Building upon an example Docusaurus I was able to produce some great results and made a lot of progress in rewriting the documentation. You can see this PR deployed to GitHub Pages from my fork here:
https://janma.github.io/openbao

I decided to leave the default landing page of the example site untouched for this PR, so the main thing that's left to do is to create a proper landing page.

@joewxboy
Copy link
Contributor

This is looking good. I should open another issue for automation that scans the built website looking for broken hyperlinks and orphaned pages. We do something similar with the Open Horizon docs. If you know of similar tools, please let me know.

@JanMa
Copy link
Member Author

JanMa commented Feb 23, 2024

This is looking good. I should open another issue for automation that scans the built website looking for broken hyperlinks and orphaned pages. We do something similar with the Open Horizon docs. If you know of similar tools, please let me know.

During the build process Docusaurus warns you about broken links and anchors. You can also make the build fail if it finds any.

I intentionally disabled this for now since we know there are still some broken links, but we can definitely add some checks in the future once we cleaned that up.

@JanMa JanMa force-pushed the docs-poc branch 2 times, most recently from 0b2938b to 90b3bc6 Compare February 23, 2024 21:54
@cipherboy
Copy link
Member

Hmm, I'm having a little bit of a problem starting the Node server as of 90b3bc6:

[cipherboy@lp10 website]$ make
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated mkdirp@0.3.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

added 1286 packages, and audited 1287 packages in 6s

324 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> website@0.0.0 start
> docusaurus start

[INFO] Starting the development server...

Error: Docusaurus could not load module at path "/home/cipherboy/GitHub/openbao/openbao/website/docusaurus.config.ts"
Cause: Cannot find module '@hashicorp/remark-plugins'
Require stack:
- /home/cipherboy/GitHub/openbao/openbao/website/docusaurus.config.ts
    at loadFreshModule (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/@docusaurus/utils/lib/moduleUtils.js:36:15)
    at loadSiteConfig (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/@docusaurus/core/lib/server/config.js:35:62)
    at async loadContext (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/@docusaurus/core/lib/server/index.js:31:63)
    at async load (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/@docusaurus/core/lib/server/index.js:74:21)
    at async Command.start (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/@docusaurus/core/lib/commands/start.js:44:19) {
  [cause]: Error: Cannot find module '@hashicorp/remark-plugins'
  Require stack:
  - /home/cipherboy/GitHub/openbao/openbao/website/docusaurus.config.ts
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at _resolve (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/jiti/dist/jiti.js:1:251148)
      at jiti (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/jiti/dist/jiti.js:1:253746)
      at /home/cipherboy/GitHub/openbao/openbao/website/docusaurus.config.ts:4:22
      at evalModule (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/jiti/dist/jiti.js:1:256443)
      at jiti (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/jiti/dist/jiti.js:1:254371)
      at loadFreshModule (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/@docusaurus/utils/lib/moduleUtils.js:33:16)
      at loadSiteConfig (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/@docusaurus/core/lib/server/config.js:35:62)
      at async loadContext (/home/cipherboy/GitHub/openbao/openbao/website/node_modules/@docusaurus/core/lib/server/index.js:31:63) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/home/cipherboy/GitHub/openbao/openbao/website/docusaurus.config.ts'
    ]
  }
}

[INFO] Docusaurus version: 3.1.1
Node version: v20.10.0
make: *** [Makefile:6: start] Error 1

Does it need to be included in package.json perhaps?

@JanMa
Copy link
Member Author

JanMa commented Feb 24, 2024

Hmm, I'm having a little bit of a problem starting the Node server as of 90b3bc6:

Weird. I tried a fresh install locally by removing all node modules and it worked. I'll have a look later if I missed something

Copy link
Member

@cipherboy cipherboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, much better! Thank you Jan, this looks great!

Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
Signed-off-by: Jan Martens <jan@martens.eu.org>
@naphelps naphelps merged commit a8c90d2 into openbao:main Feb 27, 2024
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants