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

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

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

st3phhays
Copy link
Member

@st3phhays st3phhays commented May 17, 2024

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:

  • Enable faster development and build times
  • Give a great development experience
  • Remove the dependency of .NET and utilize already used dependencies of choco-theme (Node)
  • Give an easy way to use Components inside markdown (.mdx)
  • Provides equivalent and new features
  • Has a large community and is open source

Testing

  • I have previewed these changes using the Docker Container or another method before submitting this pull request.

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

  • Minor documentation fix (typos etc.).
  • Major documentation change (refactoring, reformatting or adding documentation to existing page).
  • New documentation page added.
  • The change I have made should have a video added, and I have raised an issue for this.
    • Issue #

Change Checklist

  • Requires a change to menu structure (top or left-hand side)/
  • Menu structure has been updated

Related Issue

@st3phhays st3phhays self-assigned this May 17, 2024
@st3phhays
Copy link
Member Author

st3phhays commented May 17, 2024

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
Copy link
Member Author

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 st3phhays force-pushed the astro-clean branch 5 times, most recently from 8ddb27a to 14b6df1 Compare May 20, 2024 19:39
@st3phhays st3phhays changed the title (#966) Switch to Astro (#996) Switch to Astro May 21, 2024
@st3phhays st3phhays force-pushed the astro-clean branch 2 times, most recently from 16d094a to 7ce7265 Compare May 21, 2024 18:14
@st3phhays st3phhays force-pushed the astro-clean branch 3 times, most recently from 5877aab to a904a29 Compare June 4, 2024 15:28
@st3phhays st3phhays changed the title (#996) Switch to Astro (#996) Switch to Astro (ENGTASKS-3631) Jun 4, 2024
@st3phhays st3phhays changed the title (#996) Switch to Astro (ENGTASKS-3631) (#996) (ENGTASKS-3631) Switch to Astro Jun 4, 2024
@st3phhays st3phhays force-pushed the astro-clean branch 5 times, most recently from 9293de7 to 2b37ec2 Compare June 6, 2024 12:56
@st3phhays st3phhays requested a review from gep13 June 6, 2024 13:00
@st3phhays st3phhays force-pushed the astro-clean branch 6 times, most recently from 1194969 to 31e6043 Compare June 7, 2024 01:53
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

I have just taken this for a spin, and it looks really good!

I haven't done a side-by-side comparison of each page of the docs, but I have done a couple, and the expected changes to use new way of doing xrefs, callouts, etc. all seem to be in place. I have no reason to think that the other pages won't have the same changes, so I wasn't planning on comparing each page that we have, as there are quite a few 😄

I did notice a small issue where the iframes for videos are not showing up for me, for example on this page:

/en-us/chocolatey-gui/setup/configuration/features/show-console-output

This could be a me problem, so would be good to chat about this when you are online today.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@st3phhays st3phhays force-pushed the astro-clean branch 2 times, most recently from 0e9e1d8 to 5913984 Compare June 11, 2024 17:07
In order to install Astro, we need to remove
everything from the folder and basically "start
from scratch". This allowed Astro to create a new
project with the recommended file structure.
This is the baseline Astro project that was
created by running the recommended commands by
Astro. A few files may have been altered here,
like the .gitignore.
@st3phhays
Copy link
Member Author

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

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.
@st3phhays st3phhays marked this pull request as ready for review June 12, 2024 13:02
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13 gep13 merged commit 01f9f41 into chocolatey:master Jun 12, 2024
1 check passed
st3phhays added a commit to st3phhays/docs that referenced this pull request Jun 13, 2024
The Terms page has been updated to use the correct
Astro Components to render all the content needed.
This was missed on the initial switchover to
Astro.
st3phhays added a commit to st3phhays/docs that referenced this pull request Jun 13, 2024
The changes to the production build configuration
ensure that all urls only contain a slash if they
have other pages nested inside of them.
gep13 added a commit that referenced this pull request Jun 13, 2024
(#997) Update Terms Page to Use Astro
@gep13 gep13 added 5 - Released The issue has been resolved, and released to the public for consumption and removed 3 - Review Code has been added, and is available for review as a pull request labels Jun 13, 2024
st3phhays added a commit to st3phhays/docs that referenced this pull request Jun 13, 2024
The change here ensures the left side navigation
always highlights the active page. This also
makes sure that an expanded navigation item does
not collapse on reload. The trailing slash, or
lack of, has been accounted for now.
@st3phhays st3phhays mentioned this pull request Jun 13, 2024
7 tasks
st3phhays added a commit to st3phhays/docs that referenced this pull request Jun 13, 2024
The change here ensures the left side navigation
always highlights the active page. This also
makes sure that an expanded navigation item does
not collapse on reload. The trailing slash, or
lack of, has been accounted for now.
st3phhays added a commit to st3phhays/docs that referenced this pull request Jun 13, 2024
The change here ensures the left side navigation
always highlights the active page. This also
makes sure that an expanded navigation item does
not collapse on reload. The trailing slash, or
lack of, has been accounted for now.
gep13 added a commit that referenced this pull request Jun 13, 2024
gep13 added a commit that referenced this pull request Jun 14, 2024
(#997) Astro CSS Fixups to Components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released The issue has been resolved, and released to the public for consumption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants