diff --git a/.gitignore b/.gitignore index 767dbc6..cd06b22 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ dist/ .specstory .cursorindexingignore .cursor +.spec-workflow/ # 系统文件 .DS_Store @@ -18,9 +19,10 @@ Thumbs.db # 个人笔记 -docs/* +docs/ # 测试相关文件 +dev/ jest.config.js tests/ coverage/ @@ -32,5 +34,6 @@ tests/screenshots/ tests/fixtures/ *.test.js *.spec.js + # SpecStory explanation file .specstory/.what-is-this.md diff --git a/package.json b/package.json index db455f5..d204a4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "menav", - "version": "1.2.3", + "version": "1.3.0", "description": "A personal navigation website", "main": "src/generator.js", "homepage": "https://rbetree.github.io/menav", diff --git a/src/generator.js b/src/generator.js index 66c89bb..26254b9 100644 --- a/src/generator.js +++ b/src/generator.js @@ -283,12 +283,32 @@ function ensureConfigDefaults(config) { result.site = result.site || {}; result.navigation = result.navigation || []; result.fonts = result.fonts || {}; + + // 确保字体配置完整 + result.fonts.title = result.fonts.title || {}; + result.fonts.title.family = result.fonts.title.family || 'Arial'; + result.fonts.title.weight = result.fonts.title.weight || 700; + result.fonts.title.source = result.fonts.title.source || 'system'; + + result.fonts.subtitle = result.fonts.subtitle || {}; + result.fonts.subtitle.family = result.fonts.subtitle.family || 'Arial'; + result.fonts.subtitle.weight = result.fonts.subtitle.weight || 500; + result.fonts.subtitle.source = result.fonts.subtitle.source || 'system'; + + result.fonts.body = result.fonts.body || {}; + result.fonts.body.family = result.fonts.body.family || 'Arial'; + result.fonts.body.weight = result.fonts.body.weight || 400; + result.fonts.body.source = result.fonts.body.source || 'system'; + result.profile = result.profile || {}; result.social = result.social || []; result.categories = result.categories || []; // 站点基本信息默认值 result.site.title = result.site.title || 'MeNav导航'; + result.site.description = result.site.description || '个人网络导航站'; + result.site.author = result.site.author || 'MeNav User'; + result.site.logo_text = result.site.logo_text || '导航站'; result.site.favicon = result.site.favicon || 'favicon.ico'; result.site.logo = result.site.logo || null; result.site.footer = result.site.footer || ''; diff --git a/templates/components/category.hbs b/templates/components/category.hbs index 3dfc2b2..c624cfd 100644 --- a/templates/components/category.hbs +++ b/templates/components/category.hbs @@ -1,5 +1,5 @@
-

{{name}}

+

{{name}}

{{#if sites.length}} {{#each sites}} @@ -9,4 +9,4 @@

暂无网站

{{/if}}
-
\ No newline at end of file + diff --git a/templates/components/navigation.hbs b/templates/components/navigation.hbs index af4e6d2..3a8a165 100644 --- a/templates/components/navigation.hbs +++ b/templates/components/navigation.hbs @@ -5,7 +5,7 @@
- {{name}} + {{name}} {{#if submenu}}{{/if}} {{#if submenu}} diff --git a/templates/components/social-links.hbs b/templates/components/social-links.hbs index fae8fc5..190c986 100644 --- a/templates/components/social-links.hbs +++ b/templates/components/social-links.hbs @@ -5,7 +5,7 @@
- {{name}} + {{name}} {{/each}} diff --git a/templates/layouts/default.hbs b/templates/layouts/default.hbs index 656f261..0c7f873 100644 --- a/templates/layouts/default.hbs +++ b/templates/layouts/default.hbs @@ -4,13 +4,25 @@ - {{site.title}} + {{site.title}} + + {{{googleFontsLink}}} + + + + + + + + + +