Skip to content

Commit dbad560

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

36 files changed

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