-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KEY-234: Port showcase to Docs site #596
Merged
Changes from 53 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
0293bd8
WIP - starting the port over from Astro site
simonswiss 8ec60e7
Sorting order fixed and width container removal
simonswiss 4246373
WIP continued — overall layout shaping up (not responsive!)
simonswiss fb5a176
ActionButton WIP
simonswiss 1878da1
Navigation
simonswiss 0069de3
WIP drilldown page
simonswiss b8dfe47
Cross project navigation in showcase individual page
simonswiss f9abc99
layout fix
simonswiss 8a23862
Fix nextProject link
simonswiss c91c304
Merge branch 'main' into showcase
simonswiss 1881114
showcase-navigator layout with CSS grid
simonswiss 7eb8298
showcase navigator CSS Grid implementation
simonswiss 113ff56
showcase navigator tweaks
simonswiss 091b91b
switch to cloud
simonswiss 6bb809b
Update docs/src/content/projects/better-dev-screencasts
keystatic-cloud[bot] fc2fac6
Add path prefix to projects config
simonswiss 9edbb84
Merge branch 'showcase' of github.com:Thinkmill/keystatic into showcase
simonswiss e0112dc
Update docs/src/content/projects/better-dev-screencasts
keystatic-cloud[bot] 303c8de
remove unused `component` function from config
simonswiss 45ac6b4
Merge branch 'showcase' of github.com:Thinkmill/keystatic into showcase
simonswiss 0803511
re-use aside and cloud-image components and renderers
simonswiss eaf21e2
Update docs/src/content/projects/better-dev-screencasts
keystatic-cloud[bot] 63b4a5e
Update docs/src/content/projects/better-dev-screencasts
keystatic-cloud[bot] a5a7b2b
Update docs/src/content/projects/ss
keystatic-cloud[bot] 98721a1
Delete ss.mdoc
simonswiss f683730
use cloud images for cover images
simonswiss af32d88
Update docs/src/content/projects/blog-demo
keystatic-cloud[bot] 75c3ea2
Update docs/src/content/projects/better-dev-screencasts
keystatic-cloud[bot] 02c211a
Update docs/src/content/projects/thinkmill
keystatic-cloud[bot] a014251
Update docs/src/content/projects/keystatic-docs
keystatic-cloud[bot] 35bd9d6
Update docs/src/content/projects/blog-demo
keystatic-cloud[bot] 20b5796
Update docs/src/content/projects/in-the-chair
keystatic-cloud[bot] 38f16d9
Update docs/src/content/projects/blog-demo
keystatic-cloud[bot] 1683268
Update docs/src/content/projects/luke-bennett
keystatic-cloud[bot] 0ffcaf2
Update docs/src/content/projects/luke-bennett
keystatic-cloud[bot] d5a1c09
Update docs/src/content/projects/marketing-landing-page
keystatic-cloud[bot] 6f98d3a
Update docs/src/content/projects/react-sydney-meetup
keystatic-cloud[bot] 1a4ea6c
Update docs/src/content/projects/star-athletics
keystatic-cloud[bot] 3466967
Update docs/src/content/projects/sydjs-meetup
keystatic-cloud[bot] 6023136
Update docs/src/content/projects/keystatic-docs
keystatic-cloud[bot] b490c5a
conditionally show repo link on showcase grid
simonswiss 8799c1a
Merge branch 'main' into showcase
simonswiss a7641ff
prettier formatting
simonswiss 0abcedb
Merge branch 'showcase' of github.com:Thinkmill/keystatic into showcase
simonswiss 025de4c
more prettier
simonswiss 41c1580
improved images + local/cloud combo
simonswiss fe03867
Responsive showcase navigation
simonswiss 0ff6a6d
new Slate color palette flowing throughout — removing former "keystat…
simonswiss efd3d52
Color curation throughout the entire docs site, aggressively overwrit…
simonswiss b27615d
specify convention for colors
simonswiss 6fa1d88
Merge branch 'main' into showcase
simonswiss 97ebe41
remove rewrites since there is no longer a separate website on anothe…
simonswiss 340641e
Merge branch 'showcase' of github.com:Thinkmill/keystatic into showcase
simonswiss 08cd197
update better-dev cloud image link
simonswiss be8e5ca
OG image from Thinkmill Labs Keystatic Cloud account
simonswiss 6a78424
Merge branch 'main' into showcase
simonswiss 470fa9b
Merge branch 'main' into showcase
JedWatson aae38e6
Update docs/src/content/pages/entry-layout
keystatic-cloud[bot] 092f3f6
Update docs/src/content/pages/github-mode
keystatic-cloud[bot] 0ccf12c
phasing out keystatic.io domain images
simonswiss 0e23e78
Merge branch 'showcase' of github.com:Thinkmill/keystatic into showcase
simonswiss 40e60ad
remove unused forms (can always retrieve from GIT history)
simonswiss e7f00ce
lockfile
simonswiss 45466a7
lockfile pretty please?
simonswiss ce29efc
delete lockfile
simonswiss 4918222
Merge branch 'main' into showcase
JedWatson 8769b78
Update pnpm-lock.yaml
JedWatson 7bd021e
Merge branch 'main' into showcase
JedWatson 563bc21
Updated open-graph bg image
simonswiss b93c33d
Merge branch 'showcase' of github.com:Thinkmill/keystatic into showcase
simonswiss 9ff5137
Rollback keystatic.io images
simonswiss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const defaultPrettierConfig = require('../.prettierrc.js'); | ||
|
||
module.exports = { | ||
...defaultPrettierConfig, | ||
plugins: [ | ||
...(defaultPrettierConfig.plugins || []), | ||
'prettier-plugin-tailwindcss', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"recommendations": ["cpylua.language-postcss", "bradlc.vscode-tailwindcss"], | ||
"unwantedRecommendations": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
{ | ||
"typescript.tsdk": "../node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
// Tailwind Intellisense power-up | ||
// Extend scope of supported attributes with `{anything}Classes`: | ||
"tailwindCSS.classAttributes": [ | ||
"class", | ||
"className", | ||
"ngClass", | ||
".*Classes.*" | ||
], | ||
// Regex black magic: | ||
"tailwindCSS.experimental.classRegex": [ | ||
// tailwind-variants | ||
["tv\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"], | ||
// CVA (with support for JSON) | ||
["cva(s*(\"[^\"]*\"|s*,s*|{(?:[^{}]|(?:{(?:[^{}]|(?:{[^{}]*}))*}))*}s*)*)"], | ||
// `cx()` function from classnames / clsx | ||
["cx\\(([^)]*)\\)", "(?:\"|'|`)([^(?:\"|'|`)]*)(?:\"|'|`)"] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function Docs() { | ||
export default async function Docs() { | ||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
import Link from 'next/link'; | ||
import Image from 'next/image'; | ||
import { notFound } from 'next/navigation'; | ||
import { Metadata, ResolvingMetadata } from 'next'; | ||
|
||
import DocumentRenderer from '../../../../components/document-renderer'; | ||
import { reader } from '../../../../utils/reader'; | ||
import ActionButton from '../../../../components/action-button'; | ||
import { GlobeIcon } from '../../../../components/icons/globe'; | ||
import { GitHubOutlineIcon } from '../../../../components/icons/github-outline-icon'; | ||
|
||
export default async function Docs({ params }: { params: { slug: string } }) { | ||
const { slug } = params; | ||
const project = await reader.collections.projects.read(slug); | ||
if (!project) notFound(); | ||
const content = await project.content(); | ||
|
||
// Project navigation | ||
const allProjects = await reader.collections.projects.all(); | ||
const sortedProjects = allProjects.sort( | ||
(a, b) => (a.entry.sortIndex as number) - (b.entry.sortIndex as number) | ||
); | ||
const currentProjectIndex = sortedProjects.findIndex(p => p.slug === slug); | ||
const previousProject = | ||
currentProjectIndex > 0 | ||
? sortedProjects[currentProjectIndex - 1] | ||
: sortedProjects[sortedProjects.length - 1]; | ||
const nextProject = | ||
currentProjectIndex < sortedProjects.length - 1 | ||
? sortedProjects[currentProjectIndex + 1] | ||
: sortedProjects[0]; | ||
|
||
return ( | ||
<div className="py-10"> | ||
<header> | ||
<div className="grid grid-cols-2 items-end gap-12 md:grid-cols-[1fr,auto,1fr]"> | ||
{/* Previous project */} | ||
|
||
<Link | ||
href={`/showcase/${previousProject.slug}`} | ||
className="group mb-2 flex flex-col gap-6" | ||
> | ||
<span className="font-medium leading-none text-slate-9"> | ||
← Previous | ||
</span> | ||
<span className="text-lg font-bold leading-none group-hover:underline"> | ||
{previousProject.entry.title} | ||
</span> | ||
</Link> | ||
{/* Current project */} | ||
<div className="col-span-2 row-start-1 text-center md:col-span-1 md:col-start-2"> | ||
<Link | ||
href="/showcase" | ||
className="font-medium text-slate-11 hover:underline" | ||
> | ||
Showcase | ||
</Link> | ||
<h1 className="mt-2 text-3xl font-extrabold leading-none sm:text-4xl md:mt-4 md:text-5xl lg:mt-6"> | ||
{project.title} | ||
</h1> | ||
</div> | ||
{/* Next project */} | ||
<Link | ||
href={`/showcase/${nextProject.slug}`} | ||
className="group mb-2 flex flex-col gap-6 justify-self-end rounded-md text-right" | ||
> | ||
<span className="font-medium leading-none text-slate-9"> | ||
Next → | ||
</span> | ||
<span className="text-lg font-bold leading-none group-hover:underline"> | ||
{nextProject.entry.title} | ||
</span> | ||
</Link> | ||
</div> | ||
|
||
<div className="border-b-2 border-slate-5"> | ||
<div className="relative mt-8 aspect-[16/10.5] overflow-hidden rounded-t-2xl border-2 border-b-0 border-slate-5 md:mt-16 lg:mx-20"> | ||
{/* Window buttons fake UI */} | ||
<div | ||
className="absolute left-2.5 top-2.5 z-10 flex gap-1.5" | ||
aria-hidden="true" | ||
> | ||
<div className="h-3 w-3 rounded-full bg-[#E54D2E]" /> | ||
<div className="h-3 w-3 rounded-full bg-[#FFB224]" /> | ||
<div className="h-3 w-3 rounded-full bg-[#30A46C]" /> | ||
</div> | ||
<Image | ||
src={project.coverImage.src} | ||
layout="fill" | ||
alt="" | ||
className="absolute inset-0 origin-bottom object-cover" | ||
/> | ||
</div> | ||
</div> | ||
<div className="mx-auto mt-16 max-w-2xl [text-wrap:balance]"> | ||
<p className="text-center font-medium md:text-lg"> | ||
{project.summary} | ||
</p> | ||
<div className="mt-10 flex items-center justify-center gap-2"> | ||
{project.repoUrl && ( | ||
<ActionButton | ||
impact="light" | ||
href={project.repoUrl} | ||
icon={GitHubOutlineIcon} | ||
> | ||
View on GitHub | ||
</ActionButton> | ||
)} | ||
{project.url && ( | ||
<ActionButton href={project.url ?? ''} icon={GlobeIcon}> | ||
Visit website | ||
</ActionButton> | ||
)} | ||
</div> | ||
</div> | ||
</header> | ||
|
||
{content && ( | ||
<> | ||
<hr className="mx-auto mt-16 w-20 border-slate-5" /> | ||
<main className="bg-white py-12"> | ||
<div className="prose mx-auto px-4 lg:prose-lg sm:px-6 lg:px-8"> | ||
<DocumentRenderer document={content} slug={slug} /> | ||
</div> | ||
</main> | ||
</> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export async function generateStaticParams() { | ||
const slugs = await reader.collections.projects.list(); | ||
|
||
return slugs.map(slug => ({ | ||
slug, | ||
})); | ||
} | ||
|
||
export async function generateMetadata( | ||
{ params }: { params: { slug: string } }, | ||
parent: ResolvingMetadata | ||
): Promise<Metadata> { | ||
const slug = params.slug; | ||
const project = await reader.collections.projects.read(slug); | ||
|
||
const parentTitle = (await parent).title ?? 'Showcase'; | ||
const title = project?.title ?? parentTitle; | ||
|
||
const fallbackDescription = 'A project built with Keystatic'; | ||
const description = project?.summary ? project.summary : fallbackDescription; | ||
|
||
const image = `/og?title=${title}`; | ||
const parentTwitterSite = (await parent).twitter?.site ?? ''; | ||
|
||
return { | ||
title, | ||
description, | ||
openGraph: { | ||
title, | ||
description, | ||
url: `https://keystatic.com/showcase/${slug}`, | ||
type: 'website', | ||
images: [{ url: image }], | ||
}, | ||
twitter: { | ||
card: 'summary_large_image', | ||
title, | ||
description, | ||
site: parentTwitterSite, | ||
}, | ||
}; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
antialiased
class here is responsible for the whole site feeling a bit "thinner".Uploading antialiased.mov…