Skip to content

Commit ca8ef4e

Browse files
committed
Merge branch 'release/1.2.24' into v1
2 parents ee0a5e2 + 0f071d7 commit ca8ef4e

22 files changed

+1590
-1202
lines changed

.github/workflows/build-and-deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build and Deploy Docs
22
env:
3-
DOCS_DEST_DIR: /transcoder/
3+
DOCS_DEST_DIR: /transcoder/v3/
44
on:
55
push:
66
branches:
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
fail-fast: true
2424
matrix:
25-
node-version: [14.x]
25+
node-version: [ 14.x ]
2626
steps:
2727
- uses: actions/checkout@v2
2828
- name: Use Node.js ${{ matrix.node-version }}
@@ -35,7 +35,7 @@ jobs:
3535
- name: rsync deployments
3636
uses: burnett01/[email protected]
3737
with:
38-
switches: -avzr --delete
38+
switches: -avzr
3939
path: ./dist/
4040
remote_path: ${{ secrets.NYS_DOCS_ROOT }}${{ env.DOCS_DEST_DIR }}
4141
remote_host: ${{ secrets.NYS_DEPLOY_REMOTE_HOST }}

.github/workflows/create-release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Create Release
2+
run-name: Create release for ${{ github.event.client_payload.version }}
3+
4+
on:
5+
repository_dispatch:
6+
types:
7+
- craftcms/new-release
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: ncipollo/release-action@v1
16+
with:
17+
body: ${{ github.event.client_payload.notes }}
18+
makeLatest: ${{ github.event.client_payload.latest }}
19+
name: ${{ github.event.client_payload.version }}
20+
prerelease: ${{ github.event.client_payload.prerelease }}
21+
tag: ${{ github.event.client_payload.tag }}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Transcoder Changelog
22

3+
## 1.2.24 - 2023.04.20
4+
### Changed
5+
* Updated the docs to use VitePress `^1.0.0-alpha.29`
6+
* Allow for versioning of the docs
7+
38
## 1.2.23 - 2022.09.20
49
### Changed
510
* Move to using `ServicesTrait` and add getter methods for services

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nystudio107/craft-transcoder",
33
"description": "Transcode video & audio files to various formats, and provide video thumbnails",
44
"type": "craft-plugin",
5-
"version": "1.2.23",
5+
"version": "1.2.24",
66
"keywords": [
77
"craft",
88
"cms",

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/vendor
22
/node_modules
3+
/docs/.vitepress/dist
4+
/docs/.vitepress/cache

docs/Makefile

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,47 @@
1+
MAJOR_VERSION?=3
12
TAG?=14-alpine
2-
CONTAINER?=$(shell basename $(dir $(CURDIR)))-docs
3-
DOCKERRUN=docker container run \
4-
--name ${CONTAINER} \
5-
--rm \
6-
-p 3002:3002 \
7-
-t \
8-
-v "${CURDIR}":/app \
9-
${CONTAINER}:${TAG}
10-
DOCSDEST?=../../../sites/nystudio107/web/docs/transcoder
3+
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-docs
4+
DOCS_DEV_PORT?=400${MAJOR_VERSION}
5+
DOCS_DEST?=../../../sites/nystudio107/web/docs/retour
6+
IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG))
7+
IMAGE_NAME=${CONTAINER}:${TAG}
8+
DOCKER_RUN=docker container run --rm -it -v "${CURDIR}":/app
119

12-
.PHONY: docker build dev fix install lint clean npm
10+
.PHONY: build clean dev fix image-build image-check lint npm ssh
1311

14-
# Start the Docker container
15-
docker:
16-
docker build \
17-
. \
18-
-t ${CONTAINER}:${TAG} \
19-
--build-arg TAG=${TAG} \
20-
--no-cache
21-
# Build the production docs
22-
build: docker install
23-
${DOCKERRUN} \
24-
run docs:build
25-
rm -rf ${DOCSDEST}
26-
mv ./docs/.vitepress/dist ${DOCSDEST}
27-
# Start up the dev server
28-
dev: docker install
29-
${DOCKERRUN} \
30-
run docs:dev
31-
# Fix the docs via textlint
32-
fix: docker install
33-
${DOCKERRUN} \
34-
run docs:fix
35-
# Run an npm install
36-
install: docker
37-
${DOCKERRUN} \
38-
install
39-
# Lint the docs via textlint
40-
lint: docker install
41-
${DOCKERRUN} \
42-
run docs:lint
43-
# Remove node_modules/* & package-lock.json
12+
# Perform a dist build via npm run docs:build
13+
build: image-check
14+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:build
15+
rm -rf ${DOCS_DEST}
16+
mv ./docs/.vitepress/dist ${DOCS_DEST}
17+
# Remove node_modules/ & package-lock.json
4418
clean:
4519
rm -rf node_modules/
4620
rm -f package-lock.json
21+
# Run the development server via npm run docs:dev
22+
dev: image-check
23+
${DOCKER_RUN} --name ${CONTAINER}-$@ -e DOCS_DEV_PORT="${DOCS_DEV_PORT}" -p ${DOCS_DEV_PORT}:${DOCS_DEV_PORT} ${IMAGE_NAME} run docs:dev
24+
# Fix the docs with textlint via npm run docs:fix
25+
fix: image-check
26+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:fix
27+
# Build the Docker image & run npm install
28+
image-build:
29+
docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache
30+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install
31+
# Ensure the image has been created
32+
image-check:
33+
ifeq ($(IMAGE_INFO), [])
34+
image-check: image-build
35+
endif
36+
# Lint the docs with textlint via npm run docs:lint
37+
lint: image-check
38+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:lint
4739
# Run the passed in npm command
48-
npm: docker
49-
${DOCKERRUN} \
50-
$(filter-out $@,$(MAKECMDGOALS))
40+
npm: image-check
41+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS)
42+
# Open a shell inside of the container
43+
ssh: image-check
44+
${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME}
5145
%:
5246
@:
5347
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line

docs/docs/.vitepress/config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/docs/.vitepress/config.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import {defineConfig} from 'vitepress'
2+
3+
export default defineConfig({
4+
title: 'Transcoder Plugin',
5+
description: 'Documentation for the Transcoder plugin',
6+
base: '/docs/transcoder/v3/',
7+
lang: 'en-US',
8+
head: [
9+
['meta', {content: 'https://github.com/nystudio107', property: 'og:see_also',}],
10+
['meta', {content: 'https://twitter.com/nystudio107', property: 'og:see_also',}],
11+
['meta', {content: 'https://youtube.com/nystudio107', property: 'og:see_also',}],
12+
['meta', {content: 'https://www.facebook.com/newyorkstudio107', property: 'og:see_also',}],
13+
],
14+
themeConfig: {
15+
socialLinks: [
16+
{icon: 'github', link: 'https://github.com/nystudio107'},
17+
{icon: 'twitter', link: 'https://twitter.com/nystudio107'},
18+
],
19+
logo: '/img/plugin-logo.svg',
20+
editLink: {
21+
pattern: 'https://github.com/nystudio107/craft-transcoder/edit/develop/docs/docs/:path',
22+
text: 'Edit this page on GitHub'
23+
},
24+
algolia: {
25+
appId: 'VWUWF9S521',
26+
apiKey: 'db5c03f88e474cbf0356841089be7ffa',
27+
indexName: 'transcoder'
28+
},
29+
lastUpdatedText: 'Last Updated',
30+
sidebar: [
31+
{
32+
text: 'Topics',
33+
items: [
34+
{text: 'Transcoder Plugin', link: '/'},
35+
{text: 'Transcoder Overview', link: '/overview.html'},
36+
{text: 'Configuring Transcoder', link: '/configuring.html'},
37+
{text: 'Using Transcoder', link: '/using.html'},
38+
],
39+
}
40+
],
41+
nav: [
42+
{text: 'Home', link: 'https://nystudio107.com/plugins/transcoder'},
43+
{text: 'Store', link: 'https://plugins.craftcms.com/transcoder'},
44+
{text: 'Changelog', link: 'https://nystudio107.com/plugins/transcoder/changelog'},
45+
{text: 'Issues', link: 'https://github.com/nystudio107/craft-transcoder/issues'},
46+
{
47+
text: 'v3', items: [
48+
{text: 'v4', link: 'https://nystudio107.com/docs/transcoder/'},
49+
{text: 'v3', link: '/'},
50+
],
51+
},
52+
],
53+
},
54+
});

docs/docs/.vitepress/theme/SidebarBottom.vue renamed to docs/docs/.vitepress/theme/NYSLogo.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@
66
target="_blank"
77
rel="noopener"
88
>
9-
<img
10-
src="/resources/img/nys-logo.svg"
9+
<img
10+
src="/img/nys-logo.svg"
1111
aria-label="nystudio107 logo"
12-
/>
12+
/>
1313
</a>
1414
</div>
1515
</template>
1616

17-
<script>
18-
export default {
19-
name: "SidebarBottom"
20-
}
17+
<script setup>
2118
</script>
2219

2320
<style scoped>

docs/docs/.vitepress/theme/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@
1010
.DocSearch {
1111
--docsearch-primary-color: var(--c-brand) !important;
1212
}
13+
14+
a > img {
15+
display: inline-block;
16+
}

docs/docs/.vitepress/theme/index.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

docs/docs/.vitepress/theme/index.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import Theme from 'vitepress/theme'
2+
import {h, watch} from 'vue'
3+
import './custom.css'
4+
5+
import NYSLogo from './NYSLogo.vue';
6+
7+
// Could also come from .env
8+
const GA_ID = 'UA-69117511-1';
9+
10+
export default {
11+
...Theme,
12+
Layout() {
13+
return h(Theme.Layout, null, {
14+
'aside-bottom': () => h(NYSLogo)
15+
}
16+
)
17+
},
18+
enhanceApp: (ctx) => {
19+
// Google analytics integration
20+
if (import.meta.env.PROD && GA_ID && typeof window !== 'undefined') {
21+
(function (i, s, o, g, r, a, m) {
22+
i['GoogleAnalyticsObject'] = r
23+
i[r] = i[r] || function () {
24+
(i[r].q = i[r].q || []).push(arguments)
25+
}
26+
i[r].l = 1 * new Date()
27+
a = s.createElement(o)
28+
m = s.getElementsByTagName(o)[0]
29+
a.async = 1
30+
a.src = g
31+
m.parentNode.insertBefore(a, m)
32+
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga')
33+
ga('create', GA_ID, 'auto')
34+
ga('set', 'anonymizeIp', true)
35+
// Send a page view any time the route changes
36+
watch(ctx.router.route, (newValue, oldValue) => {
37+
ga('set', 'page', newValue.path)
38+
ga('send', 'pageview')
39+
})
40+
}
41+
}
42+
}

docs/docs/@types/shims.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
declare module "*.vue" {
2+
import Vue from 'vue';
3+
export default Vue;
4+
}
5+
6+
declare module 'rollup-plugin-sitemap';
7+
declare module 'NYSLogo';

docs/docs/@types/sitemap-plugin.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type SiteMapPluginUrls = { path: string; name: string; }[] | undefined;

0 commit comments

Comments
 (0)