From fa398bf56db580189d6a49c488655be56c82e704 Mon Sep 17 00:00:00 2001 From: Dmitrij Polianin Date: Sun, 27 Jun 2021 11:24:50 +0300 Subject: [PATCH] Add update index.html site title from dynamic config --- Client/package.json | 2 +- README.RU.md | 2 +- README.md | 2 +- .../Services/ConfigurationAdminService.cs | 21 ++++++++++++------- Server/SunEngine.Cli/SunEngine.Cli.csproj | 2 +- Server/SunEngine.Core/SunEngine.Core.csproj | 2 +- SunEngine.md | 2 +- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Client/package.json b/Client/package.json index c6c3fe48..8f83a09d 100644 --- a/Client/package.json +++ b/Client/package.json @@ -1,6 +1,6 @@ { "name": "sunengine-client", - "version": "2.13.3", + "version": "2.13.4", "description": "SunEngine - web engine with support of blog, forum and articles functionality", "productName": "SunEngine", "author": "Dmitrij Polianin", diff --git a/README.RU.md b/README.RU.md index ed0ee3b4..1ca1919b 100644 --- a/README.RU.md +++ b/README.RU.md @@ -9,7 +9,7 @@ # SunEngine - +
diff --git a/README.md b/README.md index e6431d80..59186ee6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Build on AspNet Core, VueJS, Quasar. # SunEngine - +
diff --git a/Server/SunEngine.Admin/Services/ConfigurationAdminService.cs b/Server/SunEngine.Admin/Services/ConfigurationAdminService.cs index 88b22392..2af6acd2 100644 --- a/Server/SunEngine.Admin/Services/ConfigurationAdminService.cs +++ b/Server/SunEngine.Admin/Services/ConfigurationAdminService.cs @@ -106,7 +106,7 @@ public void UpdateClientScripts() File.WriteAllText(configJsPath, configJs); UpdateConfigAndCustomCssVersion(); - UpdateDescription(); + UpdateTitleAndDescription(); } public void UpdateConfigAndCustomCssVersion() @@ -154,22 +154,27 @@ protected void UpdateCustomJavaScriptVersion() File.WriteAllText(configJsPath, text); } - public void UpdateDescription() + public void UpdateTitleAndDescription() { - string description = configurationRoot.GetValue(typeof(String), "Global:SiteDescription").ToString(); - - description = new Regex("[<>\"\'/`]").Replace(description,""); - var indexHtmlPath = pathService.Combine(PathNames.WwwRootDirName, PathNames.IndexHtmlFileName); if (!File.Exists(indexHtmlPath)) { Console.WriteLine("Can not write to file " + indexHtmlPath); return; } - string text = File.ReadAllText(indexHtmlPath); - Regex reg = new Regex("\"\'/`]").Replace(title,""); + Regex reg = new Regex("(.*?)"); + text = reg.Replace(text, $"{title}"); + + string description = configurationRoot.GetValue(typeof(String), "Global:SiteDescription").ToString(); + description = new Regex("[<>\"\'/`]").Replace(description,""); + reg = new Regex(" net5.0 latest - 2.13.3 + 2.13.4 SunEngine Dmitrij Polianin Site engine with blog, forum and articles functionalities on Asp.Net Core and Vue.Js. diff --git a/Server/SunEngine.Core/SunEngine.Core.csproj b/Server/SunEngine.Core/SunEngine.Core.csproj index c23070f4..9f411a00 100644 --- a/Server/SunEngine.Core/SunEngine.Core.csproj +++ b/Server/SunEngine.Core/SunEngine.Core.csproj @@ -2,7 +2,7 @@ net5.0 - 2.13.3 + 2.13.4 default diff --git a/SunEngine.md b/SunEngine.md index b4b207c9..7483ad19 100644 --- a/SunEngine.md +++ b/SunEngine.md @@ -1,5 +1,5 @@ # SunEngine -**Version 2.13.3** +**Version 2.13.4** *************************************************************** Do not delete this file! This file need to detect project root. ***************************************************************