Skip to content

Commit

Permalink
docs: new docs website using Astro + Starlight (grafana#1025)
Browse files Browse the repository at this point in the history
* docs: new docs website

* Update .github/workflows/publish-page.yml

* update dist path for previews

* fix base path

* Fix links/base path

* comment out unneeded input

* fix typos

* change base

* Create .nojekyll file

* Add favicon

* Do not build docker image for PRs if only docs change

* Fix local configuration and re-add prettier for VSCode formatting

* fix links for dev & prod

* make links relative to base, override TOC to work with base

* change CTA text

* Replace docs/README.md

* Remove unused commands from package.json

* Include sidebar also on the startpage

* Fix search box position on startpage (tnx @Elfo404)

* Deploy the dist folder on main

---------

Co-authored-by: Horst Gutmann <[email protected]>
  • Loading branch information
Elfo404 and zerok authored May 23, 2024
1 parent b41c765 commit 49c9b07
Show file tree
Hide file tree
Showing 100 changed files with 7,198 additions and 29,129 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
pull_request:
branches:
- '*'
paths-ignore:
- 'docs/**'
- '.github/workflows/publish-page.yml'

permissions:
contents: read
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/publish-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,42 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: 'pnpm'
cache-dependency-path: 'docs'

- name: Install and Build
working-directory: docs
env:
# Main: https://tanka.dev/
# PRs: https://tanka.dev/pr-preview/pr-{number}/
PATH_PREFIX: "${{ github.event_name == 'pull_request' && format('/pr-preview/pr-{0}', github.event.number) || '' }}"
PATH_PREFIX: "${{ github.event_name == 'pull_request' && format('/pr-preview/pr-{0}/', github.event.number) || '' }}"
run: |
yarn install
yarn build
# Create .nojekyll file to allow for additional files to be published
# according to
# <https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/>
touch ./public/.nojekyll
pnpm install
pnpm build
if [ -d "./public" ]; then
touch ./public/.nojekyll
fi
if [ -d "./dist" ]; then
touch ./dist/.nojekyll
fi
- name: Deploy main
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
with:
clean-exclude: pr-preview/
folder: ./docs/public/
folder: ./docs/dist/

- name: Deploy preview
if: github.event_name == 'pull_request'
uses: rossjrw/pr-preview-action@v1
with:
deploy-repository: ${{ github.event.pull_request.head.repo.full_name }}
source-dir: ./docs/public/
source-dir: ./docs/dist/
80 changes: 13 additions & 67 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,75 +1,21 @@
.docz
# build output
dist/
# generated types
.astro/

# Logs
logs
*.log
# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# Typescript v1 declaration files
typings/
# environment variables
.env
.env.production

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variable files
.env*

# gatsby files
public
.cache

# Mac files
# macOS-specific files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity

# gatsby-remark-vscode extensions are required tho
node_modules/*
!/node_modules/vscext
!/node_modules/vscext/*
1 change: 0 additions & 1 deletion docs/.node-version

This file was deleted.

4 changes: 0 additions & 4 deletions docs/.prettierignore

This file was deleted.

6 changes: 2 additions & 4 deletions docs/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
"singleQuote": true,
"tabWidth": 2
}

This file was deleted.

42 changes: 0 additions & 42 deletions docs/.vscext/Equinusocio.vsc-material-theme/extension.vsixmanifest

This file was deleted.

Loading

0 comments on commit 49c9b07

Please sign in to comment.