Skip to content

Commit

Permalink
feat(templates/vuepress): Vuepress moefy
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodiehl committed Nov 19, 2024
1 parent bb32367 commit 8025b3e
Show file tree
Hide file tree
Showing 81 changed files with 13,149 additions and 0 deletions.
25 changes: 25 additions & 0 deletions templates/vuepress/vuepress-moefy/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig
# https://editorconfig.org/

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.sh]
indent_size = 4

[*.md]
indent_size = 3

[*.json]
insert_final_newline = ignore

[**.min.js]
indent_style = ignore
insert_final_newline = ignore
56 changes: 56 additions & 0 deletions templates/vuepress/vuepress-moefy/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'plugin:vue/base',
'plugin:vue/essential',
'plugin:vue/strongly-recommended',
'plugin:vue/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['vue'],
rules: {
semi: [2, 'never'],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/no-v-html': 'off',
'vue/array-bracket-spacing': 'error',
'vue/arrow-spacing': 'error',
'vue/block-spacing': 'error',
'vue/camelcase': 'error',
'vue/comma-dangle': 'error',
'vue/component-name-in-template-casing': [
'error',
'kebab-case',
{
registeredComponentsOnly: true,
ignores: [],
},
],
'vue/eqeqeq': 'error',
'vue/key-spacing': 'error',
'vue/match-component-file-name': [
'error',
{
extensions: ['jsx'],
shouldMatchCase: false,
},
],
'vue/no-restricted-syntax': 'error',
'vue/object-curly-spacing': 'error',
'vue/require-direct-export': 'error',
'vue/space-infix-ops': 'error',
'vue/space-unary-ops': 'error',
'vue/v-on-function-call': ['error', 'never'],
},
}
39 changes: 39 additions & 0 deletions templates/vuepress/vuepress-moefy/.github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Main Edge Deploy

on:
pull_request:
types:
- closed
branches:
- "main"

jobs:
deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install NPM dependencies
run: npm i

- name: Install Azion CLI
run: |
curl -o azionlinux https://downloads.azion.com/linux/x86_64/azion
sudo mv azionlinux /usr/bin/azion
sudo chmod u+x /usr/bin/azion
- name: Azion Action Deploy
run: |
azion -t ${{ secrets.AZION_PERSONAL_TOKEN }}
azion deploy
19 changes: 19 additions & 0 deletions templates/vuepress/vuepress-moefy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Mac
.DS_Store

# .vscode
/.vscode/

# node
node_modules/

# vuepress
dist

# yarn
yarn-error.log

# Azion
.edge
.vulcan

