Skip to content

Commit d5776de

Browse files
committed
Convert to VitePress
1 parent 3b9c518 commit d5776de

36 files changed

Lines changed: 2193 additions & 19562 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2-
.docusaurus
2+
.vitepress/cache
3+
.vitepress/dist
34
/build
45
api/dist/

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
!/_articles/panorama/webpack.md
66
!/_articles/scripting/vector-math.md
77

8-
.docusaurus
8+
.vitepress/cache
9+
.vitepress/dist
910
/build

.vitepress/config.mts

Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
import { defineConfig } from "vitepress";
2+
3+
export default defineConfig({
4+
title: "ModDota",
5+
head: [["link", { rel: "icon", href: "/images/favicon.ico" }]],
6+
srcDir: "_articles",
7+
outDir: "build",
8+
cleanUrls: true,
9+
ignoreDeadLinks: [/\.fbx$/],
10+
11+
themeConfig: {
12+
logo: "/images/logo.svg",
13+
14+
nav: [
15+
{ text: "Lua API", link: "https://moddota.com/api" },
16+
{
17+
text: "Panorama API",
18+
link: "https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Panorama/Javascript/API",
19+
},
20+
],
21+
22+
socialLinks: [{ icon: "discord", link: "https://discord.gg/gRmZgvz" }],
23+
24+
sidebar: [
25+
{ text: "Introduction", link: "/" },
26+
{ text: "Getting Started", link: "/getting-started" },
27+
{ text: "Scripting Introduction", link: "/scripting-introduction" },
28+
{
29+
text: "Typescript",
30+
collapsed: false,
31+
items: [
32+
{ text: "Introduction", link: "/scripting/Typescript/typescript-introduction" },
33+
{ text: "Ability", link: "/scripting/Typescript/typescript-ability" },
34+
{ text: "Modifier", link: "/scripting/Typescript/typescript-modifier" },
35+
{ text: "Events", link: "/scripting/Typescript/typescript-events" },
36+
{ text: "Tooltip Generator", link: "/scripting/Typescript/tooltip-generator" },
37+
],
38+
},
39+
{
40+
text: "Abilities, items, modifiers",
41+
collapsed: false,
42+
items: [
43+
{ text: "Ability KeyValues", link: "/abilities/ability-keyvalues" },
44+
{ text: "Item KeyValues", link: "/abilities/item-keyvalues" },
45+
{
46+
text: "The Importance of AbilityValues Values",
47+
link: "/abilities/the-importance-of-abilityvalues-values",
48+
},
49+
{
50+
text: "Passing AbilityValues Values into Lua",
51+
link: "/abilities/passing-abilityvalues-values-into-lua",
52+
},
53+
{ text: "AbilityDuration Tooltips", link: "/abilities/abilityduration-tooltips" },
54+
{ text: "Simple Custom Ability", link: "/abilities/simple-custom-ability" },
55+
{ text: "Creating Innate Abilities", link: "/abilities/creating-innate-abilities" },
56+
{ text: "Making Any Ability Use Charges", link: "/abilities/making-any-ability-use-charges" },
57+
{ text: "Calling Spells with SetCursor", link: "/abilities/calling-spells-with-setcursor" },
58+
{
59+
text: "Lua Abilities and Modifiers",
60+
link: "https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Lua_Abilities_and_Modifiers",
61+
},
62+
{ text: "Lua Item Tutorial", link: "/abilities/lua-item-tutorial" },
63+
{
64+
text: "Lua Modifiers",
65+
collapsed: false,
66+
items: [
67+
{ text: "Part 1", link: "/abilities/lua-modifiers/1" },
68+
{ text: "Part 2", link: "/abilities/lua-modifiers/2" },
69+
{ text: "Part 3", link: "/abilities/lua-modifiers/3" },
70+
{ text: "Part 4", link: "/abilities/lua-modifiers/4" },
71+
{ text: "Part 5", link: "/abilities/lua-modifiers/5" },
72+
],
73+
},
74+
{
75+
text: "Reutilizing Built-in Modifiers",
76+
link: "/abilities/reutilizing-built-in-modifiers",
77+
},
78+
{
79+
text: "Datadriven",
80+
collapsed: false,
81+
items: [
82+
{
83+
text: "Ability Events & Modifiers",
84+
link: "/abilities/datadriven/datadriven-ability-events-modifiers",
85+
},
86+
{ text: "All About the Target", link: "/abilities/datadriven/all-about-the-target" },
87+
{
88+
text: "Channeling Animations",
89+
link: "/abilities/datadriven/channeling-animations",
90+
},
91+
{
92+
text: "Invisibility Ability Example",
93+
link: "/abilities/datadriven/invisibility-ability-example",
94+
},
95+
{
96+
text: "Illusion Ability Example",
97+
link: "/abilities/datadriven/illusion-ability-example",
98+
},
99+
{
100+
text: "Rotate Ability Example",
101+
link: "/abilities/datadriven/rotate-ability-example",
102+
},
103+
{
104+
text: "Point Channeling AoE Example",
105+
link: "/abilities/datadriven/point-channeling-aoe-ability-example",
106+
},
107+
{
108+
text: "Hero & Creep Modifier Durations",
109+
link: "/abilities/datadriven/apply-hero-and-creep-modifier-durations",
110+
},
111+
{
112+
text: "Physics Ability Example (Exorcism)",
113+
link: "/abilities/datadriven/physics-ability-example-exorcism",
114+
},
115+
],
116+
},
117+
{
118+
text: "Modifier Properties in Tooltips",
119+
link: "/abilities/modifier-properties-in-tooltips",
120+
},
121+
{ text: "Server to Client", link: "/abilities/server-to-client" },
122+
],
123+
},
124+
{
125+
text: "Units",
126+
collapsed: false,
127+
items: [
128+
{ text: "Unit KeyValues", link: "/units/unit-keyvalues" },
129+
{ text: "Unit Producing Buildings", link: "/units/unit-producing-buildings" },
130+
{ text: "Creating Units with a Duration", link: "/units/creating-units-with-a-duration" },
131+
{ text: "Adding a Simple AI to Units", link: "/units/adding-a-very-simple-ai-to-units" },
132+
{ text: "Simple Neutral AI", link: "/units/simple-neutral-ai" },
133+
{
134+
text: "Creature AttachWearable Blocks",
135+
link: "/units/create-creature-attachwearable-blocks-directly-from-the-keyvalues",
136+
},
137+
],
138+
},
139+
{
140+
text: "Scripting",
141+
collapsed: false,
142+
items: [
143+
{ text: "Custom Mana System", link: "/scripting/custom-mana-system" },
144+
{ text: "Item Restrictions/Requirements", link: "/scripting/item-restrictions-requirements" },
145+
{ text: "Item Drop System", link: "/scripting/item-drop-system" },
146+
{ text: "Making an RPG-like Looting Chest", link: "/scripting/making-a-rpg-like-looting-chest" },
147+
{ text: "Scripted Shop Spawning", link: "/scripting/scripted-shop-spawning" },
148+
{ text: "Lava Damage", link: "/scripting/lava-damage" },
149+
{ text: "Using Dota Filters", link: "/scripting/using-dota-filters" },
150+
{ text: "Particle Attachment", link: "/scripting/particle-attachment" },
151+
{ text: "Vector Math", link: "/scripting/vector-math" },
152+
{
153+
text: "Precache: Fixing and Avoiding Issues",
154+
link: "/scripting/precache-fixing-and-avoiding-issues",
155+
},
156+
{
157+
text: "Custom NetTables",
158+
link: "https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Custom_Nettables",
159+
},
160+
{ text: "Advanced Looting Chest", link: "/scripting/advanced-looting-chest" },
161+
],
162+
},
163+
{
164+
text: "Panorama UI",
165+
collapsed: false,
166+
items: [
167+
{
168+
text: "Introduction",
169+
link: "https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Panorama",
170+
},
171+
{ text: "Inclusive Panorama UI", link: "/panorama/inclusive-panorama-ui" },
172+
{
173+
text: "Panorama UI with TypeScript",
174+
link: "/panorama/introduction-to-panorama-ui-with-typescript",
175+
},
176+
{ text: "Keybindings", link: "/panorama/keybindings" },
177+
{ text: "DOTAScenePanel", link: "/panorama/dotascenepanel" },
178+
{ text: "Button Examples", link: "/panorama/button-examples" },
179+
{
180+
text: "Custom Game Setup",
181+
link: "https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Custom_Game_Setup",
182+
},
183+
{ text: "Hiding HUD with SetHUDVisible", link: "/panorama/hiding-hud-with-sethudvisible" },
184+
{ text: "Webpack", link: "/panorama/webpack" },
185+
{ text: "React", link: "/panorama/react" },
186+
],
187+
},
188+
{
189+
text: "Assets",
190+
collapsed: false,
191+
items: [
192+
{ text: "Asset File Type Reference", link: "/assets/asset-file-type-reference" },
193+
{
194+
text: "Maps",
195+
collapsed: false,
196+
items: [
197+
{ text: "Hammer Tutorials", link: "/assets/maps/hammer-tutorials" },
198+
{
199+
text: "Making Skip/Clip Blocks from Models",
200+
link: "/assets/maps/making-skip-clip-blocks-out-of-models",
201+
},
202+
],
203+
},
204+
{
205+
text: "Models",
206+
collapsed: false,
207+
items: [
208+
{ text: "MDL to VMDL Conversion", link: "/assets/models/mdl-to-vmdl-conversion" },
209+
{
210+
text: "Adding Hitbox to Models Without a Bone",
211+
link: "/assets/models/adding-hitbox-to-models-without-a-bone",
212+
},
213+
{
214+
text: "Importing Models & Material Editor",
215+
link: "/assets/models/importing-models-and-using-material-editor",
216+
},
217+
{
218+
text: "Exporting Models & Materials/Textures",
219+
link: "/assets/models/exporting-models-and-materials-textures",
220+
},
221+
{
222+
text: "Custom Hero Models & Animations",
223+
link: "/assets/models/custom-hero-models-materials-animations",
224+
},
225+
],
226+
},
227+
{
228+
text: "Particles",
229+
collapsed: false,
230+
items: [
231+
{ text: "Particle Tutorial", link: "/assets/particles/particle-tutorial" },
232+
{ text: "Particle Basics", link: "/assets/particles/particle-basics" },
233+
{ text: "Chaos Wave Particle", link: "/assets/particles/chaos-wave-particle" },
234+
{
235+
text: "Falling Cherry Blossom Petal",
236+
link: "/assets/particles/falling-cherry-blossom-petal-for-spring-mood-particle",
237+
},
238+
{ text: "Volcano Particle", link: "/assets/particles/volcano-particle" },
239+
{ text: "Status Effects", link: "/assets/particles/status-effects" },
240+
],
241+
},
242+
{ text: "Custom Sounds", link: "/assets/custom-sounds" },
243+
{
244+
text: "Extracting & Compiling VTEX Files",
245+
link: "/assets/extracting-and-compiling-vtex-files",
246+
},
247+
{ text: "Custom Minimap Icons", link: "/assets/custom-minimap-icons" },
248+
],
249+
},
250+
{
251+
text: "Tools",
252+
collapsed: false,
253+
items: [
254+
{ text: "Setting Up for Collaboration", link: "/tools/setting-up-for-collaboration" },
255+
{ text: "Useful Console Commands", link: "/tools/useful-console-commands" },
256+
{ text: "Setting Up with GitHub", link: "/tools/setting-up-your-addon-with-github" },
257+
{ text: "Combining KV Files Using #base", link: "/tools/combining-kv-files-using-base" },
258+
{ text: "Improving vConsole", link: "/tools/improvement-vConsole" },
259+
{ text: "GitHub Repos and Search", link: "/tools/github-repos-and-search" },
260+
],
261+
},
262+
{ text: "Contribute", link: "/contribute" },
263+
],
264+
265+
editLink: {
266+
pattern: "https://github.com/ModDota/moddota.github.io/edit/source/_articles/:path",
267+
},
268+
269+
search: {
270+
provider: "algolia",
271+
options: {
272+
appId: "53WE0HHYGT",
273+
apiKey: "ce612349c2e1e35842e9630128e92dc2",
274+
indexName: "moddota",
275+
},
276+
},
277+
},
278+
279+
vite: {
280+
publicDir: "../static",
281+
},
282+
283+
markdown: {
284+
languages: ["lua"],
285+
},
286+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<script setup lang="ts">
2+
const props = defineProps<{
3+
id: string;
4+
aspectRatio?: number;
5+
hd?: string;
6+
}>();
7+
8+
const ratio = props.aspectRatio ?? 4 / 3;
9+
const paddingBottom = `${(1 / ratio) * 100}%`;
10+
const src = `https://gfycat.com/ifr/${props.id}?hd=${props.hd ?? "0"}`;
11+
</script>
12+
13+
<template>
14+
<p :style="{ position: 'relative', paddingBottom }">
15+
<iframe
16+
:src="src"
17+
scrolling="no"
18+
frameborder="0"
19+
allowfullscreen
20+
width="100%"
21+
height="100%"
22+
style="position: absolute; top: 0; left: 0"
23+
/>
24+
</p>
25+
</template>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script setup lang="ts">
2+
import { withBase } from "vitepress";
3+
4+
const props = defineProps<{
5+
path: string;
6+
controls?: boolean;
7+
}>();
8+
</script>
9+
10+
<template>
11+
<video width="100%" height="100%" autoplay muted loop :controls="props.controls ?? false">
12+
<source :src="withBase(props.path)" type="video/mp4" />
13+
</video>
14+
</template>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script setup lang="ts">
2+
const props = defineProps<{
3+
id?: string;
4+
playlistId?: string;
5+
aspectRatio?: number;
6+
}>();
7+
8+
const ratio = props.aspectRatio ?? 16 / 9;
9+
const paddingBottom = `${(1 / ratio) * 100}%`;
10+
const embedUrl = props.playlistId
11+
? `https://www.youtube.com/embed/videoseries?list=${props.playlistId}`
12+
: `https://www.youtube.com/embed/${props.id}`;
13+
</script>
14+
15+
<template>
16+
<p :style="{ position: 'relative', paddingBottom }">
17+
<iframe
18+
:src="embedUrl"
19+
frameborder="0"
20+
allowfullscreen
21+
width="100%"
22+
height="100%"
23+
style="position: absolute; top: 0; left: 0"
24+
/>
25+
</p>
26+
</template>

0 commit comments

Comments
 (0)