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

Migrate Mintlify to Docusaurus #586

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

blakehatch
Copy link
Member

@blakehatch blakehatch commented Dec 31, 2023

Description

Migrate over NativeLink Docs to Docusaurus.

Fixes #542

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Will need to migrate deployment to our own Vercel org from the Mintlify dashboard

How Has This Been Tested?

Please also list any relevant details for your test configuration

Checklist

  • Updated documentation if needed
  • Tests added/amended
  • bazel test //... passes locally
  • PR is contained in a single commit, using git amend see some docs

This change is Reviewable

@blakehatch
Copy link
Member Author

@MarcusSorealheis I recommend taking a look at the built-in blog system that Docusaurus has it's pretty cool if you'd prefer to have it hosted on our own site instead of externally.

Copy link
Member

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

Oh damn this looks so good!

Apart from the comments, a few more things:

  • When I start this I get a 404 on the homepage. Clicking on the Docs button then brings me to the correct pages. This might just be because it's the development server, but it seems likely that this is an actual bug.
  • I tested this with bun which seems to work out of the box with bun install and bun start. The bun installation is ~27x faster (2sec vs 55sec) than the yarn installation, so we should probably use that instead 🚀
  • We should add pkgs.bun (or pkgs.yarn, if bun turns out to be bugged after all) to the flake here:
    pkgs.cilium-cli

I think a bunch of the template files need to be removed or adjusted, but this seems to be much better.

I'm noticing that we now use .md instead of .mdx for the documentation files. Is it still correct to have the sections like

---
some info
---

in there?

Reviewed 38 of 38 files at r1, all commit messages.
Reviewable status: 0 of 1 LGTMs obtained, and pending CI: Remote / large-ubuntu-22.04, pre-commit-checks


nativelink-docs/docusaurus.config.js line 12 at r1 (raw file):

