Skip to content

Commit

Permalink
Merge branch 'pocketnetteam:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gked authored Nov 3, 2024
2 parents f63b7a5 + 2c42f1d commit ea159c7
Show file tree
Hide file tree
Showing 234 changed files with 6,308 additions and 142 deletions.
66 changes: 13 additions & 53 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,6 @@ on:

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install
run: npm i

- name: Build
run: npm run build

- name: Save Artifact Build
uses: actions/upload-artifact@v3
with:
name: build
path: build/
retention-days: 1

- name: Save Artifact Assets
uses: actions/upload-artifact@v3
with:
name: assets
path: assets/
retention-days: 1

build_vue:
runs-on: ubuntu-latest
steps:
Expand All @@ -45,7 +17,6 @@ jobs:
node-version: 20
- name: Build
run: |
cd ./vuepress-starter/
npm i
npm run docs:build
- name: Save Artifact Build
Expand All @@ -54,36 +25,25 @@ jobs:
name: dist
path: ./vuepress-starter/docs/.vuepress/dist/
retention-days: 1

deploy_win:
runs-on: docs-en-deploy
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Copy artifacts
run: |
cp -Recurse -Force ./build/site/* c:/inetpub/wwwroot/docs/en/
cp -Recurse -Force ./assets/* c:/inetpub/wwwroot/docs/ -Exclude @("site")
deploy_docs_bastyon_com:
runs-on: docs.bastyon.com
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Copy artifacts
run: |
cp -r ./build/site/* /data/docs/en/
cp -r ./assets/* /data/docs/

# deploy_docs_bastyon_com:
# runs-on: docs.bastyon.com
# needs: build_vue
# steps:
# - name: Download artifacts
# uses: actions/download-artifact@v4
# - name: Copy artifacts
# run: |
# rm -rf /data/docs/*
# cp -r ./dist/* /data/docs/

deploy_docs_pocketnet_app:
runs-on: docs.bastyon.com
needs: build_vue
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: Copy artifacts
run: |
rm -rf /data/documentation/*
cp -r ./dist/* /data/documentation/
cp -r ./dist/* /data/documentation/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ node_modules/
package-lock.json
**/.DS_Store
ui-bundle.zip
**/.vscode
**/dist
**/.cache
**/.temp
8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions _old/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scripts": {
"build": "npx antora --fetch antora.yml"
},
"devDependencies": {
"@antora/cli": "3.0.0",
"@antora/site-generator": "3.0.0"
},
"dependencies": {
"@antora/lunr-extension": "^1.0.0-alpha.8"
}
}
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
49 changes: 49 additions & 0 deletions docs/.vuepress/components/NpmBadge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<script setup lang="ts">
import { computed } from 'vue'
const props = withDefaults(
defineProps<{
/** package name */
package: string
/** dist-tag to use */
distTag?: string
}>(),
{
distTag: 'next',
},
)
const badgeLink = computed(
() => `https://www.npmjs.com/package/${props.package}`,
)
const badgeLabel = computed(() => {
if (props.distTag) {
return `${props.package}@${props.distTag}`
}
return props.package
})
const badgeImg = computed(
() =>
`https://badgen.net/npm/v/${props.package}/${
props.distTag
}?label=${encodeURIComponent(badgeLabel.value)}`,
)
</script>

<template>
<a
class="npm-badge"
:href="badgeLink"
:title="package"
target="_blank"
rel="noopener noreferrer"
>
<img :src="badgeImg" :alt="package" />
</a>
</template>

<style scoped>
.npm-badge {
margin-right: 0.5rem;
}
</style>
159 changes: 159 additions & 0 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import { createRequire } from 'node:module'
import process from 'node:process'
import { viteBundler } from '@vuepress/bundler-vite'
import { webpackBundler } from '@vuepress/bundler-webpack'
import { docsearchPlugin } from '@vuepress/plugin-docsearch'
import { registerComponentsPlugin } from '@vuepress/plugin-register-components'
import { shikiPlugin } from '@vuepress/plugin-shiki'
import { defaultTheme } from '@vuepress/theme-default'
import { defineUserConfig } from 'vuepress'
import { getDirname, path } from 'vuepress/utils'
import {
head,
navbarEn,
navbarRu,
sidebarEn,
sidebarRu,
} from './configs/index.js'

const __dirname = getDirname(import.meta.url)
const require = createRequire(import.meta.url)
const isProd = process.env.NODE_ENV === 'production'

