Skip to content

Commit 5ff9f44

Browse files
andreahlertskrawcz
andauthored
website: add Next.js landing page for burr.apache.org (#679)
* website: add Next.js landing page for burr.apache.org Add a modern landing page built with Next.js 15, Tailwind CSS and Magic UI that will serve as the homepage for burr.apache.org. Sphinx docs move from / to /docs/ so both coexist. Landing page sections: - Hero with animated stats (GitHub stars, PyPI downloads) - Interactive code terminal with syntax-highlighted examples - Feature highlights (state management, observability, HITL, etc.) - Integration marquee with real SVG logos - Testimonial carousel with existing quotes - Community links (Discord, GitHub, Twitter) - ASF-compliant footer (License, Thanks, Security, Sponsorship, Privacy Policy, Incubator link, trademark attribution, incubation disclaimer) Build & deploy changes: - New unified workflow (build-site.yml) that builds both Next.js and Sphinx, then merges outputs into asf-site branch - Landing page at / and Sphinx docs at /docs/ - sphinx-docs.yml retains build + artifact for PR review only (deploy removed to avoid conflicts) - Sphinx html_baseurl updated to include /docs/ prefix Tech stack: Next.js 15 (App Router), Tailwind CSS v4, shadcn/ui, Magic UI (Marquee, NumberTicker, ShimmerButton, BlurFade, BorderBeam, MagicCard, DotPattern, AnimatedShinyText), shiki for syntax highlighting. Static export for Apache infra compat. * add .htaccess redirects for old Sphinx paths and fix trailing newline Redirect old root-level Sphinx URLs (concepts/, getting_started/, etc.) to /docs/ with 301s so existing links and search results keep working after the landing page migration. Also fix missing newline at end of globals.css that was failing the pre-commit end-of-file-fixer hook. * docs: add logo and landing page link to Sphinx sidebar, add missing website constants - Add Burr logo to Sphinx docs sidebar, displayed inline with the title - Sidebar brand link points to / (landing page) instead of docs root - Add missing website/src/lib/constants.ts and utils.ts needed by Next.js - Gitignore built Sphinx docs in website/public/docs/ --------- Co-authored-by: Stefan Krawczyk <stefank@cs.stanford.edu>
1 parent 226288f commit 5ff9f44

43 files changed

Lines changed: 14046 additions & 72 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-site.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
#<!--
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#-->
19+
name: Build and Deploy Site
20+
21+
on:
22+
push:
23+
branches: [main]
24+
paths:
25+
- 'docs/**'
26+
- 'website/**'
27+
- '.github/workflows/build-site.yml'
28+
workflow_dispatch:
29+
30+
concurrency:
31+
group: "site-deploy"
32+
cancel-in-progress: true
33+
34+
jobs:
35+
build-and-deploy:
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
43+
# ── Build Next.js landing page ──
44+
- name: Set up Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: 20
48+
cache: npm
49+
cache-dependency-path: website/package-lock.json
50+
51+
- name: Install Node dependencies
52+
working-directory: ./website
53+
run: npm ci
54+
55+
- name: Build landing page
56+
working-directory: ./website
57+
run: npm run build
58+
59+
# ── Build Sphinx docs ──
60+
- name: Set up Python 3.12
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: '3.12'
64+
cache: 'pip'
65+
66+
- name: Install system dependencies
67+
run: |
68+
sudo apt-get update
69+
sudo apt-get install -y graphviz
70+
71+
- name: Install Sphinx and dependencies
72+
run: |
73+
python -m pip install --upgrade --no-cache-dir pip setuptools
74+
python -m pip install --upgrade --no-cache-dir sphinx sphinx-rtd-theme sphinx-simplepdf
75+
pip install -e ".[documentation]"
76+
77+
- name: Build Sphinx documentation
78+
working-directory: ./docs
79+
run: |
80+
python -m sphinx -T -W --keep-going -b dirhtml -d _build/doctrees -D language=en . _build/html
81+
82+
# ── Merge outputs and deploy ──
83+
- name: Assemble site
84+
run: |
85+
mkdir -p /tmp/site-output
86+
87+
# Landing page at root
88+
cp -r website/out/* /tmp/site-output/
89+
90+
# Sphinx docs at /docs/
91+
mkdir -p /tmp/site-output/docs
92+
cp -r docs/_build/html/* /tmp/site-output/docs/
93+
94+
# Redirects for old Sphinx paths
95+
cp .htaccess /tmp/site-output/
96+
97+
echo "Site structure:"
98+
ls -la /tmp/site-output/
99+
echo "Docs:"
100+
ls -la /tmp/site-output/docs/ | head -20
101+
102+
- name: Deploy to asf-site / asf-staging
103+
if: github.event_name != 'pull_request'
104+
run: |
105+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
106+
TARGET_BRANCH="asf-site"
107+
else
108+
TARGET_BRANCH="asf-staging"
109+
fi
110+
111+
git config --global user.name "GitHub Actions"
112+
git config --global user.email "actions@github.com"
113+
114+
mkdir -p /tmp/gh-pages
115+
116+
if ! git clone --branch $TARGET_BRANCH --single-branch \
117+
https://github.com/${{ github.repository }}.git /tmp/gh-pages 2>/dev/null; then
118+
rm -rf /tmp/gh-pages
119+
mkdir -p /tmp/gh-pages
120+
cd /tmp/gh-pages
121+
git init
122+
git checkout -b $TARGET_BRANCH
123+
git remote add origin https://github.com/${{ github.repository }}.git
124+
cd -
125+
fi
126+
127+
rm -rf /tmp/gh-pages/content
128+
mkdir -p /tmp/gh-pages/content
129+
cp -r /tmp/site-output/* /tmp/gh-pages/content/
130+
131+
cd /tmp/gh-pages
132+
133+
if [ ! -f README.md ]; then
134+
echo "# Apache Burr Website" > README.md
135+
echo "This branch contains the built site (landing page + docs)." >> README.md
136+
fi
137+
138+
git add -A
139+
140+
if [ -n "$(git status --porcelain)" ]; then
141+
git commit -m "Deploy site from ${{ github.sha }}"
142+
git push https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git $TARGET_BRANCH
143+
echo "Deployed to $TARGET_BRANCH"
144+
else
145+
echo "No changes to deploy"
146+
fi

.github/workflows/sphinx-docs.yml

Lines changed: 3 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -85,73 +85,6 @@ jobs:
8585
path: docs/_build/pdf/
8686
retention-days: 5
8787

88-
- name: Deploy documentation
89-
working-directory: ./docs
90-
run: |
91-
# Set target branch based on current branch
92-
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
93-
TARGET_BRANCH="asf-site"
94-
echo "Deploying to production (asf-site) branch"
95-
else
96-
TARGET_BRANCH="asf-staging"
97-
echo "Deploying to staging (asf-staging) branch"
98-
fi
99-
100-
# Configure git
101-
git config --global user.name "GitHub Actions"
102-
git config --global user.email "actions@github.com"
103-
104-
# Create a temporary directory
105-
mkdir -p /tmp/gh-pages
106-
107-
# Store current directory
108-
CURRENT_DIR=$(pwd)
109-
ls -lsa $CURRENT_DIR
110-
111-
# Try to clone the repository with the target branch
112-
if ! git clone --branch $TARGET_BRANCH --single-branch \
113-
https://github.com/${{ github.repository }}.git /tmp/gh-pages 2>/dev/null; then
114-
# If branch doesn't exist, initialize a new repository and create the branch
115-
echo "Branch $TARGET_BRANCH doesn't exist. Creating it..."
116-
rm -rf /tmp/gh-pages
117-
mkdir -p /tmp/gh-pages
118-
cd /tmp/gh-pages
119-
git init
120-
git config --local init.defaultBranch $TARGET_BRANCH
121-
git checkout -b $TARGET_BRANCH
122-
git remote add origin https://github.com/${{ github.repository }}.git
123-
cd "$CURRENT_DIR"
124-
else
125-
echo "CD'ing into $CURRENT_DIR"
126-
cd "$CURRENT_DIR"
127-
fi
128-
129-
# Remove existing content directory if it exists
130-
rm -rf /tmp/gh-pages/content
131-
132-
# # Ensure build directories exist
133-
# mkdir -p "$CURRENT_DIR/_build/html"
134-
135-
# Copy the built HTML documentation to the content directory
136-
mkdir -p /tmp/gh-pages/content
137-
cp -r "$CURRENT_DIR/_build/html/"* /tmp/gh-pages/content/ 2>/dev/null || echo "No HTML files to copy"
138-
139-
# Add, commit and push the changes
140-
cd /tmp/gh-pages
141-
git status
142-
ls -lhsa content
143-
# Create a README if it doesn't exist
144-
if [ ! -f README.md ]; then
145-
echo "# Documentation for $TARGET_BRANCH" > README.md
146-
echo "This branch contains the built documentation." >> README.md
147-
fi
148-
git add -A
149-
git status
150-
# Check if there are changes to commit (including untracked files)
151-
if [ -n "$(git status --porcelain)" ]; then
152-
git commit -m "Deploy documentation from ${{ github.sha }}"
153-
git push https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git $TARGET_BRANCH
154-
echo "Changes pushed to $TARGET_BRANCH branch"
155-
else
156-
echo "No changes to deploy"
157-
fi
88+
# NOTE: Deployment to asf-site is now handled by build-site.yml
89+
# which builds both the landing page and Sphinx docs together.
90+
# This workflow only builds + uploads artifacts for PR review.

.htaccess

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Redirect old Sphinx root paths to /docs/ after landing page migration.
19+
# The Sphinx docs moved from / to /docs/ when the Next.js landing page
20+
# was introduced at the site root.
21+
22+
RewriteEngine On
23+
24+
# Sphinx doc sections that moved to /docs/
25+
RewriteRule ^concepts/(.*)$ /docs/concepts/$1 [R=301,L]
26+
RewriteRule ^getting_started/(.*)$ /docs/getting_started/$1 [R=301,L]
27+
RewriteRule ^reference/(.*)$ /docs/reference/$1 [R=301,L]
28+
RewriteRule ^examples/(.*)$ /docs/examples/$1 [R=301,L]
29+
RewriteRule ^contributing/(.*)$ /docs/contributing/$1 [R=301,L]
30+
RewriteRule ^asf/(.*)$ /docs/asf/$1 [R=301,L]
31+
32+
# Sphinx static assets and internals
33+
RewriteRule ^_static/(.*)$ /docs/_static/$1 [R=301,L]
34+
RewriteRule ^_sources/(.*)$ /docs/_sources/$1 [R=301,L]
35+
RewriteRule ^genindex/?$ /docs/genindex/ [R=301,L]
36+
RewriteRule ^search/?$ /docs/search/ [R=301,L]

docs/_static/burr_logo.svg

Lines changed: 102 additions & 0 deletions
Loading

docs/_static/custom.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,21 @@
8282
[data-theme="dark"] .apache-footer a {
8383
color: var(--color-link) !important;
8484
}
85+
86+
/* Sidebar brand: logo inline with title */
87+
.sidebar-brand {
88+
display: flex;
89+
align-items: center;
90+
gap: 0.5rem;
91+
flex-direction: row;
92+
}
93+
94+
.sidebar-brand img {
95+
height: 1.5rem;
96+
width: auto;
97+
margin: 0;
98+
}
99+
100+
.sidebar-brand .sidebar-brand-text {
101+
margin: 0;
102+
}

docs/_templates/page.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,11 @@
3939
})();
4040
</script>
4141
<!-- End Matomo Code -->
42+
<!-- Point sidebar brand link to landing page -->
43+
<script>
44+
document.addEventListener("DOMContentLoaded", function() {
45+
var brand = document.querySelector(".sidebar-brand");
46+
if (brand) brand.href = "/";
47+
});
48+
</script>
4249
{% endblock %}

0 commit comments

Comments
 (0)