Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faFaucet, faChevronLeft, faChevronRight, faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons";
import { faGithub, faDiscord } from "@fortawesome/free-brands-svg-icons";
import InlineIcon from "../../components/tccpp/components/InlineIcon.vue";

library.add(faFaucet, faChevronLeft, faChevronRight, faGithub, faArrowUpRightFromSquare, faDiscord);

import { InlineIcon, AllInlineIcons } from "../../components/tccpp";

export default {
extends: theme,
Layout: () => {
Expand All @@ -22,5 +23,11 @@ export default {
enhanceApp({ app, router, siteData }) {
app.component("font-awesome-icon", FontAwesomeIcon);
app.component("InlineIcon", InlineIcon);

let iconName: keyof typeof AllInlineIcons;
for (iconName in AllInlineIcons) {
const icon = AllInlineIcons[iconName];
app.component(iconName, icon);
}
},
} satisfies Theme;
7 changes: 7 additions & 0 deletions src/components/tccpp/components/InlineIcons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import VisualStudio from "./icons/VisualStudio.vue";
import VSCode from "./icons/VsCode.vue";

export default {
VisualStudio: VisualStudio,
VSCode: VSCode,
};
7 changes: 7 additions & 0 deletions src/components/tccpp/components/icons/VisualStudio.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script setup lang="ts">
import InlineIcon from "../InlineIcon.vue";
</script>

<template>
<InlineIcon src="/assets/vs-icon.webp" alt="VS Community icon" />
</template>
7 changes: 7 additions & 0 deletions src/components/tccpp/components/icons/VsCode.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script setup lang="ts">
import InlineIcon from "../InlineIcon.vue";
</script>

<template>
<InlineIcon src="/assets/vs-code-icon.webp" alt="VS Code icon" />
</template>
3 changes: 3 additions & 0 deletions src/components/tccpp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default as InlineIcon } from "./components/InlineIcon.vue";

export { default as AllInlineIcons } from "./components/InlineIcons.ts";
Binary file added src/public/assets/vs-code-icon.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/public/assets/vs-icon.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.