Welcome to the storefront documentation site! To contribute documentation to this site follow the instructions below to install the prerequisites, configure your local environment, create new pages, submit PRs.
Install node and pnpm:
Node.js 20.13.1or later.Pnpm 9.xor later. See the pnpm installation instructions.
-
Clone the GitHub repository:
git clone git@github.com:commerce-docs/microsite-commerce-storefront.git
-
Navigate to the root of your local repository:
cd microsite-commerce-storefront -
Install the dependencies using
pnpm:pnpm install
-
Run the docs site
pnpm dev
The site should open a broswer window at http://localhost:4321/.
The available scripts for running the project are defined in the package.json file:
-
build:prod: Builds the production site with the/developer/commerce/storefrontbase path. -
preview:prod: Previews the production site. -
build: Builds a static, optimized development site without the production base path. -
preview: Previews the static development site. -
dev: Starts the development server and auto-opens the site in the browser. -
lint: Runs prettier formatting on all the project files. -
clean: Removes the dist, .astro, and node_modules directories and reinstalls the dependencies. -
scrub: Does the same as clean but also removes the pnpm-lock.yaml file and the ~./.pnpm-store directory.
pnpm devto start the local dev server and preview your changes during development. Site auto-reloads when you save changes.pnpm lintto batch format all your files with theprettiermodule.pnpm cleanto resolve dependency issues by deleting thenode_modulesanddistdirectories, then reinstalling dependencies.pnpm scrubto remove everything and reinstall dependencies. The nuclear option.
- Fork the repository.
- Create a new branch for your changes.
- Make your changes.
- Push your changes to your fork.
- Create a pull request to the
developbranch of thecommerce-docs/microsite-commerce-storefrontrepository. - Wait for the PR to be reviewed and merged.
-
Create a new
.mdxfile in thesrc/content/docs/<docs-directory>. -
Add the frontmatter to the top of the file. The frontmatter should include the title of the page and the description. The
titlewill render as an<h1>on the page. Thedescriptionwill be used for SEO and social sharing. For example:--- title: Slots description: Learn about slots and how to use them to customize drop-in components. sidebar: label: Awesome Slots! // Overrides the title in the sidebar order: 4 // Use order for auto-generated sidebar links. See src/content/docs/customize files for example. ---
-
Write the content of the page using the markdow/MDX syntax.
-
Add imports for any Astro components you want to use below the frontmatter fence. For example:
--- title: Slots description: Learn about slots and how to use them to customize drop-in components. sidebar: label: Slots order: 4 --- import Diagram from '@components/Diagram.astro'; import Vocabulary from '@components/Vocabulary.astro'; import Aside from '@components/Aside.astro'; import Callouts from '@components/Callouts.astro'; ;