Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add components for VS and VS Code icons #18

Merged
merged 1 commit into from
Mar 31, 2025
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
Binary file not shown.
Binary file added src/public/assets/vs-icon.webp
Binary file not shown.