Skip to content

Commit

Permalink
refactor: Updated docs to use node 20 & a new sitemap plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 14, 2024
1 parent af6ddb1 commit 82ccee2
Show file tree
Hide file tree
Showing 7 changed files with 2,935 additions and 1,582 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-and-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
strategy:
fail-fast: true
matrix:
node-version: [14.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand All @@ -35,7 +35,7 @@ jobs:
- name: rsync deployments
uses: burnett01/[email protected]
with:
switches: -avzr --delete
switches: -avzr
path: ./dist/
remote_path: ${{ secrets.NYS_DOCS_ROOT }}${{ env.DOCS_DEST_DIR }}
remote_host: ${{ secrets.NYS_DEPLOY_REMOTE_HOST }}
Expand Down
4 changes: 2 additions & 2 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG TAG=14-alpine
ARG TAG=20-alpine
FROM node:$TAG

USER node
RUN npm install -g npm@^10.0.0

WORKDIR /app/

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MAJOR_VERSION?=4
TAG?=14-alpine
TAG?=20-alpine
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-docs
DOCS_DEV_PORT?=400${MAJOR_VERSION}
DOCS_DEST?=../../../sites/nystudio107/web/docs/recipe
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export default defineConfig({
{text: 'Store', link: 'https://plugins.craftcms.com/recipe'},
{text: 'Changelog', link: 'https://nystudio107.com/plugins/recipe/changelog'},
{text: 'Issues', link: 'https://github.com/nystudio107/craft-recipe/issues'},
{
text: 'v4', items: [
{text: 'v4', link: '/'},
{text: 'v1', link: 'https://nystudio107.com/docs/recipe/v1/'},
],
},
]
},
});
20 changes: 10 additions & 10 deletions docs/docs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import {defineConfig} from 'vite';
import SitemapPlugin from 'rollup-plugin-sitemap';
import VitePressConfig from './.vitepress/config';
import {defineConfig} from 'vite'
import { sitemap, Url as SitemapUrl } from '@aminnairi/rollup-plugin-sitemap'
import VitePressConfig from './.vitepress/config'
import {DefaultTheme} from "vitepress/types/default-theme";

const docsSiteBaseUrl = 'https://nystudio107.com';
const docsSiteBaseUrl = 'https://nystudio107.com'
const docsBaseUrl = new URL(VitePressConfig.base!, docsSiteBaseUrl).href.replace(/\/$/, '') + '/';
const siteMapRoutes = [{
path: '',
name: VitePressConfig.title
let siteMapUrls: SitemapUrl[] = [{
location: '',
lastModified: new Date(),
}];

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
SitemapPlugin({
sitemap({
baseUrl: docsBaseUrl,
contentBase: './docs/.vitepress/dist',
routes: siteMapRoutes,
urls: siteMapUrls,
})
],
server: {
Expand Down
Loading

0 comments on commit 82ccee2

Please sign in to comment.