Skip to content

Redesign (v2) #873

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

Merged
merged 38 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
965b7cb
all in one
dimaMachina Jul 29, 2024
7b76e23
add temporarily missing images to make build pass
dimaMachina Jul 29, 2024
4ab2788
use the-guild-org/shared-config/setup@v1
dimaMachina Jul 29, 2024
a985f4d
fix eslint
dimaMachina Jul 29, 2024
a8a962d
Update Dockerfile
dimaMachina Jul 29, 2024
2617f7e
Update packages/nextra-theme/src/index.tsx
dimaMachina Jul 30, 2024
34b345d
Update packages/nextra-theme/src/index.tsx
dimaMachina Jul 30, 2024
c82a4c1
Update website/scripts/fetch-remote-docs.ts
dimaMachina Jul 30, 2024
f74d9ed
Update fetch-remote-docs.ts
dimaMachina Jul 30, 2024
c7c4a76
Update website/scripts/fetch-remote-docs.ts
dimaMachina Jul 30, 2024
9ee3624
2/4 move `@graphprotocol/nextra-theme` to `@graphprotocol/docs` (#732)
dimaMachina Aug 15, 2024
fafb2cb
Update dependencies
benface Dec 4, 2024
ee5c7c3
Fix tests
benface Dec 4, 2024
040b706
Change `@` alias to `src/` and move some files around
benface Dec 4, 2024
e137aae
Start work on new design
benface Dec 4, 2024
9376f4e
Temp stuff
benface Dec 4, 2024
1991078
Try to fix CI
benface Dec 4, 2024
84cfb1b
Merge branch 'main' into v2
benface Jan 13, 2025
3abba65
Update dependencies
benface Jan 13, 2025
6e26e28
WIP
benface Jan 13, 2025
0e1cd2c
style updates (#854)
0xa3k5 Jan 17, 2025
44edce4
Merge branch 'main' into v2
benface Feb 2, 2025
c0697ea
Make search and locale switcher functional
benface Feb 3, 2025
c429f14
Add icons + refactor and improve how navigation groups are computed
benface Feb 5, 2025
f69063a
Add “partially selected” state
benface Feb 5, 2025
b55b921
Quick fix
benface Feb 5, 2025
65c0cab
Huge refactoring + add a bunch of missing components, still missing b…
benface Feb 10, 2025
041e679
Fixes and improvements (thanks AK for the feedback!)
benface Feb 11, 2025
f7e2453
Home page content + footer + fixes and tweaks
benface Feb 12, 2025
473ebe0
Fixes and tweaks
benface Feb 12, 2025
283a811
Squash some TODOs
benface Feb 13, 2025
7f4a8ae
Remove console log
benface Feb 13, 2025
6498fc3
style tweaks for home page (#872)
0xa3k5 Feb 13, 2025
f463153
Make 404 page work + improve footer + last couple tweaks and fixes
benface Feb 13, 2025
ef937a4
Merge branch 'main' into v2
benface Feb 13, 2025
2c6a8af
Missed this in the merge
benface Feb 13, 2025
ba70c85
Use `sidebarTitle` instead of `_meta.js`
benface Feb 13, 2025
af07690
Last minute fixes
benface Feb 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

const isVSCode = Boolean(process.env.VSCODE_PID)

/** @type {import('eslint').Linter.Config} */
Expand All @@ -21,7 +23,11 @@ module.exports = {
// Only lint the English pages because the Markdown for the other languages is auto-generated from English (via Crowdin).
// But include all languages when running the ESLint extension in VS Code (in case the user has "eslint.validate": ["mdx"]),
// otherwise there will be random errors since the non-English files don't match any ruleset.
files: [`website/pages/${!isVSCode ? 'en/' : ''}**/*.{md,mdx}`],
files: [`website/src/pages/${isVSCode ? '' : 'en/'}**/*.{md,mdx}`],
excludedFiles: [
'website/src/pages/*/subgraphs/developing/creating/graph-ts/*.md',
'website/src/pages/*/subgraphs/querying/graph-client/*.md',
],
parser: 'eslint-mdx',
processor: 'mdx/remark',
plugins: ['mdx'],
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/ci-cd-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm
uses: the-guild-org/shared-config/setup@v1

- name: Install dependencies
run: pnpm install
Expand All @@ -43,10 +40,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm
uses: the-guild-org/shared-config/setup@v1

- name: Install dependencies
run: pnpm install
Expand All @@ -67,10 +61,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm
uses: the-guild-org/shared-config/setup@v1

- name: Install dependencies
run: pnpm install
Expand All @@ -92,10 +83,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm
uses: the-guild-org/shared-config/setup@v1

- name: Install dependencies
run: pnpm install
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/opengraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ jobs:
ref: ${{ env.COMMIT }}

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm
uses: the-guild-org/shared-config/setup@v1

- name: Deploy
working-directory: ./packages/og-image
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/website-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ jobs:
run: git fetch origin main

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm
uses: the-guild-org/shared-config/setup@v1

- name: Build Site
run: pnpm build
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ build/
.eslintcache
dist/
.turbo/
packages/og-image/vender/*.wasm
packages/og-image/vendor/*.wasm
.wrangler/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
out/
pnpm-lock.yaml
dist/
website/remote-files/*.json
# ignore below md since they are fetched from GitHub
website/src/pages/*/subgraphs/developing/creating/graph-ts/*.md
website/src/pages/*/subgraphs/querying/graph-client/*.md
8 changes: 7 additions & 1 deletion .remarkrc.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import remarkFrontmatter from 'remark-frontmatter'

/**
* This config is used by `eslint-plugin-mdx` to lint the MDX files, not by Nextra.
* Nextra uses the remark and rehype plugins registered in `next.config.js`, under `mdxOptions`.
*/
export default {
plugins: [
'frontmatter', // should be defined
remarkFrontmatter,
['remark-lint-first-heading-level', 2],
['remark-lint-restrict-elements', { type: 'heading', depth: 1 }],
'remark-lint-heading-increment',
Expand Down
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine as builder
FROM node:22-alpine AS builder

ARG ENVIRONMENT
ARG ORIGIN
Expand All @@ -14,14 +14,11 @@ RUN corepack enable pnpm

WORKDIR /app

COPY . .

# install the packages
RUN pnpm install --frozen-lockfile --ignore-scripts
COPY . ./

RUN pnpm install --frozen-lockfile
RUN pnpm build

## production environment
FROM nginx:1.16.0-alpine

COPY --from=builder ./app/nginx.conf /etc/nginx/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please read [`CONTRIBUTING.md`](https://github.com/graphprotocol/docs/blob/main/

## Local Setup

This project is built on [Next.js](https://nextjs.org/). You can run it on your machine, provided you have [Node 20+](https://nodejs.org/en/) and [`pnpm`](https://pnpm.io) installed.
This project is built on [Next.js](https://nextjs.org/). You can run it on your machine, provided you have [Node 22+](https://nodejs.org/en/) and [`pnpm`](https://pnpm.io) installed.

First, clone the repo:

Expand Down
10 changes: 4 additions & 6 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
preserve_hierarchy: 1
files:
- source: /website/pages/en/**/*.mdx
ignore:
- '/website/pages/en/**/\[\[...slug\]\].mdx'
translation: /website/pages/%two_letters_code%/**/%original_file_name%
- source: /website/src/pages/en/**/*.mdx
translation: /website/src/pages/%two_letters_code%/**/%original_file_name%
dest: /**/%original_file_name%
content_segmentation: 0
- source: /website/pages/en/**/*.json
translation: /website/pages/%two_letters_code%/**/%original_file_name%
- source: /website/src/pages/en/**/*.json
translation: /website/src/pages/%two_letters_code%/**/%original_file_name%
dest: /**/%original_file_name%
content_segmentation: 0
10 changes: 6 additions & 4 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ http {
root /usr/share/nginx/html;
index index.html index.htm;

# Short cache with revalidation
add_header Cache-Control "no-cache, must-revalidate";
expires 5m;

# Redirect `http` to `https`
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
Expand Down Expand Up @@ -150,13 +154,11 @@ http {

location / {
try_files $uri $uri.html $uri/index.html =404;

add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
expires -1;
}

# Use localized 404 pages for documentation paths
location ~ ^/docs/([a-zA-Z][a-zA-Z])/(.*) {
error_page 404 /docs/$1/404/index.html;
try_files $uri $uri.html $uri/index.html /docs/$1/404/index.html;
}

error_page 500 502 503 504 /docs/50x/index.html;
Expand Down
36 changes: 19 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
{
"name": "the-graph-docs-monorepo",
"name": "graph-docs",
"private": true,
"packageManager": "pnpm@10.1.0",
"version": "1.0.0",
"packageManager": "pnpm@10.3.0",
"scripts": {
"dev": "turbo run dev --parallel",
"dev": "turbo run dev",
"build": "NODE_OPTIONS='--max_old_space_size=4096' turbo run build",
"docker:build": "source ./website/.env.local && DOCKER_BUILDKIT=1 docker build . -t docs --no-cache --build-arg ENVIRONMENT=$ENVIRONMENT --build-arg ORIGIN=$ORIGIN",
"docker:clean": "docker builder prune",
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs",
"check": "pnpm typecheck && pnpm lint && pnpm prettier:check",
"check:fix": "pnpm lint:fix; pnpm prettier",
"lint": "eslint . --ignore-path .gitignore --max-warnings 0",
"lint:fix": "eslint . --ignore-path .gitignore --fix",
"prettier": "prettier . --write --list-different",
"prettier:check": "prettier . --check",
"typecheck": "turbo run typecheck",
"lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0",
"lint:fix": "eslint . --cache --ignore-path .gitignore --fix; pnpm prettier",
"prettier": "pnpm prettier:check --write",
"prettier:check": "prettier --cache --check .",
"test": "turbo run test"
"test": "turbo run test",
"docker:build": "source ./website/.env.local && DOCKER_BUILDKIT=1 docker build . -t docs --no-cache --build-arg ENVIRONMENT=$ENVIRONMENT --build-arg ORIGIN=$ORIGIN",
"docker:clean": "docker builder prune",
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs"
},
"devDependencies": {
"@edgeandnode/eslint-config": "^2.0.3",
"@types/node": "^22.13.4",
"eslint": "^8.57.1",
"eslint-plugin-mdx": "^2.3.4",
"prettier": "^3.4.2",
"eslint-plugin-mdx": "^3.1.5",
"prettier": "^3.5.1",
"prettier-plugin-tailwindcss": "^0.6.11",
"remark-frontmatter": "^5.0.0",
"remark-lint-first-heading-level": "^3.1.2",
"remark-lint-heading-increment": "^3.1.2",
"remark-lint-no-heading-punctuation": "^3.1.2",
"remark-lint-first-heading-level": "^4.0.1",
"remark-lint-heading-increment": "^4.0.1",
"remark-lint-no-heading-punctuation": "^4.0.1",
"remark-lint-restrict-elements": "workspace:*",
"turbo": "^1.13.4",
"turbo": "^2.4.2",
"typescript": "^5.7.3"
},
"resolutions": {
Expand Down
61 changes: 0 additions & 61 deletions packages/nextra-theme/package.json

This file was deleted.

23 changes: 0 additions & 23 deletions packages/nextra-theme/src/components/Callout.tsx

This file was deleted.

49 changes: 0 additions & 49 deletions packages/nextra-theme/src/components/Code.tsx

This file was deleted.

Loading
Loading