This is a TypeScript template for Mastro when using Deno with the git-based Pages CMS.
To make edits using the CMS:
-
Click the green button Use this template on the top right, select Create a new repository and choose a name for your project. (To deploy to GitHub Pages for free, your repo needs to be public.)
-
Then open Pages CMS, log in with your GitHub account and give it permission to access your GitHub repository.
Finally, you'll also want to Publish your website to GitHub Pages or another static site host.
If your site is at a URL like https://my-name.github.io/my-repo you'll want to adjust the media section .pages.yml to:
media:
input: routes/media
output: /my-repo/mediawhere my-repo is your actual repository name.
deno task start
and open http://localhost:8000 in your browser, or see install instructions.
To generate the whole static site (this will create a generated folder):
deno task generate
This template uses Deno (which is recommended), but you can also use Node.js or Bun: replace the deno.json with a package.json, and adjust the server.ts as seen in the Node.js template or Bun template respectively.
To learn more about Mastro and building websites, follow the guide.
For a condensed overview of the Mastro web framework and static site generator, consult the Mastro Docs.
To make sure you're using the latest Mastro packages:
deno update --latest "@mastrojs/*"