Skip to content
Open
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
21 changes: 17 additions & 4 deletions apps/docs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ export const viewport: Viewport = {
maximumScale: 1,
viewportFit: 'cover',
}),
// diffshub body uses --diffshub-sidebar-bg (#f7f7f7 / #101010) rather than
// the plain neutral background shared by diffs and trees, so it gets its
// own theme-color pair for the browser chrome address bar.
themeColor:
process.env.NEXT_PUBLIC_SITE === 'diffshub'
? [
{ media: '(prefers-color-scheme: light)', color: '#f7f7f7' },
{ media: '(prefers-color-scheme: dark)', color: '#101010' },
]
: [
{ media: '(prefers-color-scheme: light)', color: '#ffffff' },
{ media: '(prefers-color-scheme: dark)', color: '#252525' },
],
};

// When running in a worktree, prefix the title with a stable emoji + slug so
Expand Down Expand Up @@ -123,22 +136,22 @@ const description = SITE_PRODUCT.description;
const SITE_ICONS_BY_SITE: Record<ProductId, Metadata['icons']> = {
diffs: {
icon: [
{ url: '/favicon.svg', type: 'image/svg+xml' },
{ url: '/favicon.png', type: 'image/png' },
{ url: '/diffs-brand/icon.svg', type: 'image/svg+xml' },
{ url: '/diffs-brand/icon.ico', sizes: '32x32' },
],
apple: '/diffs-brand/apple-icon.png',
},
trees: {
icon: [
{ url: '/trees-brand/icon.svg', type: 'image/svg+xml' },
{ url: '/trees-brand/icon.ico', sizes: 'any' },
{ url: '/trees-brand/icon.ico', sizes: '32x32' },
],
apple: '/trees-brand/apple-icon.png',
},
diffshub: {
icon: [
{ url: '/diffshub-brand/icon.svg', type: 'image/svg+xml' },
{ url: '/diffshub-brand/icon.ico', sizes: 'any' },
{ url: '/diffshub-brand/icon.ico', sizes: '32x32' },
],
apple: '/diffshub-brand/apple-icon.png',
},
Expand Down
65 changes: 65 additions & 0 deletions apps/docs/app/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import type { MetadataRoute } from 'next';

import { type ProductId, PRODUCTS } from '@/lib/product-config';

const SITE = (process.env.NEXT_PUBLIC_SITE ?? 'diffs') as ProductId;

// All apple-icon.png assets are 640×640, satisfying Chrome's ≥192px install
// prompt and ≥512px splash-screen requirements.
const APPLE_ICON_SIZE = '640x640';

// diffshub is a full standalone app (viewport-fit cover); diffs and trees are
// documentation sites that benefit from keeping browser navigation visible.
const DISPLAY_BY_SITE: Record<ProductId, MetadataRoute.Manifest['display']> = {
diffs: 'minimal-ui',
trees: 'minimal-ui',
diffshub: 'standalone',
};

// diffshub body uses --diffshub-sidebar-bg (#f7f7f7) rather than plain white.
// The manifest only accepts a single theme_color, so we use the light value;
// dark-mode tinting is handled via themeColor in the viewport export.
const THEME_COLOR_BY_SITE: Record<ProductId, string> = {
diffs: '#ffffff',
trees: '#ffffff',
diffshub: '#f7f7f7',
};

export default function manifest(): MetadataRoute.Manifest {
const product = PRODUCTS[SITE];

return {
name: `${product.name}, from Pierre`,
short_name: product.name,
description: product.description,
id: '/',
start_url: '/',
display: DISPLAY_BY_SITE[SITE],
orientation: 'any',
lang: 'en',
dir: 'ltr',
background_color: '#ffffff',
theme_color: THEME_COLOR_BY_SITE[SITE],
categories: ['developer', 'productivity'],
icons: [
{
src: `/${SITE}-brand/icon.svg`,
type: 'image/svg+xml',
sizes: 'any',
purpose: 'any',
},
{
src: `/${SITE}-brand/apple-icon.png`,
type: 'image/png',
sizes: APPLE_ICON_SIZE,
purpose: 'any',
},
{
src: `/${SITE}-brand/apple-icon.png`,
type: 'image/png',
sizes: APPLE_ICON_SIZE,
purpose: 'maskable',
},
],
};
}
Binary file added apps/docs/public/diffs-brand/icon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions apps/docs/public/diffs-brand/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/docs/public/diffshub-brand/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions apps/docs/public/diffshub-brand/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/docs/public/favicon.png
Binary file not shown.
1 change: 0 additions & 1 deletion apps/docs/public/favicon.svg

This file was deleted.

5 changes: 3 additions & 2 deletions apps/docs/public/trees-brand/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading