Skip to content

Commit

Permalink
🐛 Fixed #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Marthijn van den Heuvel committed Jun 16, 2024
1 parent 103658e commit fea215a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/"
@page "/another-home-index-route"
@attribute [Sitemap]

<PageTitle>Home</PageTitle>
Expand Down
6 changes: 3 additions & 3 deletions src/Sidio.Sitemap.Blazor/SitemapMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ private static Sidio.Sitemap.Core.Sitemap CreateSitemap(IComponentBaseProvider c
foreach (var type in types)
{
var sitemapAttribute = type.GetCustomAttribute<SitemapAttribute>();
var routeAttribute = type.GetCustomAttribute<RouteAttribute>();
if (sitemapAttribute != null && routeAttribute != null)
var routeAttributes = type.GetCustomAttributes<RouteAttribute>();
if (sitemapAttribute != null)
{
nodes.Add(CreateNode(sitemapAttribute, routeAttribute));
nodes.AddRange(routeAttributes.Select(routeAttribute => CreateNode(sitemapAttribute, routeAttribute)));
}
}

Expand Down

0 comments on commit fea215a

Please sign in to comment.