Remove macros (#15794)

* Remove macros!

* Clean up snippets

* Add migration that deletes all macros

* Review comments
This commit is contained in:
Kenn Jacobsen
2024-02-29 15:11:06 +01:00
committed by GitHub
parent 47d07bf2d8
commit 976bca456e
160 changed files with 159 additions and 7340 deletions

View File

@@ -18,15 +18,6 @@ public partial class PartialViewSnippetCollectionBuilder : LazyCollectionBuilder
{
var embeddedSnippets = new List<PartialViewSnippet>(base.CreateItems(factory));
// Ignore these
var filterNames = new List<string>
{
"Gallery",
"ListChildPagesFromChangeableSource",
"ListChildPagesOrderedByProperty",
"ListImagesFromMediaFolder"
};
var snippetProvider = new EmbeddedFileProvider(typeof(IAssemblyProvider).Assembly, "Umbraco.Cms.Core.EmbeddedResources.Snippets");
IEnumerable<IFileInfo> embeddedFiles = snippetProvider.GetDirectoryContents(string.Empty)
.Where(x => !x.IsDirectory && x.Name.EndsWith(".cshtml"));
@@ -35,11 +26,6 @@ public partial class PartialViewSnippetCollectionBuilder : LazyCollectionBuilder
foreach (IFileInfo file in embeddedFiles)
{
var id = Path.GetFileNameWithoutExtension(file.Name);
if (filterNames.Contains(id))
{
continue;
}
var name = id.SplitPascalCasing(shortStringHelper).ToFirstUpperInvariant();
using var stream = new StreamReader(file.CreateReadStream());
var content = CleanUpSnippetContent(stream.ReadToEnd().Trim());