-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [M3-7538] - Cloud Manager Docs with Vitepress (#10027)
* Initial commit - config * Add GHA * cleanup * cleanup * clean comments * clean plugin * remove setup node * replace npx with bunx * fix assets paths * Added changeset: Cloud Manager Documentation microsite with vitepress * fix typo * Feedback * Feedback 2
- Loading branch information
1 parent
e5efd97
commit cffed4f
Showing
12 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy Cloud Manager Docs | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
|
||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: 1.0.21 | ||
|
||
- name: Build with VitePress | ||
run: bunx vitepress@1.0.0-rc.35 build docs | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
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@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { guides } from "./plugins/sidebar"; | ||
|
||
export default { | ||
title: "Cloud Manager Docs", | ||
description: "Akamai Cloud Manger Documentation", | ||
srcDir: "./", | ||
base: "/manager/", | ||
themeConfig: { | ||
logo: "/akamai-wave.svg", | ||
nav: [ | ||
{ text: "Home", link: "/" }, | ||
{ text: "Getting Started", link: "/GETTING_STARTED" }, | ||
{ text: "Contributing", link: "/CONTRIBUTING" }, | ||
], | ||
search: { | ||
provider: "local", | ||
}, | ||
sidebar: [ | ||
{ | ||
text: "Development Guide", | ||
items: guides, | ||
}, | ||
], | ||
socialLinks: [ | ||
{ icon: "github", link: "https://github.com/linode/manager" }, | ||
], | ||
}, | ||
head: [["link", { rel: "icon", href: "/manager/favicon.ico" }]], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as fs from "fs"; | ||
import * as path from "path"; | ||
|
||
const DEVELOPMENT_GUIDE_PATH = "./docs/development-guide"; | ||
|
||
interface MarkdownInfo { | ||
text: string; | ||
link: string; | ||
} | ||
|
||
/** | ||
* Aggregates the pages in the development-guide and populates the left sidebar. | ||
*/ | ||
const scanDirectory = (directoryPath: string): MarkdownInfo[] => { | ||
const markdownFiles = fs | ||
.readdirSync(directoryPath) | ||
.filter((file) => file.endsWith(".md")); | ||
const markdownInfoArray: MarkdownInfo[] = []; | ||
|
||
markdownFiles.forEach((file) => { | ||
const filePath = path.join(directoryPath, file); | ||
const fileContent = fs.readFileSync(filePath, "utf-8"); | ||
|
||
const titleMatch = fileContent.match(/^#\s+(.*)/m); | ||
const title = titleMatch ? titleMatch[1] : "Untitled"; | ||
|
||
const markdownInfo: MarkdownInfo = { | ||
text: title, | ||
link: `/development-guide/${file}`, | ||
}; | ||
|
||
markdownInfoArray.push(markdownInfo); | ||
}); | ||
|
||
return markdownInfoArray; | ||
}; | ||
|
||
export const guides = scanDirectory(DEVELOPMENT_GUIDE_PATH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Akamai Cloud Manager Documentation | ||
|
||
## Get Started | ||
|
||
To setup Cloud Manager and get ready for development, process to the [get started docs](GETTING_STARTED.md). | ||
|
||
## Contributing | ||
|
||
If you already have your development environment set up, please read the [contributing guidelines](CONTRIBUTING.md) to get help in creating your first Pull Request. | ||
|
||
To report a bug or request a feature in Cloud Manager, please [open a GitHub Issue](https://github.com/linode/manager/issues/new). For general feedback, use [linode.com/feedback](https://www.linode.com/feedback/). | ||
|
||
## Development Guide | ||
|
||
Please consult our [development guide](development-guide/01-repository-structure.md) to start contributing! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Added | ||
--- | ||
|
||
Cloud Manager Documentation microsite with vitepress ([#10027](https://github.com/linode/manager/pull/10027)) |