5 changes: 5 additions & 0 deletions templates/vuepress/vuepress-moefy/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.html
dist/
node_modules/
*.min.js
pnpm-lock.yaml
22 changes: 22 additions & 0 deletions templates/vuepress/vuepress-moefy/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5",
"semi": false,
"arrowParens": "always",
"overrides": [
{
"files": "*.md",
"options": {
"tabWidth": 3
}
},
{
"files": "*.json5",
"options": {
"singleQuote": false
}
}
]
}
21 changes: 21 additions & 0 deletions templates/vuepress/vuepress-moefy/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019-present, Nyakku Shigure

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
46 changes: 46 additions & 0 deletions templates/vuepress/vuepress-moefy/azion.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
build: {
preset: {
name: 'vuepress'
}
},
origin: [
{
name: 'origin-storage-default',
type: 'object_storage'
}
],
rules: {
request: [
{
name: 'Set Storage Origin for All Requests',
match: '^\\/',
behavior: {
setOrigin: {
name: 'origin-storage-default',
type: 'object_storage'
}
}
},
{
name: 'Deliver Static Assets',
match:
'.(css|js|ttf|woff|woff2|pdf|svg|jpg|jpeg|gif|bmp|png|ico|mp4|json|xml|html)$',
behavior: {
setOrigin: {
name: 'origin-storage-default',
type: 'object_storage'
},
deliver: true
}
},
{
name: 'Redirect to index.html',
match: '^\\/',
behavior: {
rewrite: '/index.html'
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!-- copied from https://github.com/vuepress/vuepress-community/blob/master/packages/docs/src/.vuepress/components/GitHubLink.vue -->

<template>
<a
class="github-link"
rel="noopener noreferrer"
target="_blank"
:title="repo"
:href="`https://github.com/${repo}`"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28">
<path
d="M14 0C6.27 0 0 6.43 0 14.36c0 6.34 4.01 11.72 9.57 13.62.7.13.96-.31.96-.69 0-.34-.01-1.24-.02-2.44-3.89.87-4.72-1.92-4.72-1.92-.64-1.66-1.55-2.1-1.55-2.1-1.27-.89.1-.87.1-.87 1.4.1 2.14 1.48 2.14 1.48 1.25 2.19 3.28 1.56 4.07 1.19.13-.93.49-1.56.89-1.92-3.11-.36-6.38-1.59-6.38-7.09 0-1.57.55-2.85 1.44-3.85-.14-.36-.62-1.82.14-3.8 0 0 1.18-.39 3.85 1.47a12.8 12.8 0 0 1 3.5-.48c1.19.01 2.39.16 3.5.48 2.67-1.86 3.85-1.47 3.85-1.47.76 1.98.28 3.44.14 3.8.9 1 1.44 2.28 1.44 3.85 0 5.51-3.27 6.73-6.39 7.08.5.44.95 1.32.95 2.66 0 1.92-.02 3.47-.02 3.94 0 .38.25.83.96.69C23.99 26.07 28 20.7 28 14.36 28 6.43 21.73 0 14 0z"
fill-rule="evenodd"
clip-rule="evenodd"
/>
</svg>
</a>
</template>

<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
name: 'GitHubLink',
props: {
repo: {
type: String,
required: true,
},
},
})
</script>

<style lang="stylus">
.github-link
width 1em
height 1em
text-decoration none
display inline-block
vertical-align -.1em
margin-left 0.6rem
path
fill #666
transition 0.3s ease
&:hover
path
fill #888
</style>
79 changes: 79 additions & 0 deletions templates/vuepress/vuepress-moefy/docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { dirname, resolve } from 'path'
import { fileURLToPath } from 'url'

const dir = dirname(fileURLToPath(import.meta.url))

const packages = ['ribbon', 'cursor-effects', 'dynamic-title', 'go-top', 'meting']

export default {
title: 'moefy-vuepress',
description: 'Add some lovely plugins in your vuepress!',
//base: '/moefy-vuepress/',

plugins: [
// 彩带背景
[
'ribbon',
{
size: 90,
opacity: 0.8,
zIndex: -1,
},
],
// 鼠标特效插件
[
'cursor-effects',
{
size: 1.75,
shape: 'star',
},
],
// 离开页面标题变化
[
'dynamic-title',
{
showIcon: '/favicon.ico',
showText: '(ฅ>ω<*ฅ)欢迎回来!',
hideIcon: '/failure.ico',
hideText: '( ๑ˊ•̥▵•)੭₎₎不要走呀!',
recoverTime: 2000,
},
],
// 悬挂小猫返回顶部
['go-top'],
// Meting 插件
[
'meting',
{
metingApi: 'https://api.injahow.cn/meting/',
meting: {
server: 'netease',
type: 'playlist',
mid: '6838211960',
},
aplayer: {
lrcType: 3,
},
},
],
],

themeConfig: {
nav: [{ text: 'Home', link: '/' }],
sidebarDepth: 1,
sidebar: {
'/': packages.map((pkg) => `packages/${pkg}`),
},
repo: 'moefyit/moefy-vuepress',
docsDir: 'docs',
docsBranch: 'main',
},

// 作为插件的额外路由
additionalPages: packages.map((pkg) => {
return {
path: `/packages/${pkg}.html`,
filePath: resolve(dir, `../../packages/vuepress-plugin-${pkg}/README.md`),
}
}),
}
Git LFS file not shown
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$accentColor = #9f1083
$codeBgColor = #141452

// 响应式变化点
$MQNarrow = 959px
$MQMobile = 719px
$MQMobileNarrow = 419px
7 changes: 7 additions & 0 deletions templates/vuepress/vuepress-moefy/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Moefy VuePress

让你的 VuePress 变得更加可爱~

> **Warning**
>
> 这些插件仅支持 [VuePress V1](https://github.com/vuejs/vuepress),不支持 [VuePress V2](https://github.com/vuepress/vuepress-next)[VitePress](https://github.com/vuejs/vitepress)。如果你想在非 VuePress V1 环境下使用 ribbon 或 cursor-effects 插件,可以尝试 [moefy-canvas](https://github.com/moefyit/moefy-canvas)(事实上现在 ribbon 和 cursor-effects 插件只是 moefy-canvas 的一个简单包装)~
Loading

0 comments on commit 8025b3e

Please sign in to comment.