Skip to content
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

Docs site for inertia-django adapter #67

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
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
55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy Docs

on:
push:
branches: [main]

workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci
- name: Build with VitePress
run: npm run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.vitepress/dist
.vitepress/cache
107 changes: 107 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import { defineConfig } from "vitepress";

const title = "Inertia Django";
const description = "Build single page apps, without building an API";
const site = "https://inertiajs.com";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to my comment from earlier: I'm not sure what this should be. I guess it depends on where we decide to host the docs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm double checking right now with some of our users, I'll answer here asap. Thank you for checking!

const image = `${site}/og_image.png`;

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: title,
description: description,

cleanUrls: true,

head: [
["link", { rel: "icon", href: "/favicon.ico", sizes: "32x32" }],
["link", { rel: "icon", href: "/icon.svg", type: "image/svg+xml" }],

["meta", { name: "twitter:card", content: "summary_large_image" }],
["meta", { name: "twitter:site", content: site }],
["meta", { name: "twitter:description", value: description }],
["meta", { name: "twitter:image", content: image }],

["meta", { property: "og:type", content: "website" }],
["meta", { property: "og:locale", content: "en_US" }],
["meta", { property: "og:site", content: site }],
["meta", { property: "og:site_name", content: title }],
["meta", { property: "og:image", content: image }],
["meta", { property: "og:description", content: description }],
],

themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/" },
{ text: "Guide", link: "/guide" },
{
text: "Links",
items: [
{
text: "Official Inertia.js docs",
link: "https://inertiajs.com",
},
{
text: "inertia-django on PyPI",
link: "https://pypi.org/project/inertia-django",
},
],
},
],

logo: "/logo.svg",

sidebar: {
"/guide/": [
{
items: [{ text: "Introduction", link: "/guide" }],
},
{
text: "Installation",
items: [
{
text: "Server-side",
link: "/guide/server-side-setup",
},
{
text: "Client-side",
link: "/guide/client-side-setup",
},
],
},
{
text: "Core concepts",
items: [
{ text: "Who is it for", link: "/guide/who-is-it-for" },
{ text: "How it works", link: "/guide/how-it-works" },
{ text: "The protocol", link: "/guide/the-protocol" },
],
},
{
text: "The basics",
items: [{ text: "Links", link: "/guide/links" }],
},
{
text: "Advanced",
items: [
{
text: "Scroll management",
link: "/guide/scroll-management",
},
{
text: "Code splitting",
link: "/guide/code-splitting",
},
],
},
],
},

socialLinks: [
{
icon: "github",
link: "https://github.com/inertiajs/inertia-django",
},
],
},
});
Loading