const config = {
  title: 'NativeLink',
  tagline: 'Dinosaurs are cool',

Is this tagline intentional?


nativelink-docs/docusaurus.config.js line 18 at r1 (raw file):

  url: 'https://docs.nativelink.dev',
  // Set the /<baseUrl>/ pathname under which your site is served
  // For GitHub pages deployment, it is often '/<projectName>/'

Let's remove all comments that "explain" how to configure docusaurus.


nativelink-docs/blog/2019-05-28-first-blog-post.md line 6 at r1 (raw file):

authors:
  name: Gao Wei
  title: Docusaurus Core Team

Redundant.


nativelink-docs/blog/2019-05-29-long-blog-post.md line 8 at r1 (raw file):

---

This is the summary of a very long blog post,

ditto


nativelink-docs/blog/2021-08-01-mdx-blog-post.mdx line 1 at r1 (raw file):

---

ditto


nativelink-docs/blog/authors.yml line 1 at r1 (raw file):

endi:

We'll need to figure out what to put here.


nativelink-docs/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg line 0 at r1 (raw file):
redundant?


nativelink-docs/blog/2021-08-26-welcome/index.md line 1 at r1 (raw file):

---

ditto


nativelink-docs/src/components/HomepageFeatures/index.js line 7 at r1 (raw file):

const FeatureList = [
  {
    title: 'Easy to Use',

This needs to be adjusted to our information.


nativelink-docs/src/pages/markdown-page.md line 1 at r1 (raw file):

---

redundant?


nativelink-docs/static/img/docusaurus.png line 0 at r1 (raw file):
redundant?


nativelink-docs/static/img/docusaurus-social-card.jpg line 0 at r1 (raw file):
redundant?


nativelink-docs/static/img/favicon.ico line 0 at r1 (raw file):
Is this our icon?


nativelink-docs/static/img/logo.svg line 0 at r1 (raw file):
Is this our icon?


nativelink-docs/static/img/undraw_docusaurus_mountain.svg line 1 at r1 (raw file):

<svg xmlns="http://www.w3.org/2000/svg" width="1088" height="687.962" viewBox="0 0 1088 687.962">

redundant?


nativelink-docs/static/img/undraw_docusaurus_react.svg line 1 at r1 (raw file):

<svg xmlns="http://www.w3.org/2000/svg" width="1041.277" height="554.141" viewBox="0 0 1041.277 554.141">

redundant?


nativelink-docs/static/img/undraw_docusaurus_tree.svg line 1 at r1 (raw file):

<svg xmlns="http://www.w3.org/2000/svg" width="1129" height="663" viewBox="0 0 1129 663">

redundant?


nativelink-docs/docs/About.mdx line 22 at r1 (raw file):

Supports Unix-based operating systems and Windows.

## 🎯 Goals

fyi: I think for the initial migration it's fine to leave this. We can "fix" any content-related changes in subsequent commits.

Copy link
Member Author

@blakehatch blakehatch left a comment

Choose a reason for hiding this comment

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

  1. I was rerouting to Quickstart manually in index.js which is how you configured a subdomain for docs before but they have a new cleaner solution I migrated to however I broke the base route. It had a clean solution just by adding "Slug: /" to the header comment to have the base path direct to it.
  2. I agree this should easily work with bun since it's a simple static site, updated the README to recommend bun.
  3. Updated the flake.
  4. We can either use md or mdx, however mdx is a superset of md so I converted all of them to mdx for consistency sake and to avoid confusion if future devs (most likely future me lol) gets confused why mdx features aren't working for certain files.

Reviewable status: 0 of 1 LGTMs obtained, and pending CI: Remote / large-ubuntu-22.04, pre-commit-checks


nativelink-docs/docusaurus.config.js line 12 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

Is this tagline intentional?

No this was a default left in, change.


nativelink-docs/docusaurus.config.js line 18 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

Let's remove all comments that "explain" how to configure docusaurus.

Done.


nativelink-docs/blog/2019-05-28-first-blog-post.md line 6 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

Redundant.

Removed blog directory entirely as we're keeping external for now


nativelink-docs/blog/2019-05-29-long-blog-post.md line 8 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

ditto

Removed blog directory entirely as we're keeping external for now


nativelink-docs/blog/2021-08-01-mdx-blog-post.mdx line 1 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

ditto

Removed blog directory entirely as we're keeping external for now


nativelink-docs/blog/authors.yml line 1 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

We'll need to figure out what to put here.

Removed blog directory entirely as we're keeping external for now


nativelink-docs/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg line at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

redundant?

Removed blog directory entirely as we're keeping external for now


nativelink-docs/blog/2021-08-26-welcome/index.md line 1 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

ditto

Removed blog directory entirely as we're keeping external for now


nativelink-docs/src/components/HomepageFeatures/index.js line 7 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

This needs to be adjusted to our information.

Removed directory as we're not using Docusaurus for the marketing page.


nativelink-docs/src/pages/markdown-page.md line 1 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

redundant?

Removed pages as we're not adding any routing other than to docs.


nativelink-docs/static/img/docusaurus.png line at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

redundant?

Removed as not needed.


nativelink-docs/static/img/docusaurus-social-card.jpg line at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

redundant?

Removed as not needed.


nativelink-docs/static/img/favicon.ico line at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

Is this our icon?

No replaced it with the svg favicon, removed.


nativelink-docs/static/img/logo.svg line at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

Is this our icon?

No, removed.


nativelink-docs/static/img/undraw_docusaurus_mountain.svg line 1 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

redundant?

Removed.


nativelink-docs/static/img/undraw_docusaurus_react.svg line 1 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

redundant?

Removed.


nativelink-docs/static/img/undraw_docusaurus_tree.svg line 1 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

redundant?

Removed.


nativelink-docs/docs/About.mdx line 22 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

fyi: I think for the initial migration it's fine to leave this. We can "fix" any content-related changes in subsequent commits.

Agreed main focus is migrating infrastructure and swapping out DNS quickly/smoothly to self-host the domain.

Copy link
Member Author

@blakehatch blakehatch left a comment

Choose a reason for hiding this comment

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

Unfortunately I double checked and builds were not working correctly with bun so leaving yarn as the recommended package manager for now until I can get building to work.

Reviewable status: 0 of 1 LGTMs obtained, and pending CI: Remote / large-ubuntu-22.04, pre-commit-checks

@blakehatch blakehatch force-pushed the docusaurus-migration branch 2 times, most recently from 205da20 to 8f3d121 Compare January 3, 2024 05:11
Copy link
Member

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 25 of 25 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 1 LGTMs obtained

Copy link
Member

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 1 LGTMs obtained


.gitignore line 15 at r2 (raw file):

result
.bazelrc.user
/node_modules

nit: Since we have the other gitignore in the nativelink-docs directory, is this still needed?


nativelink-docs/package.json line 3 at r2 (raw file):

{
  "name": "my-website",
  "version": "0.0.0",

nit: name field.

nit: Not sure whether this could have implications for "multiple-version-docs". I.e. should this have the same version as nativelink?

@blakehatch blakehatch force-pushed the docusaurus-migration branch 2 times, most recently from b66d774 to 43399cf Compare January 3, 2024 18:42
Copy link
Member Author

@blakehatch blakehatch left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 1 LGTMs obtained


nativelink-docs/package.json line 3 at r2 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

nit: name field.

nit: Not sure whether this could have implications for "multiple-version-docs". I.e. should this have the same version as nativelink?

Seems like the standard for this is to make is as clear as possible to know what's the latest version of the documentation so should probably try to have it mirror the version for nativelink?


.gitignore line 15 at r2 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

nit: Since we have the other gitignore in the nativelink-docs directory, is this still needed?

No, will remove. Having separate gitignores will scale better for the monorepo.

@blakehatch blakehatch force-pushed the docusaurus-migration branch from 43399cf to 063e196 Compare January 4, 2024 07:35
@blakehatch blakehatch merged commit 7247385 into TraceMachina:main Jan 4, 2024
20 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.

Change docs to Docusaurus
2 participants