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
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"react-dom": "^19",
"react-markdown": "10.1.0",
"simple-icons": "^16.39.0",
"visualci-gallery": "0.2.1"
"visualci-gallery": "0.3.0"
},
"devDependencies": {
"@fontsource/geist": "^5.3.0",
Expand Down
10 changes: 5 additions & 5 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion frontend/scripts/prerender.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,16 @@ const gallery = galleryBuildModel(galleryManifest, {
})
const galleryShots = galleryManifest.groups.reduce((n, g) => n + g.items.length, 0)

/** Desktop before phone, then light before dark, as the gallery's switches list them. */
const variantsBySize = (variants) => {
const rank = (v) => ['desktop', 'phone'].indexOf(v.values.size) * 2 + ['light', 'dark'].indexOf(v.values.theme)
return [...variants].sort((a, b) => rank(a) - rank(b))
}

function galleryMarkdown() {
const head = `VisualCI's own screenshots of its web app, light and dark, on a desktop and on a phone, as approved on main, from its public gallery (${SITE}/docs/gallery.md). Each has a 2x copy for high-density screens (the same URL ending in -2x.png). The manifest: ${GALLERY_MANIFEST}`
const sections = gallery.groups.map(
(g) => `## ${g.title}\n\n` + g.screens.map((sc) => `- ${sc.title}: ${sc.variants.map((v) => `[${v.size}, ${v.theme}](${v.url})`).join(', ')}`).join('\n'),
(g) => `## ${g.title}\n\n` + g.screens.map((sc) => `- ${sc.title}: ${variantsBySize(sc.variants).map((v) => `[${v.values.size}, ${v.values.theme}](${v.url})`).join(', ')}`).join('\n'),
)
return [head, ...sections].join('\n\n')
}
Expand Down
Loading