Getting Started

Necessary knowledge

This documentation assumes some familiarity with
  • GitHub
  • GitHub Actions
  • GitHub Pages
And some familiarity with these languages
  • JavaScript and JSON
  • YAML
  • HTML
  • CSS
  • Markdown

Installation

Making your first project

  • Create new repository, and create /.github/workflows/publish.yml file, template:
YAMLname: 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:
YAMLname: 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:
Choose what mode you want to use.

Using Postprocessor mode:
JavaScriptmodule.exports = {
  type: "postprocessor"
}

Using Redirector mode:
JavaScriptmodule.exports = {
    type: "redirect",
    redirect_config: {
        url: "https://example.com/", // Required. Replace with destination URL.
    }
}

Using Compressor mode:
JavaScriptmodule.exports = {
    type: "compress"
}

Using Generator mode:
JavaScriptmodule.exports = {
    type: "docs",
    docs_config: {
        title: "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:
Make sure that permissions allow writing pages and id-token, but do not allow writing contents, only read.
YAMLpermissions:
  contents: read
  pages: write
  id-token: write

Make a job for building your website using _just:
YAMLjobs:
  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:
Basic usage:
JavaScriptmodule.exports = {
  type: "(postprocessor/redirect/compress/docs)"
}


  • Read the documentation for the mode that you’ve chosen.

Modes documentation


Reserved directories

Your repository should not have these directories:
  • _just_data
  • deploy
If your repository has any of these, _just will throw an error.

Swipe right to open the menu and swipe left to close it.