chocolatey / docs

https://docs.chocolatey.org - new docs website
Apache License 2.0
151 stars 165 forks source link

(#996) (ENGTASKS-3631) Switch to Astro #997

Closed st3phhays closed 3 weeks ago

st3phhays commented 1 month ago

Description Of Changes

This converts all of the previous files that were being generated by Statiq into Astro framework. Now, all documentation is written in .mdx files which are located in the src/content folders. The README.md has been updated to reflect all of these changes and new processes.

Motivation and Context

A move to the Astro framework will:

Testing

There are multiple options to build the site:

  1. Build it on your own computer.
  2. Build it using a Docker container.

Build the Site On Your Computer

Ensure that you have Node v20+ installed by running node -v. There is a .\setup.ps1 file in the root of this repository that uses Chocolatey to install or upgrade Node to the correct version.

After confirming the required Node version, run the following command:

yarn dev

This will compile the site, and bring up a preview on http:localhost:5086. Any changes you make will automatically be hot reloaded.

Build the Site Using a Docker Container

There are two ways to build the site using Docker:

Using the Visual Studio Code Dev Containers Extension

Connect to the Docker Container in Visual Studio Code. This will launch Visual Studio Code and open a terminal that is running inside the Docker Container whose configuration is defined in /.devcontainer/devcontainer.json and /.devcontainer/Dockerfile.

After the Docker Container has finished setup, move to a terminal and run the following:

docker run -p 5086:5086 -v $(pwd):/app chocolatey-docs-container

This will compile the site, and bring up a preview on http:localhost:5086. Any changes you make will automatically be hot reloaded.

Running the Docker Container From the Command Line

From the terminal, run the following:

docker build -t chocolatey-docs-container .

Once this is complete, run the following from the same terminal:

docker run -p 5086:5086 -v $(pwd):/app chocolatey-docs-container

This will compile the site, and bring up a preview on http:localhost:5086. Any changes you make will automatically be hot reloaded.

Change Types Made

Change Checklist

Related Issue

st3phhays commented 1 month ago

This is draft due to a few things:

  1. The PR's for choco-theme and choco-astro will need to be merged first, packages released, and updated here.
  2. Confirm automatically generated docs are correct. There are a few in questions that I've recorded to look into.
  3. Looking into a iFrame component for videos in docs to go along with our <Collpase /> and <Tabs /> components.
  4. Need to clean up some loose ends, possible get ESLint running here.
st3phhays commented 1 month ago

A reason why this might be stuck in "Expected - Waiting for status to be reported" on the checks: https://github.com/orgs/community/discussions/26698#discussioncomment-3252954

st3phhays commented 1 month ago

@gep13 I've added on a GitHub Actions workflow to run Playwright tests. I'm a little unsure whether this should be it's own workflow, or if we should just add in the Playwright bits to the existing Build Pull Request workflow. Is there a need to keep them separate?

st3phhays commented 4 weeks ago

@gep13 I've made the changes suggested and rebased on master, I think this is ready for another look!