Files
taxbaik/src/TaxBaik.Web/Pages/Blog/Index.cshtml
T
kjh2064 91014a5ae3 Razor Pages 경로 최적화: 절대 경로 → 상대 경로
## 변경사항
- Login.cshtml.cs: /taxbaik/* 절대 경로 제거
  - RedirectUrl: '/taxbaik/admin/dashboard' → '/admin/dashboard'
  - NormalizeRedirectUrl: 경로 정규화 로직 간소화
- 모든 Razor Pages (.cshtml):
  - href='/taxbaik/*' → href='/*' 변경
  - src='/taxbaik/*' → src='/*' 변경
  - Response.Redirect('/taxbaik/*') → Response.Redirect('/*') 변경
- Feed.cshtml: RSS 피드의 절대 URL 유지 (SEO용)

## 원칙
 내부 링크: 상대 경로 사용
 외부 URL (RSS, CanonicalUrl): 절대 URL 유지
 Nginx: /taxbaik 프리픽스 자동 처리

## 결과
 빌드: 0 오류, 2 경고
 전체 경로 최적화 완료

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-08 15:29:53 +09:00

60 lines
2.2 KiB
Plaintext

@page
@model TaxBaik.Web.Pages.Blog.BlogIndexModel
@{
ViewData["Title"] = "블로그 | 백원숙 세무회계";
}
<div class="container py-5">
<h1 class="fw-bold mb-5">세무 블로그</h1>
<!-- Category Tabs -->
<div class="mb-4 d-flex flex-wrap gap-2">
<a href="/blog" class="btn btn-sm @(Model.SelectedCategoryId == null ? "btn-primary" : "btn-outline-primary")">전체</a>
@foreach (var cat in Model.Categories)
{
<a href="/blog?categoryId=@cat.Id" class="btn btn-sm @(Model.SelectedCategoryId == cat.Id ? "btn-primary" : "btn-outline-primary")">@cat.Name</a>
}
</div>
<!-- Posts Grid -->
<div class="row g-4">
@foreach (var post in Model.Posts)
{
<div class="col-12 col-md-6 col-lg-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body">
<small class="badge bg-primary">@post.CategoryName</small>
<h5 class="card-title mt-2">@post.Title</h5>
<p class="card-text small">@post.CreatedAt.ToString("yyyy-MM-dd")</p>
<a href="/blog/@post.Slug" class="btn btn-sm btn-primary">글 내용 보기</a>
</div>
</div>
</div>
}
</div>
<!-- Pagination -->
<nav aria-label="Page navigation" class="mt-5">
<ul class="pagination justify-content-center">
@if (Model.CurrentPage > 1)
{
<li class="page-item">
<a class="page-link" href="/blog?page=@(Model.CurrentPage - 1)">이전</a>
</li>
}
@for (int i = 1; i <= Model.TotalPages; i++)
{
<li class="page-item @(i == Model.CurrentPage ? "active" : "")">
<a class="page-link" href="/blog?page=@i">@i</a>
</li>
}
@if (Model.CurrentPage < Model.TotalPages)
{
<li class="page-item">
<a class="page-link" href="/blog?page=@(Model.CurrentPage + 1)">다음</a>
</li>
}
</ul>
</nav>
</div>