Skip to content

Commit 72b6ee7

Browse files
Docs site for inertia-django adapter (#67)
* initial docs scaffold * core concepts pages * Basics section - Links * add pages later * add links * add logo * update actions and logo on index page * mv images to public dir and add og_image * minor formatting changes * use title, description, and image defined top of file * add code-splitting and scroll-management to avoid broken links * client side setup * scaffold for server side setup * update install link * partial reload scaffold * update config with new links * action to depoy to GH pages * update client-side setup docs * add server-side setup docs - template based setup - manual setup * update package-lock.json * add sections to manual installation * Add new domain name!
1 parent 2f50f7d commit 72b6ee7

20 files changed

+3975
-0
lines changed

.github/workflows/docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
workflow_dispatch:
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
- name: Setup Node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
cache: npm
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v4
36+
- name: Install dependencies
37+
run: npm ci
38+
- name: Build with VitePress
39+
run: npm run docs:build
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: docs/.vitepress/dist
44+
45+
deploy:
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
needs: build
50+
runs-on: ubuntu-latest
51+
name: Deploy
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.vitepress/dist
3+
.vitepress/cache

docs/.vitepress/config.mts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import { defineConfig } from "vitepress";
2+
3+
const title = "Inertia Django";
4+
const description = "Build single page apps, without building an API";
5+
const site = "https://inertia-django.dev";
6+
const image = `${site}/og_image.png`;
7+
8+
// https://vitepress.dev/reference/site-config
9+
export default defineConfig({
10+
title: title,
11+
description: description,
12+
13+
cleanUrls: true,
14+
15+
head: [
16+
["link", { rel: "icon", href: "/favicon.ico", sizes: "32x32" }],
17+
["link", { rel: "icon", href: "/icon.svg", type: "image/svg+xml" }],
18+
19+
["meta", { name: "twitter:card", content: "summary_large_image" }],
20+
["meta", { name: "twitter:site", content: site }],
21+
["meta", { name: "twitter:description", value: description }],
22+
["meta", { name: "twitter:image", content: image }],
23+
24+
["meta", { property: "og:type", content: "website" }],
25+
["meta", { property: "og:locale", content: "en_US" }],
26+
["meta", { property: "og:site", content: site }],
27+
["meta", { property: "og:site_name", content: title }],
28+
["meta", { property: "og:image", content: image }],
29+
["meta", { property: "og:description", content: description }],
30+
],
31+
32+
themeConfig: {
33+
// https://vitepress.dev/reference/default-theme-config
34+
nav: [
35+
{ text: "Home", link: "/" },
36+
{ text: "Guide", link: "/guide" },
37+
{
38+
text: "Links",
39+
items: [
40+
{
41+
text: "Official Inertia.js docs",
42+
link: "https://inertiajs.com",
43+
},
44+
{
45+
text: "inertia-django on PyPI",
46+
link: "https://pypi.org/project/inertia-django",
47+
},
48+
],
49+
},
50+
],
51+
52+
logo: "/logo.svg",
53+
54+
sidebar: {
55+
"/guide/": [
56+
{
57+
items: [{ text: "Introduction", link: "/guide" }],
58+
},
59+
{
60+
text: "Installation",
61+
items: [
62+
{
63+
text: "Server-side",
64+
link: "/guide/server-side-setup",
65+
},
66+
{
67+
text: "Client-side",
68+
link: "/guide/client-side-setup",
69+
},
70+
],
71+
},
72+
{
73+
text: "Core concepts",
74+
items: [
75+
{ text: "Who is it for", link: "/guide/who-is-it-for" },
76+
{ text: "How it works", link: "/guide/how-it-works" },
77+
{ text: "The protocol", link: "/guide/the-protocol" },
78+
],
79+
},
80+
{
81+
text: "The basics",
82+
items: [{ text: "Links", link: "/guide/links" }],
83+
},
84+
{
85+
text: "Advanced",
86+
items: [
87+
{
88+
text: "Scroll management",
89+
link: "/guide/scroll-management",
90+
},
91+
{
92+
text: "Code splitting",
93+
link: "/guide/code-splitting",
94+
},
95+
],
96+
},
97+
],
98+
},
99+
100+
socialLinks: [
101+
{
102+
icon: "github",
103+
link: "https://github.com/inertiajs/inertia-django",
104+
},
105+
],
106+
},
107+
});

0 commit comments

Comments
 (0)