Skip to content

Commit

Permalink
create github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHsieh0415 committed Jun 17, 2024
1 parent 48ffeec commit 22e2cae
Show file tree
Hide file tree
Showing 15 changed files with 2,800 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy site

on:
workflow_dispatch:

jobs:
Deploy:
name: Deploy to Github Pages 🚀
runs-on: ubuntu-latest

permissions:
id-token: write
pages: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
62 changes: 62 additions & 0 deletions .github/workflows/vuepress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build site

on:
push:
branches:
- main

permissions:
contents: write

jobs:
Build:
name: Build Vuepress 🔧
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

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

- name: Install dependencies
run: npm install

- name: Build site
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "docs/.vuepress/dist"

- name: Deploy & update
id: deployment
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "docs/.vuepress/dist"
publish_branch: gh-pages

Deploy:
name: Deploy to Github Pages 🚀
runs-on: ubuntu-latest
needs: Build

permissions:
id-token: write
pages: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.vscode/
node_modules/
.temp
.cache
dist
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"files.autoSave": "off"
}
15 changes: 15 additions & 0 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { viteBundler } from "@vuepress/bundler-vite";
import { defineUserConfig } from "vuepress";

import theme from "./definitions/theme";
import plugins from "./definitions/plugins";

export default defineUserConfig({
base: "/",
bundler: viteBundler(),
head: [["meta", { charset: "utf-8" }]],
theme,
plugins,
lang: "zh-TW",
title: "芒果的 KubeJS 筆記本",
});
9 changes: 9 additions & 0 deletions docs/.vuepress/definitions/plugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { markdownContainerPlugin } from "@vuepress/plugin-markdown-container";

const plugins = [
markdownContainerPlugin({
type: "tip",
}),
];

export default plugins;
42 changes: 42 additions & 0 deletions docs/.vuepress/definitions/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { defaultTheme } from "@vuepress/theme-default";

const theme = defaultTheme({
logo: "/images/logo.png",
logoAlt: "",

colorMode: "dark",
colorModeSwitch: true,

repo: "Mango-Minecraft-Project/Mango-KubeJScripts",
editLinkPattern: ":repo/edit/:branch/:path",

lastUpdated: true,
contributors: true,

navbar: [
{ text: "Discord", link: "https://evanhsieh0415.github.io/links/discord.html" },
],

sidebar: [
"/downloads/",
"/links/",
"/tips-and-tricks/",
"/notes/",
"/snippets/"
],

editLinkText: "在 GitHub 編輯此頁面",
lastUpdatedText: "最後更新",
contributorsText: "作者",
backToHome: "返回首頁",
openInNewWindow: "在新視窗中開啟",
toggleColorMode: "切換色彩模式",
toggleSidebar: "切換選單列",
tip: "提示",
warning: "注意",
danger: "警告",
notFound: ["這個頁面不存在"],
selectLanguageText: "選擇語言",
});

export default theme;
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 芒果的 KubeJS 筆記

以下資訊皆以KubeJS最新支援版本、Forge(NeoForge優先,LexForge次要)為主
7 changes: 7 additions & 0 deletions docs/downloads/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 下載測試版 KubeJS

- [Rhino NeoForge][saps_meven-rhino_neoforge]
- [KubeJS NeoForge][saps_meven-kubejs_neoforge]

[saps_meven-rhino_neoforge]: https://maven.saps.dev/#/releases/dev/latvian/mods/rhino-neoforge
[saps_meven-kubejs_neoforge]: https://maven.saps.dev/#/releases/dev/latvian/mods/kubejs-neoforge
47 changes: 47 additions & 0 deletions docs/links/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# KubeJS 相關連結

## 官方連結

- 官網:[https://kubejs.com/](https://kubejs.com/)
- Modrinth:[https://modrinth.com/mod/kubejs](https://modrinth.com/mod/kubejs)
- CurseForge:[https://www.curseforge.com/minecraft/mc-mods/kubejs](https://www.curseforge.com/minecraft/mc-mods/kubejs)
- Github:[https://github.com/KubeJS-Mods/KubeJS](https://github.com/KubeJS-Mods/KubeJS)
- Discord:[https://discord.com/invite/lat](https://discord.com/invite/lat)
- Wiki:[https://kubejs.com/wiki/](https://kubejs.com/wiki/)
- 舊版 Wiki
- KubeJS 5:[https://wiki.latvian.dev/books/kubejs-legacy](https://wiki.latvian.dev/books/kubejs-legacy)
- KubeJS 6+:[https://wiki.latvian.dev/books/kubejs](https://wiki.latvian.dev/books/kubejs)

## 第三方連結

- MC百科:[https://www.mcmod.cn/class/2450.html](https://www.mcmod.cn/class/2450.html)
- QQ 群
- 日常交流群:665153457
- 純討論群(禁止閒聊):742635193
- DoDo 群:[https://imdodo.com/s/208104](https://imdodo.com/s/208104)
- KubeJS 中文開發論壇:[https://kjscndev.flarum.cloud/](https://kjscndev.flarum.cloud/)
- Wudji
- KubeJS 5:[https://wudji.gitbook.io/xplus-kubejs-tutorial-v1-zh_cn](https://wudji.gitbook.io/xplus-kubejs-tutorial-v1-zh_cn)
- KubeJS 6+:[https://wudji.gitbook.io/xplus-kubejs-tutorial-v2-zh_cn](https://wudji.gitbook.io/xplus-kubejs-tutorial-v1-zh_cn)
- 芒果凍布丁
- 筆記:[https://hackmd.io/@mango-minecraft-notes/KubeJS-Notes](https://hackmd.io/@mango-minecraft-notes/KubeJS-Notes)
- 程式碼儲存庫:[https://github.com/Mango-Minecraft-Project/Mango-KubeJScripts](https://github.com/Mango-Minecraft-Project/Mango-KubeJScripts)

---

## 其他

- 基礎知識、文件
- Quick Reference
- JavaScript:[https://wangchujiang.com/reference/docs/javascript.html](https://wangchujiang.com/reference/docs/javascript.html)
- ES2015+:[https://wangchujiang.com/reference/docs/es6.html](https://wangchujiang.com/reference/docs/es6.html)
- MDN Web Docs:[https://developer.mozilla.org/zh-CN/docs/Web/JavaScript](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript)
- JSDoc:[https://jsdoc.app/](https://jsdoc.app/)
- 工具
- VSCode(Visual Studio Code):[https://code.visualstudio.com/](https://code.visualstudio.com/)
- VSCode 擴展
- [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
- [Easy CodeSnap](https://marketplace.visualstudio.com/items?itemName=ArthurLobo.easy-codesnap)
- [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
- 模組
- ProbeJS:[https://www.mcmod.cn/class/6486.html](https://www.mcmod.cn/class/6486.html)
32 changes: 32 additions & 0 deletions docs/notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 筆記

## DamageSource 中 `immediate``actual` 的差異

`immediate` 回傳直接傷害者
`actual` 回傳傷害所有者

舉例來說,玩家拿弓箭射實體:
- `immediate` 回傳 `Arrow` (弓箭)
- `actual` 回傳 `Player` (玩家)

## `PlayerEvents.chat``PlayerEvents.decorateChat` 的差異

- `PlayerEvents.chat`:可以被取消,主要用途為取消事件。
- `PlayerEvents.decorateChat`:不能被取消,主要用途為修改訊息。

## `ItemStack.weakNBT()``ItemStack.strongNBT()` 的差異

`Item.of("diamond_sword", "{damage:50}")` 舉例

- `.weakNBT()`
若物品的nbt包含 `{damage:50}` 則可以使用
舉例:
- :o: `{damage:50}`
- :o: `{damage:50, display:"Sword"}`
- :x: `{display:"Sword"}`
- `.strongNBT()`
若物品的nbt **** 包含 `"{damage:50}"` 則可以使用
舉例:
- :o: `{damage:50}`
- :x: `{damage:50, display:"Sword"}`
- :x: `{display:"Sword"}`
Loading

0 comments on commit 22e2cae

Please sign in to comment.