forked from cake-build/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.wyam
53 lines (48 loc) · 2.15 KB
/
config.wyam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Settings[Keys.Host] = "cakebuild.net";
Settings[DocsKeys.Title] = "Cake";
Settings[DocsKeys.Logo] = "/assets/img/logo.png";
Settings[DocsKeys.SourceFiles] = "../release/repo/src/**/{!bin,!obj,!packages,!*.Tests,}/**/*.cs";
Settings[DocsKeys.BaseEditUrl] = "https://github.com/cake-build/website/blob/develop/input/";
Settings[DocsKeys.IncludeDateInPostPath] = true;
Settings[DocsKeys.BlogAtomPath] = "blog/feed/atom/index.xml";
Settings[DocsKeys.BlogRssPath] = "blog/feed/rss/index.xml";
Pipelines.InsertBefore(DocsPipelines.Code, "Addins",
ReadFiles("../addins/*.yml"),
Yaml()
);
Pipelines.InsertAfter("Addins", "AddinCategories",
GroupByMany(@doc.List<string>("Categories"),
Documents("Addins")
),
Meta(Keys.WritePath, new FilePath("addins/" + @doc.String(Keys.GroupKey).ToLower().Replace(" ", "-") + "/index.html")),
Meta(Keys.RelativeFilePath, @doc.FilePath(Keys.WritePath)),
OrderBy(@doc.String(Keys.GroupKey))
);
Pipelines.InsertAfter(DocsPipelines.Api, "DslAliases",
GroupByMany(@doc.DocumentList(CodeAnalysisKeys.Attributes)
.Where(attr => attr.String(CodeAnalysisKeys.Name) == "CakeAliasCategoryAttribute")
.Select(attr => attr.Get<Microsoft.CodeAnalysis.AttributeData>(CodeAnalysisKeys.AttributeData).ConstructorArguments.FirstOrDefault().Value),
Documents(DocsPipelines.Api),
Where(@doc.String(CodeAnalysisKeys.Kind) == "NamedType"
&& @doc.DocumentList(CodeAnalysisKeys.Attributes)
.Any(attr => attr.String(CodeAnalysisKeys.Name) == "CakeAliasCategoryAttribute")
)
),
Meta(Keys.WritePath, new FilePath("dsl/" + @doc.String(Keys.GroupKey).ToLower().Replace(" ", "-") + "/index.html")),
Meta(Keys.RelativeFilePath, @doc.FilePath(Keys.WritePath)),
OrderBy(@doc.String(Keys.GroupKey))
);
Pipelines.Add("RenderAddins",
Documents("AddinCategories"),
Razor()
.WithLayout("/_AddinsLayout.cshtml"),
WriteFiles()
);
Pipelines.Add("RenderDsl",
Documents("DslAliases"),
Razor()
.WithLayout("/_DslLayout.cshtml"),
Headings(),
HtmlInsert("div#infobar-headings", (doc, ctx) => ctx.GenerateInfobarHeadings(doc)),
WriteFiles()
);