Skip to content

Commit

Permalink
Merge branch 'release/1.2.24' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Apr 21, 2023
2 parents ee0a5e2 + 0f071d7 commit ca8ef4e
Show file tree
Hide file tree
Showing 22 changed files with 1,590 additions and 1,202 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build and Deploy Docs
env:
DOCS_DEST_DIR: /transcoder/
DOCS_DEST_DIR: /transcoder/v3/
on:
push:
branches:
Expand All @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: true
matrix:
node-version: [14.x]
node-version: [ 14.x ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
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
21 changes: 21 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Create Release
run-name: Create release for ${{ github.event.client_payload.version }}

on:
repository_dispatch:
types:
- craftcms/new-release

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: ncipollo/release-action@v1
with:
body: ${{ github.event.client_payload.notes }}
makeLatest: ${{ github.event.client_payload.latest }}
name: ${{ github.event.client_payload.version }}
prerelease: ${{ github.event.client_payload.prerelease }}
tag: ${{ github.event.client_payload.tag }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Transcoder Changelog

## 1.2.24 - 2023.04.20
### Changed
* Updated the docs to use VitePress `^1.0.0-alpha.29`
* Allow for versioning of the docs

## 1.2.23 - 2022.09.20
### Changed
* Move to using `ServicesTrait` and add getter methods for services
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nystudio107/craft-transcoder",
"description": "Transcode video & audio files to various formats, and provide video thumbnails",
"type": "craft-plugin",
"version": "1.2.23",
"version": "1.2.24",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/vendor
/node_modules
/docs/.vitepress/dist
/docs/.vitepress/cache
80 changes: 37 additions & 43 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,47 @@
MAJOR_VERSION?=3
TAG?=14-alpine
CONTAINER?=$(shell basename $(dir $(CURDIR)))-docs
DOCKERRUN=docker container run \
--name ${CONTAINER} \
--rm \
-p 3002:3002 \
-t \
-v "${CURDIR}":/app \
${CONTAINER}:${TAG}
DOCSDEST?=../../../sites/nystudio107/web/docs/transcoder
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-docs
DOCS_DEV_PORT?=400${MAJOR_VERSION}
DOCS_DEST?=../../../sites/nystudio107/web/docs/retour
IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG))
IMAGE_NAME=${CONTAINER}:${TAG}
DOCKER_RUN=docker container run --rm -it -v "${CURDIR}":/app

.PHONY: docker build dev fix install lint clean npm
.PHONY: build clean dev fix image-build image-check lint npm ssh

# Start the Docker container
docker:
docker build \
. \
-t ${CONTAINER}:${TAG} \
--build-arg TAG=${TAG} \
--no-cache
# Build the production docs
build: docker install
${DOCKERRUN} \
run docs:build
rm -rf ${DOCSDEST}
mv ./docs/.vitepress/dist ${DOCSDEST}
# Start up the dev server
dev: docker install
${DOCKERRUN} \
run docs:dev
# Fix the docs via textlint
fix: docker install
${DOCKERRUN} \
run docs:fix
# Run an npm install
install: docker
${DOCKERRUN} \
install
# Lint the docs via textlint
lint: docker install
${DOCKERRUN} \
run docs:lint
# Remove node_modules/* & package-lock.json
# Perform a dist build via npm run docs:build
build: image-check
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:build
rm -rf ${DOCS_DEST}
mv ./docs/.vitepress/dist ${DOCS_DEST}
# Remove node_modules/ & package-lock.json
clean:
rm -rf node_modules/
rm -f package-lock.json
# Run the development server via npm run docs:dev
dev: image-check
${DOCKER_RUN} --name ${CONTAINER}-$@ -e DOCS_DEV_PORT="${DOCS_DEV_PORT}" -p ${DOCS_DEV_PORT}:${DOCS_DEV_PORT} ${IMAGE_NAME} run docs:dev
# Fix the docs with textlint via npm run docs:fix
fix: image-check
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:fix
# Build the Docker image & run npm install
image-build:
docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install
# Ensure the image has been created
image-check:
ifeq ($(IMAGE_INFO), [])
image-check: image-build
endif
# Lint the docs with textlint via npm run docs:lint
lint: image-check
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:lint
# Run the passed in npm command
npm: docker
${DOCKERRUN} \
$(filter-out $@,$(MAKECMDGOALS))
npm: image-check
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS)
# Open a shell inside of the container
ssh: image-check
${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME}
%:
@:
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line
30 changes: 0 additions & 30 deletions docs/docs/.vitepress/config.js

