Publish

A standard site offers

  • an out the box, working site, which showcases local and remote content sources
  • a minimal set of files that can be configured with your own components, themes, layouts, sources and plugins
  • an update path that enables you to update Mosaic, independently of your own configuration

Create your first site

Export the site package from the Mosaic monorepo to create your own site. Use Yarn 4.10.3 or later: packing converts the template's workspace: dependencies to published version ranges that can install in a standalone project.

> git clone https://github.com/jpmorganchase/mosaic.git
> cd mosaic
> yarn install --immutable
> yarn workspace @jpmorganchase/mosaic-site pack --out ../../mosaic-site.tgz
> mkdir ../mosaic-sample-site
> tar -xzf mosaic-site.tgz -C ../mosaic-sample-site --strip-components=1
> cd ../mosaic-sample-site
> yarn config set nodeLinker node-modules
> yarn install

Configure mosaic.config.mjs with your content sources. The reference local sources point to documentation folders in the Mosaic monorepo; replace those paths before serving your own site.

Define the environment variable, which enables us to access your remote repo.

> export MOSAIC_DOCS_CLONE_CREDENTIALS="<your GIT username:PAT Token>"

The MOSAIC_DOCS_CLONE_CREDENTIALS environment variable is composed of your git username and your PAT token. Follow these docs to see how to create your own PAT token.

Your site is ready to run.

> yarn serve

In your browser load http://localhost:3000

Congratulations, you have created your first Mosaic site.

Mosaic BETA

Coming soon