Skip to content

Commit

Permalink
Change to vitepress
Browse files Browse the repository at this point in the history
  • Loading branch information
longzheng committed Oct 18, 2024
1 parent 53c6261 commit 6da3012
Show file tree
Hide file tree
Showing 47 changed files with 5,229 additions and 17,957 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ LICENSE
README.md

/config/
/logs/
/logs/
/docs/
28 changes: 18 additions & 10 deletions .github/workflows/docs-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ on:
- 'docs/**'

jobs:
deploy:
build:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages
steps:
- uses: actions/checkout@v4

Expand All @@ -24,15 +20,27 @@ jobs:
cache: 'npm'

- run: npm ci
working-directory: ./docs

- run: npm run build
working-directory: ./docs
- run: npm run docs:build

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/.vitepress/dist

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: docs
path: docs

- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
workingDirectory: "docs"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy build --project-name=open-dynamic-export
command: pages deploy docs --project-name=open-dynamic-export
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,8 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*

# Vitepress
docs/.vitepress/dist
docs/.vitepress/cache
20 changes: 0 additions & 20 deletions docs/.gitignore

This file was deleted.

43 changes: 43 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { defineConfig } from 'vitepress';

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Open Dynamic Export',
description: 'Free open-source inverter curtailment',
appearance: 'force-dark',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: '/logo.svg',

nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide' },
],

sidebar: [
{
text: 'Guide',
items: [
{ text: 'Introduction', link: '/introduction' },
{ text: 'Getting started', link: '/getting-started' },
{ text: 'Configuration', link: '/configuration' },
{ text: 'Supported devices', link: '/supported-devices' },
],
},
{
text: 'CSIP-AUS',
items: [
{ text: 'Queensland', link: '/csip-qld' },
{ text: 'Other states', link: '/csip-other' },
],
},
],

socialLinks: [
{
icon: 'github',
link: 'https://github.com/longzheng/open-dynamic-export',
},
],
},
});
7 changes: 7 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* .vitepress/theme/custom.css */
:root {
--vp-c-brand-1: #42F35D;
--vp-c-brand-2: #37D64F;
--vp-c-brand-3: #2CB941;
--vp-c-brand-soft: #58B366;
}
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from 'vitepress/theme';
import './custom.css';

export default DefaultTheme;
41 changes: 0 additions & 41 deletions docs/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

47 changes: 0 additions & 47 deletions docs/docs/intro.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/docs/tutorial-basics/_category_.json

This file was deleted.

23 changes: 0 additions & 23 deletions docs/docs/tutorial-basics/congratulations.md

This file was deleted.

34 changes: 0 additions & 34 deletions docs/docs/tutorial-basics/create-a-blog-post.md

This file was deleted.

57 changes: 0 additions & 57 deletions docs/docs/tutorial-basics/create-a-document.md

This file was deleted.

Loading

0 comments on commit 6da3012

Please sign in to comment.