6a37cfead4
공개 사이트 (port 5001):
- Program.cs: AddRazorPages, AddInfrastructure, AddApplication, UsePathBase("/taxbaik")
- appsettings.json: PostgreSQL 연결 문자열
레이아웃 및 공통 컴포넌트:
- _Layout.cshtml: Bootstrap 5, Noto Sans KR, OG 메타 태그, 모바일 고정 CTA 바
- _Header.cshtml: sticky navbar, 로고, 네비게이션 링크, 상담신청 버튼
- _Footer.cshtml: 사업자정보, 연락처, KakaoTalk, 저작권
- _ViewImports.cshtml, _ViewStart.cshtml
- site.css: CSS 변수 (--color-primary, --color-cta 등), 반응형 스타일
- site.js: 모바일 CTA 바 제어, sticky 헤더 효과
페이지 구현:
1. Index.cshtml (메인 랜딩): Hero, 신뢰도 strip, 서비스 카드, 최근 블로그
2. Services.cshtml (서비스): 4개 서비스 소개, 상담료 안내
3. About.cshtml (소개): 세무사 프로필, 3개 자격증, 서비스 철학
4. Contact.cshtml (상담신청): 폼 (이름, 전화, 이메일, 분야, 문의), ValidationException 처리
5. Blog/Index.cshtml (블로그 목록): 카테고리 필터 탭, 12개 그리드, 페이지네이션
6. Blog/Post.cshtml (포스트 상세): 브레드크럼, 제목, 메타정보, 콘텐츠, CTA, 공유 버튼
SEO:
- robots.txt: /taxbaik 허용, /admin 차단, sitemap 링크
- Sitemap.cshtml: 동적 생성 (정적 페이지 + 모든 포스트)
기술:
- Dapper 기반 DB 접근
- 페이징: 12개/페이지
- 한국어 입력값 검증
Co-Authored-By: Claude <noreply@anthropic.com>
27 lines
600 B
C#
27 lines
600 B
C#
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
using TaxBaik.Application.Services;
|
|
using TaxBaik.Domain.Entities;
|
|
|
|
namespace TaxBaik.Web.Pages.Blog;
|
|
|
|
public class BlogPostModel : PageModel
|
|
{
|
|
private readonly BlogService _blogService;
|
|
|
|
public BlogPost? Post { get; set; }
|
|
|
|
public BlogPostModel(BlogService blogService)
|
|
{
|
|
_blogService = blogService;
|
|
}
|
|
|
|
public async Task OnGetAsync(string slug)
|
|
{
|
|
Post = await _blogService.GetBySlugAsync(slug);
|
|
if (Post != null)
|
|
{
|
|
_ = _blogService.IncrementViewCountAsync(Post.Id);
|
|
}
|
|
}
|
|
}
|