From 0125c52198a422a94c081fa182862a2d1b2597cf Mon Sep 17 00:00:00 2001 From: Nick Vella Date: Tue, 2 Jul 2019 18:40:40 +1000 Subject: [PATCH] ssg: StaticSiteClient: GetFileNameForPost initial impl --- .../OpenLiveWriter.BlogClient/Clients/StaticSiteClient.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/StaticSiteClient.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/StaticSiteClient.cs index a3ca91af..d719810a 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/StaticSiteClient.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/StaticSiteClient.cs @@ -182,6 +182,13 @@ namespace OpenLiveWriter.BlogClient.Clients PublishCommand = blogCredentials.GetCustomValue(CONFIG_PUBLISH_COMMAND); } + private string GetFileNameForPost(BlogPost post, bool newPost) + { + var safeTitle = WEB_UNSAFE_CHARS.Replace(post.Title.ToLower(), "").Replace(" ", "-"); + + return $"{post.DatePublished.ToString("yyyy-MM-dd")}-{safeTitle}"; + } + /// /// Always false. It is not possible to perform remote detection on a static site, as /// it may not be published yet, or published to a web location.