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

Docs: adds Docusaurus site #2174

Merged
merged 26 commits into from
Jul 31, 2024
Merged

Docs: adds Docusaurus site #2174

merged 26 commits into from
Jul 31, 2024

Conversation

lukegalbraithrussell
Copy link
Contributor

@lukegalbraithrussell lukegalbraithrussell commented Jul 25, 2024

Summary:

This is the new Docusaurus site. Tested that it builds properly. (You can confirm by looking at the Test Deployment test below.) Is that a bad test name? Writing that sentence makes it seem so.

This is less absurdly large then it looks! ~16,000 of the changed lines are package-lock.json 😬 . 84 of the changed files are the same markdown files re-formatted and moved. (I did a comical amount of git mv so all history is still intact). And I deleted about 30 files.

Folder and file organization

This shares the same structure as the other sites. At large:

docs/
├── content/ (the good stuff. md and mdx files supported)
│   ├── getting-started.md
│   └── concepts
│       └── sending-message.md
├── i18n/ja/ (the japanese translations)
│   ├──docusaurus-theme-classic/ (footer/navbar translations)
│   └──docusaurus-plugin-content-docs/
│       └── current/ (this folder's file names need to exactly match **/content/, but japanese content)
│           ├── getting-started.md
│           └── concepts
│               └── sending-message.md
├── static/
│   ├── css/
│   │   └── custom.css (the css for everything!)
│   └── img/ (the pictures for the site)
│       ├── rory.png 
│       └── oslo.svg 
├── src/
│   ├── pages/ (stuff that isn't docs content. This is empty for this repo)
│   └── theme (only contains the 404 page)
├── docusaurus.config.js (main config file. also where to set navbar/footer)
└── redirects.js (a redirects script because the old site used # as pages which docusaurus can't handle)
└── sidebar.js (manually set where the content docs are in the sidebar.)

The default name for my content folder was docs but docs/docs was silly. I am open to other names though.

Docs pages: slugs and links

The organization of pages is purposefully kept as similar to the current layout of pages so developers don't get jarred from both a site change and page changes. Slugs are all named matching that previous organization - i.e. something in the basics or the advanced folder (and others) has the concepts slug: /bolt-js/concepts/authorization. This is slightly different than the previous site, which took the form of /bolt-js/concepts#authorization. They're all separate pages, not headers now. I've written a script to redirect the old concepts#topic to the proper concepts/topic. Any previous working link will properly redirect.

All .md files were renamed (yes, I used git mv) to match the title and the slug. Everything now matches up.

All markdown reference links were also updated to be up-to-date and working. If it's a link on the site, it now works. I also stripped all the pages of any residual HTML or custom formatting. They should all be the most basic of markdown now.

Editing and managing the site

The README contains a basic docs editing guide. You don't need to worry about the site unless you're touching something inside the /docs folder.

There is a new action workflows: it does a test build on docs PRs and deploys the site on merges to main.

Next steps

This wouldn't be a DevRel project without some fast follows. This is what I plan on doing after all the sites are live:

  • Set up action workflow to update this custom.css if the main site's custom.css is changed.
  • Sanitize the GitHub releases notes so the generated changelog can work fully automatically. For now, I'll add it in myself during releases.
  • I recognized some copy directly taken from the API site (about modals, app home, etc). I remember that copy because I deleted all of it on our site and rewrote it lol. Will do the same here. (It'll remove length, promise!)
  • General copy editing (I avoided this the best I could in this PR).
  • Update tutorials with self-updating GitHub code snippet links.
  • Write a little introduction. Right now, / just redirects to /getting-started since that's all this site had.

Requirements

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.07%. Comparing base (59923f5) to head (29b9b99).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2174   +/-   ##
=======================================
  Coverage   82.07%   82.07%           
=======================================
  Files          18       18           
  Lines        1545     1545           
  Branches      443      443           
=======================================
  Hits         1268     1268           
  Misses        179      179           
  Partials       98       98           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lukegalbraithrussell lukegalbraithrussell marked this pull request as ready for review July 29, 2024 19:10
@filmaj filmaj added the docs M-T: Documentation work only label Jul 29, 2024
Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

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

LGTM! Left a few notes/questions but overall looks great!

.github/workflows/deploy-site.yml Outdated Show resolved Hide resolved
.github/workflows/test-site.yml Outdated Show resolved Hide resolved
.github/maintainers_guide.md Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs M-T: Documentation work only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants