Use FileSystemProject in RazorLight

This commit is contained in:
2023-04-16 02:18:11 +02:00
parent e7d4d35f4e
commit 84cc5f0778
5 changed files with 7 additions and 9 deletions

View File

@ -14,8 +14,8 @@
window.addEventListener("afterprint", () => { location.reload(); });
}
</script>
<script src="C:\ProgramData\Elwig\resources\paged.polyfill.js"></script>
<link rel="stylesheet" href="C:\ProgramData\Elwig\resources\style.css"/>
<script src="@Raw(Model.DataPath)\resources\paged.polyfill.js"></script>
<link rel="stylesheet" href="@Raw(Model.DataPath)\resources\style.css" />
</head>
<body>
<div class="m1"></div>

View File

@ -9,6 +9,7 @@ namespace Elwig.Documents {
private TempFile? PdfFile = null;
public Document(string title) {
DataPath = App.DataPath;
Title = title;
Header = "<h1>Winzergenossenschaft Matzen</h1>";
Footer = "Winzergenossenschaft für Matzen und Umgebung reg. Gen.m.b.H.";
@ -24,6 +25,8 @@ namespace Elwig.Documents {
PdfFile = null;
}
public string DataPath { get; set; }
public string Title { get; set; }
public string Header { get; set; }

View File

@ -10,7 +10,7 @@ namespace Elwig.Documents {
public static async Task Init(Action evtHandler) {
var e = new RazorLightEngineBuilder()
.UseEmbeddedResourcesProject(typeof(App).Assembly, "Elwig.Documents")
.UseFileSystemProject(App.DataPath + "resources")
.UseMemoryCachingProvider()
.Build();