Initial commit — AsadiTools v1.0
Full ASP.NET Core 10 Razor Pages app for آساد ابزار tool repair shop in Karaj, Iran (official DeWalt representative). Features: - Homepage, Services, DeWalt page, Shop (pagination + images) - 10 brand SEO pages (/brands/*) with rich Persian content + FAQ schema - Blog engine with admin management (/blog, /Admin/Blog) - Cart, Checkout, Contact (OpenStreetMap embed) - Admin panel: Products CRUD, Orders, Blog, Change Password - Jalali date formatting, product images, SiteData centralised contact - Docker + docker-compose with healthcheck - Gitea CI/CD via .gitea/workflows/ci-cd.yml (NuGet through Nexus mirror) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
namespace AsadiTools.Models;
|
||||
|
||||
public class BlogPost
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Content { get; set; } = string.Empty; // raw HTML
|
||||
public string? Excerpt { get; set; }
|
||||
public string? MetaDescription { get; set; }
|
||||
public string? FeaturedImage { get; set; }
|
||||
public string? Tags { get; set; } // comma-separated
|
||||
public bool IsPublished { get; set; } = false;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.Now;
|
||||
public DateTime? PublishedAt { get; set; }
|
||||
|
||||
// Helpers
|
||||
public string[] TagList =>
|
||||
Tags?.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) ?? [];
|
||||
|
||||
public string EffectiveSlug =>
|
||||
!string.IsNullOrWhiteSpace(Slug) ? Slug : $"post-{Id}";
|
||||
|
||||
public string DisplayDate =>
|
||||
(PublishedAt ?? CreatedAt) is var dt
|
||||
? AsadiTools.Services.SiteData.ToJalali(dt)
|
||||
: string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user