Files
kjh2064 6ffff70ece
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m47s
feat: add Markdig markdown rendering for blog posts
- Add Markdig NuGet package (0.38.0)
- Convert blog content from markdown to HTML in Post.cshtml.cs
- Display rendered HTML content instead of raw text
- Add comprehensive markdown styling (h1-h6, lists, tables, code, etc.)
- Use TaxBaik color scheme for markdown elements

Blog posts now render properly:
 Headings (#, ##, ###)
 Bold/italic text (**text**, *text*)
 Lists (-, *, ordered)
 Tables
 Code blocks
 Blockquotes
 Links

Styling follows TaxBaik brand:
- Primary color for headings
- Warm typography (Noto Sans KR)
- Consistent spacing and borders
- Mobile-responsive design
2026-07-01 16:34:09 +09:00

30 lines
723 B
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
using TaxBaik.Application.Services;
using TaxBaik.Domain.Entities;
using Markdig;
namespace TaxBaik.Web.Pages.Blog;
public class BlogPostModel : PageModel
{
private readonly BlogService _blogService;
public BlogPost? Post { get; set; }
public string? HtmlContent { get; set; }
public BlogPostModel(BlogService blogService)
{
_blogService = blogService;
}
public async Task OnGetAsync(string slug)
{
Post = await _blogService.GetBySlugAsync(slug);
if (Post != null)
{
HtmlContent = Markdown.ToHtml(Post.Content ?? "");
_ = _blogService.IncrementViewCountAsync(Post.Id);
}
}
}