-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfig.wyam
41 lines (30 loc) · 1.69 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
#n Wyam.Yaml
#recipe Blog
#t SolidState
Yaml("FrontMatter");
FileSystem.InputPaths.Add("doc");
FileSystem.OutputPath = @"..\gh-pages";
Settings[Keys.CleanOutputPath] = false;
// Customize your settings and add new ones here
Settings[Keys.Host] = "mikeware.github.io";
Settings[Keys.LinkRoot] = "/SpaceBattleArena";
Settings[Keys.LinksUseHttps] = true;
Settings[BlogKeys.Title] = "Space Battle Arena by Mikeware";
Settings[BlogKeys.Description] = "Space Battle Arena is a ‘Programming Game‘ where you must write code (in Java) to autonomously control a space ship to accomplish specified objectives.";
Settings[BlogKeys.PostsPath] = "news";
Settings[BlogKeys.IncludeDateInPostPath] = true;
// Custom Settings
Settings["SBA.GitHub"] = "https://www.github.com/Mikeware/SpaceBattleArena";
Settings["SBA.ReleasePath"] = "/~https://github.com/Mikeware/SpaceBattleArena/releases/download/v1.2.0.1127";
// Insert Site Release Path to md file Content's before Generation
ShortcodeCollection.Add("ReleasePathLink", (KeyValuePair<string, string>[] args) => "<a href=\"" + Settings["SBA.ReleasePath"] + "/" + args.First().Value + "\">" + args.First().Value + "</a>");
// Modify Output Path of Posts to look like directories based on dates.
Pipelines["BlogPosts"].Append(
Meta(Keys.RelativeFilePath, (doc, ctx) =>
{
DateTime? publishedDate = doc.Get<DateTime?>(BlogKeys.Published, DateTime.Now);
var fileName = doc.FilePath(Keys.SourceFileName).ChangeExtension("html").FullPath.Substring(11);
var newPostsPath = ctx.DirectoryPath(BlogKeys.PostsPath).GetRelativePath((DirectoryPath)"../");
return $"{newPostsPath.FullPath}/{publishedDate:yyyy}/{publishedDate:MM}/{publishedDate:dd}/{fileName}";
})
);