Skip to content

Commit

Permalink
🐞 fix(alias): fix alias error
Browse files Browse the repository at this point in the history
  • Loading branch information
bingling-sama committed Jul 29, 2024
1 parent 4158ab6 commit ef15f04
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .vitepress/theme/analyzers/mcla.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Ref } from "vue"
import { useCDN } from "@theme/utils/cdn"
import { useCDN } from "@/theme/utils/cdn"

export { VERSION, MCLA_GH_DB_PREFIX, loadMCLA }

Expand Down
2 changes: 1 addition & 1 deletion .vitepress/theme/components/AuthRedirect.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, onMounted } from "vue"
import { onAuthDone } from "@theme/auth/github"
import { onAuthDone } from "@/theme/auth/github"
const REDIRECT_TIMEOUT_SEC = 3
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/theme/components/LogViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
getAuthToken,
expireAuthToken,
redirectToAuth,
} from "@theme/auth/github"
} from "@/theme/auth/github"
const loading = ref(true)
const errorStr = ref("")
Expand Down
15 changes: 2 additions & 13 deletions .vitepress/theme/components/ResponsibleEditor.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<script setup lang="ts">
import { useData } from "vitepress"
import { computed } from "vue"
import { useCDN } from "@theme/utils/cdn"
import { useCDN } from "@/theme/utils/cdn"
const defaultAuthor = "GlobeMC"
const { frontmatter } = useData()
const editor = computed(() => {
return frontmatter.value?.editor
return frontmatter.value?.editor ?? "bingling-sama"
})
function getAvatarUrl(name: string) {
Expand All @@ -33,16 +32,6 @@ function getGitHubLink(name: string) {
</a>
</div>
</div>
<div v-else class="flex gap-2 items-center">
<a
:href="getGitHubLink(defaultAuthor)"
rel="noreferrer"
target="_blank"
class="flex items-center gap-2">
<img src="/logo-brand.webp" class="w-8 h-8 rounded-full" />
<p class="vp-main-clolr">{{ "GlobeMC" }}</p>
</a>
</div>
</template>

<style scoped>
Expand Down
8 changes: 3 additions & 5 deletions .vitepress/theme/configs/vite.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { fileURLToPath } from "node:url"
import path from "node:path"
import {
GitChangelog,
GitChangelogMarkdownSection,
} from "@nolebase/vitepress-plugin-git-changelog"

import authors from "@data/authors.json"
import authors from "../../data/authors.json"

function generateAvatarUrl(username: string) {
return `https://cdn.crashmc.com/https://github.com/${username}.png`
Expand All @@ -13,9 +13,7 @@ function generateAvatarUrl(username: string) {
const viteConfig = {
resolve: {
alias: {
"@": fileURLToPath(new URL("../../", import.meta.url)),
"@theme": fileURLToPath(new URL("../", import.meta.url)),
"@data": fileURLToPath(new URL("../../data", import.meta.url)),
"@": path.resolve(__dirname, "../../"),
},
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/theme/layouts/Posts.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { data as posts } from "@data/posts.data"
import { data as posts } from "@/data/posts.data"
</script>

<template>
Expand Down
41 changes: 41 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
"paths": {
"@/*": [
"./.vitepress/*"
],
"@theme/*": [
"./.vitepress/theme/*"
],
"@data/*": [
"./.vitepress/data/*"
]
},
"types": [
Expand Down

0 comments on commit ef15f04

Please sign in to comment.