-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Sample implementation to remove restrictions:
- Slug in English only
- Sequence number only 2 digits
Class SlugService taken from the project OrchardCore
private IList<StaticPage> GetStructureItemsRecursive(StaticSitemap structure, string path, string prefix = "")
{
var items = new List<StaticPage>();
var slugService = new SlugService();
foreach (var info in GetDirectoryItems(path))
{
if (info.Name != "Index.md")
{
var title = info is DirectoryInfo ? info.Name : Path.GetFileNameWithoutExtension(info.Name);
var indexSpace = title.IndexOf(' ');
if (indexSpace >= 0)
title = title.Substring(indexSpace + 1);
var slug = slugService.Slugify(title);
var item = new StaticPage
{
Title = title, // Utils.GenerateTitle(info),
Slug = prefix + slug, // Utils.GenerateSlug(info),
Path = info.FullName,
Created = info.CreationTime,
LastModified = info.LastWriteTime
};
}
// ...
}
// ...
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request