1- import { siteConfig } from "./site.config" ;
1+ const splitEnvList = ( value , fallback ) => {
2+ if ( ! value ) {
3+ return fallback ;
4+ }
5+
6+ const items = value
7+ . split ( '|' )
8+ . map ( ( item ) => item . trim ( ) )
9+ . filter ( Boolean ) ;
10+
11+ return items . length > 0 ? items : fallback ;
12+ } ;
13+
14+ const defaultProfileTechStack = [
15+ {
16+ label : 'Python' ,
17+ icon : 'https://img.shields.io/badge/-Python-3776AB?logo=python&logoColor=white&style=flat-square' ,
18+ } ,
19+ {
20+ label : 'CUDA' ,
21+ icon : 'https://img.shields.io/badge/-CUDA-76B900?logo=nvidia&logoColor=white&style=flat-square' ,
22+ } ,
23+ {
24+ label : 'C++' ,
25+ icon : 'https://img.shields.io/badge/-C++-00599C?logo=cplusplus&logoColor=white&style=flat-square' ,
26+ } ,
27+ {
28+ label : 'JavaScript' ,
29+ icon : 'https://img.shields.io/badge/-JavaScript-yellow?logo=javascript&logoColor=white&style=flat-square' ,
30+ } ,
31+ {
32+ label : 'HTML5' ,
33+ icon : 'https://img.shields.io/badge/-HTML5-E34F26?logo=html5&logoColor=white&style=flat-square' ,
34+ } ,
35+ {
36+ label : 'Vue' ,
37+ icon : 'https://img.shields.io/badge/-Vue-4FC08D?logo=vue.js&logoColor=white&style=flat-square' ,
38+ } ,
39+ {
40+ label : 'PHP' ,
41+ icon : 'https://img.shields.io/badge/-PHP-777BB4?logo=php&logoColor=white&style=flat-square' ,
42+ } ,
43+ {
44+ label : 'Docker' ,
45+ icon : 'https://img.shields.io/badge/-Docker-2496ED?logo=docker&logoColor=white&style=flat-square' ,
46+ } ,
47+ {
48+ label : 'Slurm' ,
49+ icon : 'https://img.shields.io/badge/-Slurm-1F1F1F?logo=linux&logoColor=white&style=flat-square' ,
50+ } ,
51+ {
52+ label : 'Ubuntu' ,
53+ icon : 'https://img.shields.io/badge/-Ubuntu-E95420?logo=ubuntu&logoColor=white&style=flat-square' ,
54+ } ,
55+ ] ;
56+
57+ const parseTechStack = ( value , fallback ) => {
58+ if ( ! value ) {
59+ return fallback ;
60+ }
61+
62+ const items = value
63+ . split ( '|' )
64+ . map ( ( item ) => item . trim ( ) )
65+ . filter ( Boolean )
66+ . map ( ( item ) => {
67+ const [ label , icon ] = item . split ( '::' ) . map ( ( part ) => part . trim ( ) ) ;
68+
69+ if ( ! label || ! icon ) {
70+ return null ;
71+ }
72+
73+ return { label, icon } ;
74+ } )
75+ . filter ( Boolean ) ;
76+
77+ return items . length > 0 ? items : fallback ;
78+ } ;
79+
80+ const author = process . env . SITE_AUTHOR || '染念' ;
81+ const title = process . env . SITE_TITLE || '染念的笔记' ;
82+ const description = process . env . SITE_DESCRIPTION || 'Writing code, painful and happy' ;
83+ const keywords =
84+ process . env . SITE_KEYWORDS || '染念,染念的笔记,染念の笔记,染念的博客,博客,blog' ;
85+ const url = process . env . SITE_URL || 'https://dyedd.cn' ;
86+ const email = process . env . SITE_EMAIL || '1176996982@qq.com' ;
87+ const lang = process . env . SITE_LANG || 'zh-CN' ;
88+ const startTime = process . env . SITE_START_TIME || '2017-02-11' ;
89+ const profileAvatar = process . env . SITE_PROFILE_AVATAR || '/logo.jpg' ;
90+ const normalizedSiteUrl = url . replace ( / \/ $ / , '' ) ;
91+ const profileAvatarUrl = / ^ h t t p s ? : \/ \/ / . test ( profileAvatar )
92+ ? profileAvatar
93+ : `${ normalizedSiteUrl } /${ profileAvatar . replace ( / ^ \/ / , '' ) } ` ;
94+
95+ const defaultSiteConfig = {
96+ author,
97+ title,
98+ description,
99+ keywords,
100+ url,
101+ email,
102+ lang,
103+ startTime,
104+ analytics : {
105+ script : process . env . SITE_ANALYTICS_SCRIPT || 'https://statistics.dyedd.cn/script.js' ,
106+ websiteId :
107+ process . env . SITE_ANALYTICS_WEBSITE_ID || '11a02a3f-0cdd-452a-bbb8-37f195db86fd' ,
108+ } ,
109+ profile : {
110+ name : author ,
111+ avatar : profileAvatar ,
112+ badge : process . env . SITE_PROFILE_BADGE || '🐟' ,
113+ introduction : splitEnvList ( process . env . SITE_PROFILE_INTRO , [
114+ 'AI infra研究生,目前研究大规模分布式训练以及扩散模型在短临降水领域的应用' ,
115+ '过去我也学习过前后端,所以现在也是不专业的全栈开发者' ,
116+ ] ) ,
117+ motto : splitEnvList ( process . env . SITE_PROFILE_MOTTO , [ '🐎 马到成功,心想事成' , '🌈🌈🌈' ] ) ,
118+ statement :
119+ process . env . SITE_PROFILE_STATEMENT ||
120+ '我将在这里分享我的编程和人工智能知识。如果你对这些主题感兴趣,那么恭喜你找到宝藏了。接下来你可以查看内容或订阅' ,
121+ githubContributionChart :
122+ process . env . SITE_PROFILE_GITHUB_CHART || 'https://ghchart.rshah.org/409ba5/dyedd' ,
123+ techStack : parseTechStack ( process . env . SITE_PROFILE_TECH_STACK , defaultProfileTechStack ) ,
124+ } ,
125+ socialLinks : {
126+ github : {
127+ label : 'GitHub' ,
128+ icon : 'github' ,
129+ url : process . env . SITE_GITHUB_URL || 'https://github.com/dyedd' ,
130+ } ,
131+ email : {
132+ label : 'Email' ,
133+ icon : 'youxiang' ,
134+ url : `mailto:${ email } ` ,
135+ } ,
136+ qq : {
137+ label : 'QQ' ,
138+ icon : 'QQ' ,
139+ url :
140+ process . env . SITE_QQ_URL ||
141+ 'https://qm.qq.com/cgi-bin/qm/qr?k=nLIdzy8UC9VkZ0g2EwnoN1rwnxaYvFx0&jump_from=webapi&authKey=mq2RvfcTQxEgImX+XZv0tBeobeHX+wTaAxOXq7pEKdsUD+a2Hi7mIOBGEj2ZtSDJ' ,
142+ title : 'QQ' ,
143+ } ,
144+ } ,
145+ footer : {
146+ copyrightName : author ,
147+ poweredBy : {
148+ label : 'Powered by serenade' ,
149+ url : 'https://github.com/dyedd/serenade' ,
150+ } ,
151+ icp : {
152+ label : process . env . SITE_FOOTER_ICP_LABEL || '备案号:浙ICP备19020194号-1' ,
153+ url : 'https://beian.miit.gov.cn/' ,
154+ } ,
155+ } ,
156+ friends : {
157+ applicationTemplate : {
158+ name : author ,
159+ url,
160+ logo : profileAvatarUrl ,
161+ description,
162+ rss : `${ normalizedSiteUrl } /feed` ,
163+ } ,
164+ } ,
165+ } ;
2166
3167export default defineNuxtConfig ( {
4168 compatibilityDate : "2025-12-17" ,
@@ -21,24 +185,17 @@ export default defineNuxtConfig({
21185 app : {
22186 rootId : "nuxt-root" ,
23187 head : {
24- title : siteConfig . title ,
25- htmlAttrs : { lang : siteConfig . lang } ,
26- meta : [
27- { name : "description" , content : siteConfig . description } ,
28- { name : "author" , content : siteConfig . author } ,
29- { name : "keywords" , content : siteConfig . keywords } ,
30- ] ,
31188 script : [
32189 { src : "/iconfont.js" , defer : true } ,
33- {
34- src : siteConfig . analytics . script ,
35- defer : true ,
36- "data-website-id" : siteConfig . analytics . websiteId ,
37- } ,
38190 ] ,
39191 noscript : [ { textContent : "JavaScript is required" } ] ,
40192 } ,
41193 } ,
194+ runtimeConfig : {
195+ public : {
196+ siteConfig : defaultSiteConfig ,
197+ } ,
198+ } ,
42199 css : [ "~/assets/css/main.css" , "highlight.js/styles/atom-one-dark.css" ] ,
43200 modules : [ "@nuxtjs/tailwindcss" ] ,
44201 vite : {
0 commit comments