-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.cs
26 lines (24 loc) · 847 Bytes
/
Config.cs
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
using System.Text.Json;
using System.Text.Json.Serialization;
namespace atlasComments
{
[JsonSerializable(typeof(Config))]
internal partial class MyJsonContext : JsonSerializerContext
{
}
public class Config
{
public Dictionary<string,string> FileSourcePath { get; set; } = new()
{
{ "/srv/gemini/her.st/blog/", "blog/" },
{ "/srv/gemini/her.st/pages/", "pages/" },
};
public Dictionary<string, List<Comment>> FileComments { get; set; } = new();
public Dictionary<string, string> OriginalFiles { get; set; } = new();
public async ValueTask SaveAsync(string path)
{
var json = JsonSerializer.SerializeToUtf8Bytes(this, MyJsonContext.Default.Config);
await File.WriteAllBytesAsync(path, json);
}
}
}