public async Task From_root_of_the_path() { /* Given */ var collector = new SectionCollector(); await _catalog.Add(_aggregator.Aggregate(CancellationToken.None)); /* When */ await collector.Collect(_catalog); /* Then */ Assert.Single(collector.Sections, section => section.Id == "root"); }
public async Task Build_site() { /* Given */ var collector = new SectionCollector(); await _catalog.Add(_aggregator.Aggregate(CancellationToken.None)); await collector.Collect(_catalog); var sut = new SiteBuilder(_site); /* When */ var site = sut.Add(collector.Sections) .Build(); /* Then */ Assert.NotEmpty(site.Versions); }
public async Task Execute(CancellationToken cancellationToken = default) { using var _ = _logger.BeginScope(nameof(Execute)); _logger.LogInformation("Executing pipeline"); await CacheFileSystem.DeleteDir("content"); await CacheFileSystem.GetOrCreateDirectory("content"); await CacheFileSystem.DeleteDir("content-html"); await CacheFileSystem.GetOrCreateDirectory("content-html"); var outputPath = GetRootedPath(CurrentPath, Site.OutputPath); await FileSystem.CleanDirectory(outputPath); await FileSystem.GetOrCreateDirectory(outputPath); RawCache = await CacheFileSystem.Mount("content"); PageCache = await CacheFileSystem.Mount("content-html"); OutputFs = await FileSystem.Mount(outputPath); /* Aggregate content based on branches, tags and etc given in site definition */ var aggregator = new ContentAggregator( Site, GitRoot, FileSystem, new MimeDbClassifier()); var catalog = new Catalog(); /* Add content */ await catalog.Add(aggregator.Aggregate(cancellationToken), cancellationToken); /* Site */ var site = await BuildSite(catalog, Site); /* UI */ var ui = new UiBuilder(PageCache, OutputFs); await ui.BuildSite(site); _logger.LogInformation("Pipeline completed"); }