Getting Started
Necessary knowledge
This documentation assumes some familiarity with- GitHub
- GitHub Actions
- GitHub Pages
- JavaScript
- YAML
- HTML
- CSS
- Markdown
Installation
Making your first project
- Create new repository, and create
/.github/workflows/publish.yml
file, template:
YAML
name: Website
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Generate with _just
uses: js-just/latest@main
with: # Remove "with" and "path" here if you are not using compressor or generator modes!
path: . # Root directory, or you can replace the dot with the path to your website/docs directory to be generated/compressed. (Only for compressor and generator modes)
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: . # Root directory, or you can replace the dot with the path to your entire website to be deployed to GitHub Pages.
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
You can change name of workflow file and workflow name:
YAML
name: Workflow name
You can also choose _just version:
YAML
uses: js-just/_just@(put version name here)
If you know what exactly you are doing, you may change anything.
- Create
just.config.js
file in the root directory:
Using
Postprocessor
mode:JavaScript
module.exports = {
type: "postprocessor"
}
Using
Redirector
mode: JavaScript
module.exports = {
type: "redirect",
redirect_config: {
url: "https://example.com/", // Required. Replace with destination URL.
}
}
Using
Compressor
mode:JavaScript
module.exports = {
type: "compress"
}
Using
Generator
mode:JavaScript
module.exports = {
type: "docs",
docs_config: {
metatitle: "Documentation title", // Required. Replace with your documentation title.
domain: "example.com" // Required. Replace with your domain name. Domain name should be valid.
}
}
- Read the documentation for the mode that you've chosen.
Pro installation
- Create or modify your
.github/workflows/github_pages_workflow_name.yml
:
pages
and id-token
, but do not allow writing contents
, only read.YAML
permissions:
contents: read
pages: write
id-token: write
Make a job for building your website using _just:
YAML
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate with _just
uses: js-just/_just@ # version name (recommended) (example: v0.0.29) / main branch (latest commit) (unstable, not recommended) / commit SHA (not recommended)
with:
path: # Path to your website directory to be generated/compressed. (Only for compressor and generator modes)
- Create
just.config.js
file:
JavaScript
module.exports = {
type: "(postprocessor/redirect/compress/docs)"
}
Using multiple modes:
Currently available only combining generator and compressor.
JavaScript
module.exports = {
type: ["docs", "compress"]
}
- Read the documentation for the mode/modes that you've chosen.