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
59 changes: 59 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy Docs to GitHub Pages

on:
push:
branches:
- main
paths:
- 'website/**'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
working-directory: website
run: npm install

- name: Build
working-directory: website
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: website/out

deploy:
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

25 changes: 25 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Dependencies
node_modules/

# Next.js
.next/
out/

# Build
dist/

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Local env files
.env*.local

# Vercel
.vercel

# TypeScript
*.tsbuildinfo
next-env.d.ts

23 changes: 23 additions & 0 deletions website/app/[[...mdxPath]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { generateStaticParamsFor, importPage } from 'nextra/pages';
import { useMDXComponents } from 'nextra-theme-docs';

export const generateStaticParams = generateStaticParamsFor('mdxPath');

export async function generateMetadata(props: { params: Promise<{ mdxPath?: string[] }> }) {
const params = await props.params;
const { metadata } = await importPage(params.mdxPath);
return metadata;
}

export default async function Page(props: { params: Promise<{ mdxPath?: string[] }> }) {
const params = await props.params;
const result = await importPage(params.mdxPath);
const { default: MDXContent, ...rest } = result;
const { wrapper: Wrapper } = useMDXComponents();

return (
<Wrapper {...rest}>
<MDXContent />
</Wrapper>
);
}
20 changes: 20 additions & 0 deletions website/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
:root {
--nextra-primary-hue: 263deg;
--nextra-primary-saturation: 70%;
}

/* Add padding to card content */
[class*="nextra-card"] {
padding: 1.25rem !important;
}

[class*="nextra-card"] p {
margin-top: 0.5rem;
line-height: 1.6;
}

/* Add gap between cards */
[class*="nextra-cards"] {
gap: 1rem !important;
}

42 changes: 42 additions & 0 deletions website/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Head } from 'nextra/components';
import { getPageMap } from 'nextra/page-map';
import { Footer, Layout, Navbar } from 'nextra-theme-docs';
import 'nextra-theme-docs/style.css';
import './globals.css';

export const metadata = {
title: {
default: 'playwright-core',
template: '%s | playwright-core',
},
description:
'Annotation-driven Playwright testing infrastructure for better observability and traceability',
};

const logo = (
<span style={{ fontWeight: 'bold' }}>
<span style={{ color: '#7c3aed' }}>playwright</span>-core
</span>
);

export default async function RootLayout({ children }: { children: React.ReactNode }) {
const pageMap = await getPageMap();

return (
<html lang="en" dir="ltr" suppressHydrationWarning>
<Head faviconGlyph="🎭" />
<body>
<Layout
pageMap={pageMap}
docsRepositoryBase="https://github.com/lytics/playwright-core/tree/main/website/content"
editLink="Edit this page on GitHub"
sidebar={{ defaultMenuCollapseLevel: 1 }}
navbar={<Navbar logo={logo} projectLink="https://github.com/lytics/playwright-core" />}
footer={<Footer>MIT {new Date().getFullYear()} © Contentstack</Footer>}
>
{children}
</Layout>
</body>
</html>
);
}
14 changes: 14 additions & 0 deletions website/content/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default {
index: {
title: 'Home',
type: 'page',
display: 'hidden',
theme: {
layout: 'full',
},
},
docs: {
title: 'Documentation',
type: 'page',
},
};
11 changes: 11 additions & 0 deletions website/content/docs/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
index: 'Getting Started',
quickstart: 'Quickstart',
concepts: 'Core Concepts',
'---': {
type: 'separator',
},
annotations: 'Annotations',
reporter: 'Reporter',
adapters: 'Adapters',
};
6 changes: 6 additions & 0 deletions website/content/docs/adapters/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
index: 'Overview',
filesystem: 'Filesystem',
slack: 'Slack',
firestore: 'Firestore',
};
Loading