2
0

feat(blog): add subscription-only blog post detection and UI updates
All checks were successful
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Successful in 3m20s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 4m54s
Build and Release / Lint (push) Successful in 5m7s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 3m1s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 8h4m41s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Successful in 8m37s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 8m40s
Build and Release / Build Binary (linux/arm64) (push) Successful in 8m53s

Add HasSubscriptionOnlyBlogPosts function to check if a repository has premium blog content. Update subscribe page to display different messaging when paid blogs are available. Redesign featured blog section with centered layout, larger images, and improved hover effects.
This commit is contained in:
2026-02-03 10:26:28 -05:00
parent f40550d79b
commit 33898561db
5 changed files with 68 additions and 37 deletions

View File

@@ -410,6 +410,12 @@ func CountPublishedBlogsByRepoID(ctx context.Context, repoID int64) (int64, erro
return db.GetEngine(ctx).Where("repo_id = ? AND status >= ?", repoID, BlogPostPublic).Count(new(BlogPost))
}
// HasSubscriptionOnlyBlogPosts returns true if the repo has any published subscription-only blog posts.
func HasSubscriptionOnlyBlogPosts(ctx context.Context, repoID int64) (bool, error) {
count, err := db.GetEngine(ctx).Where("repo_id = ? AND status >= ? AND subscription_only = ?", repoID, BlogPostPublic, true).Count(new(BlogPost))
return count > 0, err
}
// CreateBlogPost inserts a new blog post.
func CreateBlogPost(ctx context.Context, p *BlogPost) error {
_, err := db.GetEngine(ctx).Insert(p)