Skip to content

Commit

Permalink
Fix post preview
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Aug 11, 2024
1 parent 33f6902 commit 61cda74
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<Project>
<Target Name="ResolveWebView2CoreDuplicates1" BeforeTargets="_ComputeResolvedFilesToPublishTypes" AfterTargets="ComputeFilesToPublish" />
<Target Name="ResolveWebView2CoreDuplicates2" BeforeTargets="_ComputeResolvedFilesToPublishTypes" AfterTargets="ComputeFilesToPublish" />
</Project>
25 changes: 25 additions & 0 deletions src/app/MZikmund.App/Assets/PostPreviewTemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en" data-bs-theme="{ACTUALTHEME}">
<head>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<link rel="stylesheet" href="https://mzikmund.dev/css/site.min.css" />
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" crossorigin="anonymous"></script>
<script src="https://mzikmund.dev/js/site.js"></script>
</head>
<body>
<div b-mkd0nzmx6b class="container">
<main b-mkd0nzmx6b role="main" class="pb-4">
<article class="blog-post">

<div class="post-content">
{POSTCONTENT}
</div>
</article>
</main>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion src/app/MZikmund.App/Views/Admin/PostEditorView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public PostEditorView()
{
InitializeComponent();
// Read the template from the embedded resource
_postPreviewTemplate = typeof(PostEditorView).GetAssembly().GetManifestResourceStream("MZikmund.Assets.PostPreviewTemplate.html")?.ReadToEnd()!;
_postPreviewTemplate = typeof(PostEditorView).Assembly.GetManifestResourceStream("MZikmund.App.Assets.PostPreviewTemplate.html")!.ReadToEnd()!;
PreviewWebViewContainer.Content = _previewWebView = new WebView2();
this.Loaded += PostEditorView_Loaded;
this.Unloaded += PostEditorView_Unloaded;
Expand Down
2 changes: 1 addition & 1 deletion src/app/MZikmund.App/Views/PostView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public PostView()
{
InitializeComponent();
// Read the template from the embedded resource
_postPreviewTemplate = typeof(PostView).GetAssembly().GetManifestResourceStream("MZikmund.Assets.PostPreviewTemplate.html")?.ReadToEnd()!;
_postPreviewTemplate = typeof(PostView).Assembly.GetManifestResourceStream("MZikmund.App.Assets.PostPreviewTemplate.html")?.ReadToEnd()!;
PreviewWebViewContainer.Content = _previewWebView = new WebView2();
this.Loaded += PostEditorView_Loaded;
this.Unloaded += PostEditorView_Unloaded;
Expand Down

0 comments on commit 61cda74

Please sign in to comment.