Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI

# Quality gates from gobinath.com docs/DESIGN.md §8: build, privacy check, no-JS smoke test.
# Deployment stays in deploy.yml / deploy-worker.yml; this workflow only checks.

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
site:
name: Build, privacy, no-JS smoke
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
with:
version: 10.24.0
run_install: false

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: pnpm

- run: pnpm install --frozen-lockfile

- name: Build (also catches broken links)
run: pnpm docs:build

- name: Privacy check (GPS in images, third-party loads, private terms)
run: pnpm privacy
env:
PRIVACY_TERMS: ${{ secrets.PRIVACY_TERMS }}

- name: No-JS smoke test (pages readable, dark by default, no third-party iframes)
run: pnpm smoke

worker:
name: Worker dry run
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- name: Bundle without deploying
working-directory: worker
run: npx --yes wrangler@4 deploy --dry-run --outdir dist

workflows:
name: Workflow lint (actionlint, zizmor)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: actionlint
run: |
bash <(curl -sSfL https://raw.githubusercontent.com/rhysd/actionlint/v1.7.12/scripts/download-actionlint.bash) 1.7.12
./actionlint -color
- name: zizmor
run: pipx run zizmor==1.32.0 --min-severity medium .github/workflows
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v6

uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
languages: javascript
queries: security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v4

uses: github/codeql-action/autobuild@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
category: /language:javascript
15 changes: 8 additions & 7 deletions .github/workflows/deploy-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
with:
version: 10.24.0
run_install: false

- name: Setup Node
uses: actions/setup-node@v6
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 20
cache: pnpm
cache-dependency-path: worker/pnpm-lock.yaml
# No dependency cache in a deploy workflow (zizmor: cache-poisoning)
package-manager-cache: false

- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: worker

- name: Deploy Worker
uses: cloudflare/wrangler-action@v3
uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,34 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
fetch-depth: 0 # Required for lastUpdated feature

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
with:
version: 10.24.0
run_install: false

- name: Setup Node
uses: actions/setup-node@v6
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 20
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Setup Pages
uses: actions/configure-pages@v5

uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build with VitePress
run: pnpm run docs:build

- name: Upload artifact
uses: actions/upload-pages-artifact@v4
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: .vitepress/dist

Expand All @@ -70,4 +70,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
10 changes: 6 additions & 4 deletions .github/workflows/first-interaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
issues:
types:
- opened
pull_request_target:
# Needed so the welcome comment can be posted on PRs from forks. Safe here: this workflow never
# checks out or runs the PR's code; it only posts a fixed comment.
pull_request_target: # zizmor: ignore[dangerous-triggers]
types:
- opened

Expand All @@ -17,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Drop a welcome note
uses: actions/first-interaction@v1
uses: actions/first-interaction@3c71ce730280171fd1cfb57c00c774f8998586f7 # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Expand All @@ -30,12 +32,12 @@ jobs:
- Screenshots, links, or repro steps (if it's a bug) keep the study notes extra sharp.

Appreciate you taking the time to help future learners. 🙌
pull-request-message: |
pr-message: |
🚀 **First PR vibes!**

Thank you for your inaugural contribution to notes.gobinath.com. Before a maintainer reviews it, double-check the essentials:

- `npm install` (once) and `npm run docs:build` help catch broken links or markdown issues locally.
- `pnpm install` (once) and `pnpm run verify` catch broken links, privacy issues and markdown problems locally.
- Reference the relevant certification file(s) in your description so reviewers can follow along.
- Add screenshots, diagrams, or context if you touched visual assets in `public/` or `resources/`.

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ worker/.dev.vars
AGENTS.md
CLAUDE.md


# private words list for the privacy check (CI uses the PRIVACY_TERMS secret)
.privacy-terms
101 changes: 101 additions & 0 deletions .vitepress/theme/components/SpotifyEpisode.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<script setup lang="ts">
/**
* Click-to-load Spotify episode (privacy: gobinath.com docs/DESIGN.md §5).
* Nothing is requested from Spotify until the visitor clicks Play. Without JavaScript
* the card is a plain link to the episode on Spotify.
*
* Usage in Markdown: <SpotifyEpisode episode="https://open.spotify.com/embed/episode/ID" />
* (paste the embed URL Spotify gives you; open.spotify.com and creators.spotify.com both work)
*/
import { computed, ref } from 'vue'

const props = defineProps<{ episode: string; title?: string }>()
const loaded = ref(false)

// The page link is the embed URL without "/embed" and without tracking query params
const listenUrl = computed(() => props.episode.replace('/embed/', '/').replace('/embed', '').split('?')[0])
const label = computed(() => props.title || 'Audio refresher')
</script>

<template>
<div class="spotify-episode">
<iframe
v-if="loaded"
:src="episode"
:title="`${label} on Spotify`"
width="100%"
height="152"
frameborder="0"
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
allowfullscreen
></iframe>
<a
v-else
class="spotify-card"
:href="listenUrl"
target="_blank"
rel="noopener"
@click.prevent="loaded = true"
>
<span class="play" aria-hidden="true">
<svg viewBox="0 0 24 24" width="22" height="22"><path fill="currentColor" d="M8 5.5v13l11-6.5z" /></svg>
</span>
<span class="text">
<span class="label">{{ label }}</span>
<span class="hint">Play episode · loads the Spotify player</span>
</span>
</a>
</div>
</template>

<style scoped>
.spotify-episode {
margin: 16px 0;
}
.spotify-episode iframe {
display: block;
border-radius: 12px;
}
.spotify-card {
display: flex;
align-items: center;
gap: 16px;
min-height: 96px;
padding: 18px 20px;
border: 1px solid var(--vp-c-divider);
border-radius: 12px;
background: var(--vp-c-bg-soft);
color: var(--vp-c-text-1) !important;
text-decoration: none !important;
transition: border-color 0.2s;
}
.spotify-card:hover {
border-color: var(--gobi-y);
background: var(--vp-c-bg-soft) !important;
}
.play {
flex: none;
display: grid;
place-items: center;
width: 48px;
height: 48px;
border-radius: 50%;
background: var(--gobi-y);
color: var(--gobi-ink);
}
.text {
display: grid;
gap: 4px;
}
.label {
font-family: var(--gobi-display);
font-weight: 700;
font-size: 1.05rem;
}
.hint {
font-family: var(--vp-font-family-mono);
font-size: 12px;
letter-spacing: 0.04em;
color: var(--vp-c-text-2);
}
</style>
2 changes: 2 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import AITag from './components/AITag.vue'
import Flashcard from './components/Flashcard.vue'
import FlashcardDeck from './components/FlashcardDeck.vue'
import ExamMeta from './components/ExamMeta.vue'
import SpotifyEpisode from './components/SpotifyEpisode.vue'

export default {
extends: DefaultTheme,
Expand All @@ -39,5 +40,6 @@ export default {
app.component('AIAudioPlayer', AIAudioPlayer)
app.component('AITag', AITag)
app.component('ExamMeta', ExamMeta)
app.component('SpotifyEpisode', SpotifyEpisode)
}
}
2 changes: 1 addition & 1 deletion ADDING_CERTIFICATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The landing page for each certification. Sections in order:

2. **Info callout** — What kind of exam this is
3. **ImageModal** — Exam overview infographic
4. **Audio Refresher** — `<AIAudioPlayer>` for NotebookLM podcast
4. **Audio Refresher** — `<AIAudioPlayer>` for NotebookLM podcast, or `<SpotifyEpisode>` for an episode on Spotify (never a raw Spotify `<iframe>`; CI rejects it)
5. **Study Progress** — `<ProgressTracker>` with granular children per domain
6. **Resources** — Official and external links
7. **Navigation** — Links to domain-1 and cheatsheet
Expand Down
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,25 @@ Add to `index.md` for NotebookLM audio refreshers:
</AIAudioPlayer>
```

### SpotifyEpisode Component

For an episode published on Spotify. Paste the **embed URL** Spotify gives you. The player only loads
after the visitor clicks Play (privacy: nothing is requested from Spotify before that), and without
JavaScript it is a plain "Listen on Spotify" link. Don't paste Spotify's `<iframe>` directly; the CI
privacy and smoke checks fail on third-party iframes.

```vue
<SpotifyEpisode episode="https://open.spotify.com/embed/episode/[episode-id]" title="[CERT-CODE] audio refresher" />
```

### Standalone Cheatsheets (`public/cheatsheets/`)

Self-contained HTML pages. Keep them on-brand and private:
- Load fonts with `<link rel="stylesheet" href="/fonts/brand/fonts.css">`, never Google Fonts or another font CDN.
- Copy the `<style id="brand">` block from an existing cheatsheet into `<head>` (after the page's own styles).
It sets the brand neutrals, yellow accent and fonts; keep domain/right/wrong colours as they are.
- Nothing else may load from another host. `pnpm privacy` checks this.

### ImageModal Component

Add to `index.md` for exam infographics:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ This repo uses GitHub Actions for site deployment, worker deployment, code scann
| **Deploy VitePress site** | `.github/workflows/deploy.yml` | Pushes to `main` except `worker/**`, or manual dispatch | Push site/content changes to `main` to deploy automatically. You can also run it manually from the **Actions** tab. |
| **Deploy Cloudflare Worker** | `.github/workflows/deploy-worker.yml` | Pushes that touch `worker/**`, or manual dispatch | Make worker-only changes under `worker/` and push to `main`, or run it manually from the **Actions** tab. Requires Cloudflare secrets to be configured. |
| **CodeQL Analysis** | `.github/workflows/codeql.yml` | Pushes to `main`, pull requests to `main`, and weekly schedule | Open a PR or push to `main` to trigger scanning automatically. Use it to catch JavaScript security and quality issues. |
| **CI** | `.github/workflows/ci.yml` | Pull requests, pushes to `main`, or manual dispatch | Runs automatically. Builds the site, then the privacy check (no GPS in images, nothing loaded from hosts outside the allowlist, no private terms) and the no-JS smoke test (pages readable, dark by default, no third-party iframes), plus a Worker dry run and workflow lint. |
| **Welcome First Timers** | `.github/workflows/first-interaction.yml` | First issue opened or first pull request opened | No manual action needed. It automatically posts a welcome comment for first-time contributors. |

### Maintainer Notes

- Run `pnpm run docs:build` locally before pushing site/content changes.
- Run `pnpm run verify` locally before pushing site/content changes (build + privacy check + no-JS smoke test, same as CI).
- The privacy check reads private terms from the `PRIVACY_TERMS` repo secret in CI, or a local `.privacy-terms` file (gitignored). `scripts/privacy-check.mjs` is copied from gobinath.com; keep them in sync.
- The worker workflow requires:
- `CLOUDFLARE_API_TOKEN`
- `CLOUDFLARE_ACCOUNT_ID`
Expand Down
Loading