|
| 1 | +# Using This Template |
| 2 | + |
| 3 | +This guide explains how to use this presentation template to create your own reveal.js presentations. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +1. **Click "Use this template"** at the top of the GitHub repository page |
| 8 | +2. **Name your new repository** (e.g., `my-awesome-talk`) |
| 9 | +3. **Clone your new repository**: |
| 10 | + ```bash |
| 11 | + git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git |
| 12 | + cd YOUR-REPO-NAME |
| 13 | + ``` |
| 14 | + |
| 15 | +4. **Run the setup script**: |
| 16 | + ```bash |
| 17 | + ./setup-template.sh |
| 18 | + ``` |
| 19 | + |
| 20 | + The script will: |
| 21 | + - Detect your repository name from git |
| 22 | + - Ask for confirmation or let you customize values |
| 23 | + - Update all template placeholders |
| 24 | + - Rename the markdown file to match your repo name |
| 25 | + - Self-delete when complete |
| 26 | + |
| 27 | +5. **Edit your presentation**: |
| 28 | + ```bash |
| 29 | + # Edit the markdown file in the slides/ directory |
| 30 | + # It will be named after your repository |
| 31 | + ``` |
| 32 | + |
| 33 | +6. **Preview locally**: |
| 34 | + ```bash |
| 35 | + npm start |
| 36 | + ``` |
| 37 | + Opens at http://localhost:8000 |
| 38 | + |
| 39 | +7. **Deploy to GitHub Pages**: |
| 40 | + |
| 41 | + **Step 1: Enable GitHub Actions Workflow Permissions** |
| 42 | + - Go to **Settings** > **Actions** > **General** |
| 43 | + - Scroll to **Workflow permissions** |
| 44 | + - Select **Read and write permissions** |
| 45 | + - Check **Allow GitHub Actions to create and approve pull requests** |
| 46 | + - Click **Save** |
| 47 | + |
| 48 | + **Step 2: Enable GitHub Pages** |
| 49 | + - Go to **Settings** > **Pages** |
| 50 | + - Under **Source**, select **GitHub Actions** |
| 51 | + - Click **Save** |
| 52 | + |
| 53 | + **Step 3: Push and Deploy** |
| 54 | + - Push your changes to `main` branch |
| 55 | + - GitHub Actions will automatically build and deploy |
| 56 | + - Monitor progress in the **Actions** tab |
| 57 | + - Your presentation will be live at `https://YOUR-USERNAME.github.io/YOUR-REPO-NAME/` |
| 58 | + |
| 59 | +## What Gets Customized |
| 60 | + |
| 61 | +The setup script updates these files: |
| 62 | + |
| 63 | +### README.md |
| 64 | +- Replaces `YOUR-USERNAME` with your GitHub username |
| 65 | +- Replaces `YOUR-REPO-NAME` with your repository name |
| 66 | +- Replaces `Presentation Title` with your custom title |
| 67 | + |
| 68 | +### index.html |
| 69 | +- Updates the `<title>` tag |
| 70 | +- Updates the markdown file reference in `data-markdown` |
| 71 | + |
| 72 | +### package.json |
| 73 | +- Updates the `name` field to match your repository |
| 74 | + |
| 75 | +### slides/ |
| 76 | +- Renames `presentation.md` to `YOUR-REPO-NAME.md` |
| 77 | + |
| 78 | +## Manual Customization |
| 79 | + |
| 80 | +If you prefer not to use the setup script, update these values manually: |
| 81 | + |
| 82 | +1. **README.md**: Search and replace placeholders |
| 83 | +2. **index.html**: |
| 84 | + - Line 7: Update `<title>` |
| 85 | + - Line 23: Update `data-markdown` path |
| 86 | +3. **package.json**: Update the `name` field |
| 87 | +4. **slides/**: Rename the markdown file |
| 88 | + |
| 89 | +## Creating Your Presentation |
| 90 | + |
| 91 | +Edit the markdown file in `slides/`: |
| 92 | + |
| 93 | +```markdown |
| 94 | +# My Presentation Title |
| 95 | + |
| 96 | +Subtitle or description |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## Slide 2 |
| 101 | + |
| 102 | +Content here |
| 103 | + |
| 104 | +* Bullet 1 |
| 105 | +* Bullet 2 |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## Slide 3 |
| 110 | + |
| 111 | +```bash |
| 112 | +# Code examples |
| 113 | +echo "Hello" |
| 114 | +``` |
| 115 | +``` |
| 116 | + |
| 117 | +### Slide Separators |
| 118 | + |
| 119 | +- `---` creates a new horizontal slide |
| 120 | +- `--` creates a vertical slide (nested under current) |
| 121 | +- `Note:` at the start of a line creates speaker notes |
| 122 | + |
| 123 | +### Adding Images |
| 124 | + |
| 125 | +1. Add images to the `images/` directory |
| 126 | +2. Reference in markdown: |
| 127 | + ```markdown |
| 128 | +  |
| 129 | + ``` |
| 130 | + |
| 131 | +### Code Blocks |
| 132 | + |
| 133 | +Use fenced code blocks with language specification: |
| 134 | + |
| 135 | +````markdown |
| 136 | +```javascript |
| 137 | +function hello() { |
| 138 | + console.log("Hello, world!"); |
| 139 | +} |
| 140 | +``` |
| 141 | +```` |
| 142 | + |
| 143 | +## Customizing Styles |
| 144 | + |
| 145 | +Edit `css/custom.css` to change: |
| 146 | +- Colors |
| 147 | +- Fonts |
| 148 | +- Layout |
| 149 | +- Custom classes |
| 150 | + |
| 151 | +The template includes DDEV branding styles. Replace or modify these for your brand. |
| 152 | + |
| 153 | +## reveal.js Configuration |
| 154 | + |
| 155 | +In `index.html`, the `Reveal.initialize()` section contains many options: |
| 156 | + |
| 157 | +- `controls`: Show navigation controls |
| 158 | +- `progress`: Show progress bar |
| 159 | +- `slideNumber`: Display slide numbers |
| 160 | +- `transition`: Slide transition effect |
| 161 | +- And many more... |
| 162 | + |
| 163 | +See [reveal.js documentation](https://revealjs.com/config/) for all options. |
| 164 | + |
| 165 | +## GitHub Pages Deployment |
| 166 | + |
| 167 | +The repository includes a GitHub Actions workflow (`.github/workflows/deploy.yml`) that automatically builds and deploys your presentation. |
| 168 | + |
| 169 | +### Initial Setup |
| 170 | + |
| 171 | +**Step 1: Enable GitHub Actions Workflow Permissions** |
| 172 | + |
| 173 | +1. Go to **Settings** > **Actions** > **General** |
| 174 | +2. Scroll down to **Workflow permissions** |
| 175 | +3. Select **Read and write permissions** |
| 176 | +4. Check **Allow GitHub Actions to create and approve pull requests** |
| 177 | +5. Click **Save** |
| 178 | + |
| 179 | +Without these permissions, the workflow cannot deploy to GitHub Pages. |
| 180 | + |
| 181 | +**Step 2: Enable GitHub Pages** |
| 182 | + |
| 183 | +1. Go to **Settings** > **Pages** |
| 184 | +2. Under **Build and deployment** > **Source** |
| 185 | +3. Select **GitHub Actions** from the dropdown |
| 186 | +4. Click **Save** |
| 187 | + |
| 188 | +**Step 3: Deploy** |
| 189 | + |
| 190 | +1. Push your changes to the `main` branch |
| 191 | +2. The workflow will automatically trigger |
| 192 | +3. Monitor progress in the **Actions** tab |
| 193 | +4. Once complete (usually 1-2 minutes), your presentation is live |
| 194 | + |
| 195 | +### How It Works |
| 196 | + |
| 197 | +The workflow: |
| 198 | +1. Triggers on every push to `main` branch |
| 199 | +2. Builds the presentation by copying necessary files |
| 200 | +3. Creates a deployment artifact |
| 201 | +4. Deploys to GitHub Pages |
| 202 | +5. Your site is available at `https://YOUR-USERNAME.github.io/YOUR-REPO-NAME/` |
| 203 | + |
| 204 | +### Troubleshooting Deployment |
| 205 | + |
| 206 | +**Workflow fails with "Resource not accessible by integration"** |
| 207 | +- Check that workflow permissions are set to "Read and write permissions" in Settings > Actions > General |
| 208 | + |
| 209 | +**Pages not deploying** |
| 210 | +- Verify GitHub Pages source is set to "GitHub Actions" |
| 211 | +- Check the Actions tab for error messages |
| 212 | +- Ensure you've pushed to the `main` branch |
| 213 | + |
| 214 | +**404 error when visiting the URL** |
| 215 | +- Wait a few minutes after the first deployment |
| 216 | +- Check Settings > Pages to confirm the deployment URL |
| 217 | +- Verify the workflow completed successfully in Actions tab |
| 218 | + |
| 219 | +## Troubleshooting |
| 220 | + |
| 221 | +### Setup script doesn't detect repository |
| 222 | + |
| 223 | +Run with custom values: |
| 224 | +```bash |
| 225 | +./setup-template.sh |
| 226 | +# Answer 'n' when asked if detected values are correct |
| 227 | +# Enter your values manually |
| 228 | +``` |
| 229 | + |
| 230 | +### Presentation doesn't load |
| 231 | + |
| 232 | +Check: |
| 233 | +- Markdown file name matches reference in `index.html` |
| 234 | +- Files are in correct directories |
| 235 | +- GitHub Pages is enabled and deployed |
| 236 | + |
| 237 | +### Images don't display |
| 238 | + |
| 239 | +- Ensure images are in `images/` directory |
| 240 | +- Use correct relative paths: `images/filename.png` |
| 241 | +- Check image file names match (case-sensitive on Linux) |
| 242 | + |
| 243 | +## Resources |
| 244 | + |
| 245 | +- [reveal.js Documentation](https://revealjs.com/) |
| 246 | +- [Markdown Guide](https://www.markdownguide.org/) |
| 247 | +- [GitHub Pages Docs](https://docs.github.com/en/pages) |
| 248 | +- [GitHub Template Repositories](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository) |
0 commit comments