Skip to content

Commit

Permalink
Merge branch 'master' into add-plugin-location
Browse files Browse the repository at this point in the history
  • Loading branch information
edvardsanta authored Aug 2, 2023
2 parents b0a749d + 624604a commit 5262799
Show file tree
Hide file tree
Showing 50 changed files with 1,551 additions and 5,725 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "20"

- name: Cache dependencies
uses: actions/cache@v3
Expand All @@ -42,18 +42,18 @@ jobs:
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install

- name: Build VuePress site
- name: Build VitePress site
run: npm run build

- name: Bundle CNAME with site dist
run: cp CNAME .vuepress/dist
run: cp CNAME .vitepress/dist

- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
with:
# deploy to gh-pages branch
target_branch: gh-pages
# deploy the default output dir of VuePress
build_dir: docs/.vuepress/dist
# deploy the default output dir of VitePress
build_dir: docs/.vitepress/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion asdf.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if test -z $ASDF_DIR
set ASDF_DIR (realpath (dirname (status filename)))
set ASDF_DIR (realpath --no-symlinks (dirname (status filename)))
end
set --export ASDF_DIR $ASDF_DIR

Expand Down
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Custom ###
# VitePress build output & cache directory
.vitepress/cache
.vitepress/dist

# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node
Expand Down
6 changes: 6 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# VitePress build output & cache directory
.vitepress/cache
.vitepress/dist
node_modules
package.json
package-lock.json
2 changes: 1 addition & 1 deletion docs/.tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 18.12.1
nodejs 20.2.0
46 changes: 46 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { defineConfig } from "vitepress";
import * as navbars from "./navbars";
import * as sidebars from "./sidebars";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "asdf",
description: "Manage multiple runtime versions with a single CLI tool",
lastUpdated: true,
locales: {
root: {
label: "English",
lang: "en-US",
themeConfig: {
nav: navbars.en,
sidebar: sidebars.en,
},
},
"pt-br": {
label: "Brazilian Portuguese",
lang: "pr-br",
themeConfig: {
nav: navbars.pt_br,
sidebar: sidebars.pt_br,
},
},
"zh-hans": {
label: "简体中文",
lang: "zh-hans",
themeConfig: {
nav: navbars.zh_hans,
sidebar: sidebars.zh_hans,
},
},
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
search: {
provider: "local",
},
socialLinks: [
{ icon: "github", link: "https://github.com/asdf-vm/asdf" },
// { icon: "twitter", link: "https://twitter.com/asdf_vm" },
],
},
});
71 changes: 71 additions & 0 deletions docs/.vitepress/navbars.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import path from "path";
import fs from "fs";
import process from "process";

export const getVersion = () => {
const versionFilepath = path.join(__dirname, "../../version.txt");
try {
const version = fs.readFileSync(versionFilepath, "utf8").trim();
console.log(`Found version ${version} from ${versionFilepath}`);
return version;
} catch (error) {
console.error(`Failed to find version from file ${versionFilepath}`, error);
process.exit(1);
}
};

const en = [
{ text: "Guide", link: "/guide/getting-started" },
{
text: "Reference",
link: "/manage/configuration",
},
{
text: getVersion(),
items: [
{
text: "Changelog",
link: "https://github.com/asdf-vm/asdf/blob/master/CHANGELOG.md",
},
{ text: "Contribute", link: "/contribute/core" },
],
},
];

const pt_br = [
{ text: "Guia", link: "/pt-br/guide/getting-started" },
{
text: "Referência",
link: "/pt-br/manage/configuration",
},
{
text: getVersion(),
items: [
{
text: "Changelog",
link: "https://github.com/asdf-vm/asdf/blob/master/CHANGELOG.md",
},
{ text: "Contribute", link: "/pt-br/contribute/core" },
],
},
];

const zh_hans = [
{ text: "指导", link: "/zh-hans/guide/getting-started" },
{
text: "参考",
link: "/zh-hans/manage/configuration",
},
{
text: getVersion(),
items: [
{
text: "Changelog",
link: "https://github.com/asdf-vm/asdf/blob/master/CHANGELOG.md",
},
{ text: "如何贡献", link: "/zh-hans/contribute/core" },
],
},
];

export { en, pt_br, zh_hans };
Loading

0 comments on commit 5262799

Please sign in to comment.