This project is a boilerplate for creating Reveal.js presentations. It supports deployment to both GitLab Pages and GitHub Pages, and uses Bun for development.
- Bun Integration: Faster dependency management and execution.
- RevealJS Microservice: Integrated with a lightweight Go-based microservice for serving presentations.
- CI/CD: Automatic deployment to GitLab Pages or GitHub Pages (supporting versioned docs and MR previews).
- Setup Scripts: Automates GitLab or GitHub Pages configuration via their respective APIs.
- Bun installed locally.
- A GitLab or GitHub account.
If you've cloned this repository manually, install the dependencies:
# Install dependencies
bun installYou can bootstrap a new project directly from the remote Git repository:
bun create cmcrobotics/reveal-template my-presentation
cd my-presentationIf you have a local clone of this template and want to use it to create a new project:
bun create ./path/to/reveal-template my-presentationTo make this template available as a global shorthand (e.g., bun create reveal-template my-presentation), you can symlink it into Bun's template directory:
mkdir -p ~/.bun-create
ln -s $(pwd) ~/.bun-create/reveal-templateNow you can create a new presentation from anywhere using:
bun create reveal-template my-presentationThis project can use the revealjs-microservice to serve and manage the presentation assets. Run the initialization script to download the binary:
chmod +x init.sh
./init.shThe init.sh script downloads the static binary from the GitHub repository (bcopy/revealjs-microservice). This microservice simplifies the way Reveal.js assets are served and is designed for static environments like GitLab Pages.
To start the development server:
bun startThis will:
- Build the project (copy Reveal.js assets to the
resourcesdirectory). - Start a local server (using
live-server) to serve theresourcesfolder.
This template supports deployment to both GitLab Pages and GitHub Pages.
To correctly configure GitLab Pages settings, you can use the provided bin/setup-gitlab-pages.js script.
-
Generate a Personal Access Token in GitLab with the
apiscope. -
(Optional) Create a
.envfile in the project root:GITLAB_TOKEN=your_token_here
-
(Optional) Set your Project ID in
package.jsonunder thegitlab_project_idfield and your Gitlab Pages domain under thedomainfield. -
Run the script:
bun bin/setup-gitlab-pages.js
Note: If you don't provide the token or Project ID in advance, the script will prompt you for them.
-
Follow the prompts to:
- Enable "Use Unique Domain".
- (Optional) Add a custom domain.
This script ensures that your pages are served from a unique subdomain and that no primary domain is strictly enforced, making it easier to manage multiple environments (Production, Develop, MR previews).
The template includes a .gitlab-ci.yml that handles deployments:
- Main/Master branch: Deploys to the root of your GitLab Pages URL.
- Tags: Deploys to a versioned path (e.g.,
/v1.0.0/). - Develop branch: Deploys to
/develop/. - Merge Requests: Can be manually deployed to
/mr-<id>/for previewing changes.
All deployments use the oven/bun Docker image for the build process.
To correctly configure GitHub Pages settings, you can use the provided bin/setup-github-pages.js script.
-
Generate a Personal Access Token in GitHub with the
reposcope. Save it as an environment variable (e.g.,GITHUB_TOKEN) or be ready to enter it when prompted. -
(Optional) Set your GitHub repository owner (
github_repo_owner) and repository name (github_repo_name) inpackage.json. -
Run the script:
bun bin/setup-github-pages.js
Note: If you don't provide the token or repository information in advance, the script will attempt to infer them or prompt you for them.
-
Follow the prompts to:
- (Optional) Add a custom domain.
This script helps configure your GitHub Pages repository settings, including the custom domain.
The template includes a .github/workflows/pages.yml that handles deployments:
- Main/Master branch: Deploys to the root of your GitHub Pages URL (e.g.,
yourusername.github.io/yourrepo/oryourusername.github.io/). - Tags: Deploys to a versioned path (e.g.,
/tags/v1.0.0/). - Develop branch: Deploys to
/develop/. - Pull Requests: Deploys to
/pull-requests/<id>/for previewing changes.
All deployments use ubuntu-latest and oven-sh/setup-bun@v1 for the build process.
The template includes a .gitlab-ci.yml that handles deployments:
- Main/Master branch: Deploys to the root of your GitLab Pages URL.
- Tags: Deploys to a versioned path (e.g.,
/v1.0.0/). - Develop branch: Deploys to
/develop/. - Merge Requests: Can be manually deployed to
/mr-<id>/for previewing changes.
All deployments use the oven/bun Docker image for the build process.
- Edit your slides in the
resourcesdirectory. - Update
package.jsonwith your project name and details. - Modify the
buildscript inpackage.jsonif you change your asset structure.
If you are using GitLab, you can allow your colleagues to use this project as a template when creating new projects in your GitLab group:
- Push this project to a repository in your GitLab group.
- Go to your Group Settings -> General.
- Expand the Templates section.
- Select this project in the Templates project dropdown.
- Click Save changes.
Now, when any member of the group creates a new project, they can choose Create from template and select your project from the Group tab.