WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 512ff39

Browse files
committed
Add Sitemap for Netlify support
1 parent 2660f37 commit 512ff39

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/.vuepress/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { defineUserConfig } from "vuepress";
22

33
import theme from "./theme.js";
44

5+
const isNetlify = process.env.NETLIFY_CNAME;
6+
57
export default defineUserConfig({
6-
base: "/",
8+
base: isNetlify ? '/' : '/',
79

810
lang: "zh-CN",
911
title: "bxx-114514 的留档博客",

src/.vuepress/theme.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { hopeTheme } from "vuepress-theme-hope";
33
import navbar from "./navbar.js";
44
import sidebar from "./sidebar.js";
55

6+
const isNetlify = process.env.NETLIFY_CNAME;
7+
68
export default hopeTheme({
7-
hostname: "https://bxx-114514.github.io",
9+
hostname: isNetlify ? 'https://bxx114514.netlify.app' : 'https://bxx-114514.github.io/',
810

911
author: {
1012
name: "천화(天華)SRSH",

0 commit comments

Comments
 (0)