This file was deleted.

54 changes: 54 additions & 0 deletions docs/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import {defineConfig} from 'vitepress'

export default defineConfig({
title: 'Transcoder Plugin',
description: 'Documentation for the Transcoder plugin',
base: '/docs/transcoder/v3/',
lang: 'en-US',
head: [
['meta', {content: 'https://github.com/nystudio107', property: 'og:see_also',}],
['meta', {content: 'https://twitter.com/nystudio107', property: 'og:see_also',}],
['meta', {content: 'https://youtube.com/nystudio107', property: 'og:see_also',}],
['meta', {content: 'https://www.facebook.com/newyorkstudio107', property: 'og:see_also',}],
],
themeConfig: {
socialLinks: [
{icon: 'github', link: 'https://github.com/nystudio107'},
{icon: 'twitter', link: 'https://twitter.com/nystudio107'},
],
logo: '/img/plugin-logo.svg',
editLink: {
pattern: 'https://github.com/nystudio107/craft-transcoder/edit/develop/docs/docs/:path',
text: 'Edit this page on GitHub'
},
algolia: {
appId: 'VWUWF9S521',
apiKey: 'db5c03f88e474cbf0356841089be7ffa',
indexName: 'transcoder'
},
lastUpdatedText: 'Last Updated',
sidebar: [
{
text: 'Topics',
items: [
{text: 'Transcoder Plugin', link: '/'},
{text: 'Transcoder Overview', link: '/overview.html'},
{text: 'Configuring Transcoder', link: '/configuring.html'},
{text: 'Using Transcoder', link: '/using.html'},
],
}
],
nav: [
{text: 'Home', link: 'https://nystudio107.com/plugins/transcoder'},
{text: 'Store', link: 'https://plugins.craftcms.com/transcoder'},
{text: 'Changelog', link: 'https://nystudio107.com/plugins/transcoder/changelog'},
{text: 'Issues', link: 'https://github.com/nystudio107/craft-transcoder/issues'},
{
text: 'v3', items: [
{text: 'v4', link: 'https://nystudio107.com/docs/transcoder/'},
{text: 'v3', link: '/'},
],
},
],
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@
target="_blank"
rel="noopener"
>
<img
src="/resources/img/nys-logo.svg"
<img
src="/img/nys-logo.svg"
aria-label="nystudio107 logo"
/>
/>
</a>
</div>
</template>

<script>
export default {
name: "SidebarBottom"
}
<script setup>
</script>

<style scoped>
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
.DocSearch {
--docsearch-primary-color: var(--c-brand) !important;
}

a > img {
display: inline-block;
}
42 changes: 0 additions & 42 deletions docs/docs/.vitepress/theme/index.js

This file was deleted.

42 changes: 42 additions & 0 deletions docs/docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import Theme from 'vitepress/theme'
import {h, watch} from 'vue'
import './custom.css'

import NYSLogo from './NYSLogo.vue';

// Could also come from .env
const GA_ID = 'UA-69117511-1';

export default {
...Theme,
Layout() {
return h(Theme.Layout, null, {
'aside-bottom': () => h(NYSLogo)
}
)
},
enhanceApp: (ctx) => {
// Google analytics integration
if (import.meta.env.PROD && GA_ID && typeof window !== 'undefined') {
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}
i[r].l = 1 * new Date()
a = s.createElement(o)
m = s.getElementsByTagName(o)[0]
a.async = 1
a.src = g
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga')
ga('create', GA_ID, 'auto')
ga('set', 'anonymizeIp', true)
// Send a page view any time the route changes
watch(ctx.router.route, (newValue, oldValue) => {
ga('set', 'page', newValue.path)
ga('send', 'pageview')
})
}
}
}
7 changes: 7 additions & 0 deletions docs/docs/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module "*.vue" {
import Vue from 'vue';
export default Vue;
}

declare module 'rollup-plugin-sitemap';
declare module 'NYSLogo';
1 change: 1 addition & 0 deletions docs/docs/@types/sitemap-plugin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type SiteMapPluginUrls = { path: string; name: string; }[] | undefined;
File renamed without changes
Loading

0 comments on commit ca8ef4e

Please sign in to comment.