export default defineUserConfig({
// set site base to default value
base: '/',

// extra tags in `<head>`
head,

// site-level locales config
locales: {
'/': {
lang: 'en-US',
title: 'Bastyon',
description: 'This documentation will help you get started with Bastyon.',
},
'/ru/': {
lang: 'ru-RU',
title: 'Bastyon',
description: 'Эта документация поможет вам начать работу с Bastyon.',
},
},

// specify bundler via environment variable
bundler:
process.env.DOCS_BUNDLER === 'webpack' ? webpackBundler() : viteBundler(),

// configure default theme
theme: defaultTheme({
hostname: 'https://docs.bastyon.com',
logo: '/images/bastyon-logo-256x256.png',
repo: '', // TODO repo
docsRepo: '', // TODO docsRepo
docsDir: 'docs',

// theme-level locales config
locales: {
/**
* English locale config
*
* As the default locale of @vuepress/theme-default is English,
* we don't need to set all of the locale fields
*/
'/': {
// navbar
navbar: navbarEn,
// sidebar
sidebar: sidebarEn,
// page meta
editLinkText: 'Edit this page on GitHub',
},

/**
* Russian locale config
*/
'/ru/': {
// navbar
navbar: navbarRu,
selectLanguageName: 'Русский',
selectLanguageText: '选择语言',
selectLanguageAriaLabel: '选择语言',
// sidebar
sidebar: sidebarRu,
// page meta
editLinkText: '在 GitHub 上编辑此页',
lastUpdatedText: '上次更新',
contributorsText: '贡献者',
// custom containers
tip: '提示',
warning: '注意',
danger: '警告',
// 404 page
notFound: [
'这里什么都没有',
'我们怎么到这来了?',
'这是一个 404 页面',
'看起来我们进入了错误的链接',
],
backToHome: '返回首页',
// a11y
openInNewWindow: '在新窗口打开',
toggleColorMode: '切换颜色模式',
toggleSidebar: '切换侧边栏',
},
},

themePlugins: {
// only enable git plugin in production mode
git: isProd,
// use shiki plugin in production mode instead
prismjs: !isProd,
},
}),

// configure markdown
markdown: {
importCode: {
handleImportPath: (importPath) => {
// handle @vuepress packages import path
if (importPath.startsWith('@vuepress/')) {
const packageName = importPath.match(/^(@vuepress\/[^/]*)/)![1]
return importPath
.replace(
packageName,
path.dirname(require.resolve(`${packageName}/package.json`)),
)
.replace('/src/', '/lib/')
.replace(/hotKey\.ts$/, 'hotKey.d.ts')
}
return importPath
},
},
},

// use plugins
plugins: [
docsearchPlugin({
appId: '', // TODO appId
apiKey: '', // TODO apiKey
indexName: '',
// searchParameters: { // TODO error?
// facetFilters: ['tags:v2'],
// },
locales: {

},
}),
registerComponentsPlugin({
componentsDir: path.resolve(__dirname, './components'),
}),
// only enable shiki plugin in production mode
isProd
? shikiPlugin({
langs: ['bash', 'diff', 'json', 'md', 'ts', 'vue'],
theme: 'dark-plus',
})
: [],
],
})
41 changes: 41 additions & 0 deletions docs/.vuepress/configs/head.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type { HeadConfig } from 'vuepress/core'

// eslint-disable-next-line @typescript-eslint/naming-convention
export const head: HeadConfig[] = [
[
'link',
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: `/images/icons/favicon-16x16.png`,
},
],
[
'link',
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: `/images/icons/favicon-32x32.png`,
},
],
['link', { rel: 'manifest', href: '/manifest.webmanifest' }],
['meta', { name: 'application-name', content: 'VuePress' }],
['meta', { name: 'apple-mobile-web-app-title', content: 'VuePress' }],
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
[
'link',
{ rel: 'apple-touch-icon', href: `/images/icons/apple-touch-icon.png` },
],
[
'link',
{
rel: 'mask-icon',
href: '/images/icons/safari-pinned-tab.svg',
color: '#3eaf7c',
},
],
['meta', { name: 'msapplication-TileColor', content: '#3eaf7c' }],
['meta', { name: 'theme-color', content: '#3eaf7c' }],
]
3 changes: 3 additions & 0 deletions docs/.vuepress/configs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './head.js'
export * from './navbar/index.js'
export * from './sidebar/index.js'
10 changes: 10 additions & 0 deletions docs/.vuepress/configs/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createRequire } from 'node:module'
import { fs } from 'vuepress/utils'

const require = createRequire(import.meta.url)

export const VERSION = (
fs.readJsonSync(require.resolve('vuepress/package.json')) as {
version: string
}
).version
Loading

0 comments on commit ea159c7

Please sign in to comment.