Skip to content

Commit

Permalink
Merge branch 'v13/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-burandt committed Oct 29, 2024
2 parents bb0d22d + 7dfe00a commit a122ef4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 8 additions & 2 deletions Blend.Sitemap/Assets/Views/Sitemap.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@
}
}
<lastmod>@item.UpdateDate</lastmod>
<changefreq>@item.ChangeFrequency</changefreq>
<priority>@item.Priority</priority>
@if (item.ChangeFrequency is not ChangeFrequency.omit)
{
<changefreq>@item.ChangeFrequency</changefreq>
}
@if (item.Priority is not null && item.Priority.Any())
{
<priority>@item.Priority</priority>
}
@if (Model.IncludePageImages)
{
DisplayRelatedImages(item.ImageUrls);
Expand Down
4 changes: 2 additions & 2 deletions Blend.Sitemap/SitemapBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ private SitemapPage LoadPage(IPublishedContent content, SitemapDocumentTypeOptio

private SitemapPage GetPage(IPublishedContent content, SitemapDocumentTypeOptions type, string languageIsoCode)
{
var priority = "1.0";
if (type.Priority < 10)
var priority = "";
if (type.Priority != 0 && type.Priority < 10)
priority = $"0.{type.Priority}";

var page = new SitemapPage()
Expand Down
3 changes: 1 addition & 2 deletions Blend.Sitemap/SitemapOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ public class SitemapDocumentTypeOptions
/// <summary>
/// How often the does the content in these document types change
/// </summary>
[DefaultValue(ChangeFrequency.monthly)]
[Description("How often the does the content in these document types change")]
public ChangeFrequency ChangeFrequency { get; set; }

/// <summary>
/// What is the priority of these document types
/// </summary>
[DefaultValue(5)]
[Description("What is the priority of these document types")]
public int Priority { get; set; }
}
Expand All @@ -79,6 +77,7 @@ public class SitemapDocumentTypeOptions
[Description("Options for Change Frequency")]
public enum ChangeFrequency
{
omit,
always,
hourly,
daily,
Expand Down

0 comments on commit a122ef4

Please sign in to comment.