in src/tooling/docs-assembler/Navigation/AssemblerDocumentationSet.cs [26:77]
public AssemblerDocumentationSet(
ILoggerFactory logger,
AssembleContext context,
Checkout checkout,
CrossLinkResolver crossLinkResolver,
TableOfContentsTreeCollector treeCollector)
{
AssembleContext = context;
Checkout = checkout;
var env = context.Environment;
var path = checkout.Directory.FullName;
var output = env.PathPrefix != null
? Path.Combine(context.OutputDirectory.FullName, env.PathPrefix)
: context.OutputDirectory.FullName;
var gitConfiguration = new GitCheckoutInformation
{
RepositoryName = checkout.Repository.Name,
Ref = checkout.HeadReference,
Remote = $"elastic/${checkout.Repository.Name}",
Branch = checkout.Repository.GitReferenceCurrent
};
var buildContext = new BuildContext(
context.Collector,
context.ReadFileSystem,
context.WriteFileSystem,
path,
output,
gitConfiguration
)
{
UrlPathPrefix = env.PathPrefix,
Force = true,
AllowIndexing = env.AllowIndexing,
GoogleTagManager = new GoogleTagManagerConfiguration
{
Enabled = env.GoogleTagManager.Enabled,
Id = env.GoogleTagManager.Id,
Auth = env.GoogleTagManager.Auth,
Preview = env.GoogleTagManager.Preview,
CookiesWin = env.GoogleTagManager.CookiesWin
},
CanonicalBaseUrl = new Uri("https://www.elastic.co"), // Always use the production URL. In case a page is leaked to a search engine, it should point to the production site.
AssemblerBuild = true
};
BuildContext = buildContext;
DocumentationSet = new DocumentationSet(buildContext, logger, crossLinkResolver, treeCollector);
}