Skip to content

Commit

Permalink
fix DocumentType constant definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
filzrev committed Jun 26, 2023
1 parent 63fa6c6 commit 17fa984
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public override SaveResult Save(FileModel model)
{
var properties = (IDictionary<string, object>)model.Content;
documentType = properties.ContainsKey(Constants.PropertyName.RedirectUrl)
? nameof(DocumentType.Redirection)
: "Conceptual";
? Constants.DocumentType.Redirection
: Constants.DocumentType.Conceptual;
}

var result = new SaveResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ private static SitemapElementOptions GetMatchingOptions(SitemapOptions options,
{
switch (file.DocumentType)
{
case "Toc":
case "Redirection":
continue; // Skip non sitemap target files.
// Skip non sitemap target files.
case DataContracts.Common.Constants.DocumentType.Toc:
case DataContracts.Common.Constants.DocumentType.Redirection:
continue;

default:
break;
}
Expand Down
3 changes: 3 additions & 0 deletions src/Microsoft.DocAsCode.DataContracts.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ public static class Constants

public static class DocumentType
{
public const string Conceptual = "Conceptual";
public const string Toc = "Toc";
public const string ManagedReference = "ManagedReference";
public const string Resource = "Resource";
public const string Redirection = "Redirection";
}

Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.DocAsCode.Plugins/DocumentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ public enum DocumentType
Resource,
Metadata,
MarkdownFragments,
Redirection,
}

0 comments on commit 17fa984

Please sign in to comment.