Ejemplo n.º 1
0
 public void BuildContent(SiteContext ctx)
 {
     using (ctx.TryAddTemplateIncludeNamespace("ARKTools", "templates/Tools"))
         using (ctx.TryAddTemplateIncludeNamespace("ARKTools", "templates/tools"))
             using (ctx.TryAddTemplateDefaultIncludePath("templates/tools"))
             {
                 ctx.EmitDocument(new LegacyCreatureStats());
                 ctx.EmitDocument(new CreatureStats());
                 ctx.EmitDocument(new ColorTable());
                 ctx.EmitDocument(new VexApplication());
             }
 }
Ejemplo n.º 2
0
 public static void RedirectPage(this SiteContext ctx, string source, string target)
 {
     ctx.EmitDocument(new RedirectGenerator
     {
         Name      = source,
         TargetUrl = target,
     });
 }
Ejemplo n.º 3
0
        public void BuildInteractiveMaps(SiteContext ctx)
        {
            var worldRevMap = _dataManager.MapLegacyRevisionsToMaps(ModTag);

            foreach (var(mapRef, revisionId) in worldRevMap)
            {
                var map = new InteractiveMapGenerator(Info, ModTag, mapRef, revisionId);
                ctx.EmitDocument(map);
            }

            // Map out new-style revisions to worlds.
            var updates = _dataManager.FindModRevisionsByTag(ModTag, RevisionTag.ModUpdate);
        }
Ejemplo n.º 4
0
        public void BuildContent(SiteContext ctx)
        {
            BuildConfigurationArk config = ctx.GetConfiguration <BuildConfigurationArk>();

            // Acquire a sitemap exclusion token (temporary state
            // lock) if mod is unlisted from search engines.
            SitemapLocalExclusion?sitemapLock = null;

            if (Info.ExcludeFromSitemaps)
            {
                sitemapLock = ctx.OverrideSitemaps(false);
            }

            using (ctx.TryAddTemplateIncludeNamespace("ARKMods", "templates/Mods"))
                using (ctx.TryAddTemplateDefaultIncludePaths(new []
                {
                    "templates/mods",
                    Path.Join("templates/mods", ModTag),
                }))
                {
                    var updates  = _dataManager.FindModRevisionsByTag(ModTag, RevisionTag.ModUpdate);
                    var homePage = new ModHomeGenerator(Info);

                    ctx.EmitDocument(homePage);
                    BuildInteractiveMaps(ctx);

                    if (Info.WithEpicIni && config.GenerateInis)
                    {
                        var egs = new EpicIniGenerator(Info, updates.Last().Item2);
                        ctx.EmitDocument(egs);
                    }
                }

            // Release the sitemap lock if one was acquired.
            sitemapLock?.Dispose();
        }