From 30e2885783bca9aa7f537d06d8815ffd9f66e211 Mon Sep 17 00:00:00 2001 From: Yufei Huang Date: Mon, 19 Dec 2022 09:32:35 +0800 Subject: [PATCH] chore!: drop _docfxVersion in generated HTML --- .../default/partials/_head.liquid | 23 +++++++++---------- .../default/partials/head.tmpl.partial | 1 - src/docfx/SubCommands/BuildCommand.cs | 14 ----------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/src/docfx.website.themes/default/partials/_head.liquid b/src/docfx.website.themes/default/partials/_head.liquid index 2af71a645e8..cf5ecb8fa23 100644 --- a/src/docfx.website.themes/default/partials/_head.liquid +++ b/src/docfx.website.themes/default/partials/_head.liquid @@ -3,23 +3,22 @@ {%- if title and _appTitle -%} - {{title}} | {{appTitle}} - + {{ title }} | {{ appTitle }} + {%- else -%} {%- if title or _appTitle -%} - {{title}}{{appTitle}} - + {{ title }}{{ appTitle }} + {%- endif -%} {%- endif -%} - {%- if _description -%} - + {%- endif -%} {%- if _appFaviconPath -%} - + {%- else -%} - + {%- endif -%} @@ -27,12 +26,12 @@ {%- if _noindex -%} - + {%- endif -%} {%- if _enableSearch -%} - + {%- endif -%} {%- if _enableNewTab -%} - + {%- endif -%} - + \ No newline at end of file diff --git a/src/docfx.website.themes/default/partials/head.tmpl.partial b/src/docfx.website.themes/default/partials/head.tmpl.partial index 4e8cd7918b1..c9357ca2b71 100644 --- a/src/docfx.website.themes/default/partials/head.tmpl.partial +++ b/src/docfx.website.themes/default/partials/head.tmpl.partial @@ -6,7 +6,6 @@ {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} - {{#_description}}{{/_description}} diff --git a/src/docfx/SubCommands/BuildCommand.cs b/src/docfx/SubCommands/BuildCommand.cs index 50e3e29afc2..c8f5b4eeee3 100644 --- a/src/docfx/SubCommands/BuildCommand.cs +++ b/src/docfx/SubCommands/BuildCommand.cs @@ -18,8 +18,6 @@ namespace Microsoft.DocAsCode.SubCommands internal sealed class BuildCommand : ISubCommand { - private readonly string _version; - private readonly TemplateManager _templateManager; public string Name { get; } = nameof(BuildCommand); @@ -33,7 +31,6 @@ public BuildCommand(BuildJsonConfig config) Config = config; var assembly = typeof(Program).Assembly; - _version = EnvironmentContext.Version; SetDefaultConfigValue(Config); @@ -75,17 +72,6 @@ private void SetDefaultConfigValue(BuildJsonConfig config) { Config.Templates = new ListWithStringFallback { DocAsCode.Constants.DefaultTemplateName }; } - if (config.GlobalMetadata == null) - { - config.GlobalMetadata = new Dictionary - { - ["_docfxVersion"] = _version - }; - } - else if (!config.GlobalMetadata.ContainsKey("_docfxVersion")) - { - config.GlobalMetadata["_docfxVersion"] = _version; - } } ///