@fullstackdatasolutions/articles 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstackdatasolutions/articles",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "funding": {
@@ -32,11 +32,11 @@ export function ArticleCard({ article, config }: ArticleCardProps) {
32
32
  {article.category}
33
33
  </span>
34
34
  </div>
35
- <h3 className="text-lg font-semibold leading-none tracking-tight mb-2">
36
- <Link
37
- href={`/articles/${article.slug}`}
38
- className="hover:text-indigo-600 transition-colors"
39
- >
35
+ <h3
36
+ className="text-lg font-semibold leading-none tracking-tight mb-2"
37
+ style={{ fontFamily: config?.theme?.headerFontFamily }}
38
+ >
39
+ <Link href={`/articles/${article.slug}`} className="hover:text-primary transition-colors">
40
40
  {article.title}
41
41
  </Link>
42
42
  </h3>
@@ -3,6 +3,7 @@ import Image from 'next/image'
3
3
  import Link from 'next/link'
4
4
  import { Calendar, Clock, User } from 'lucide-react'
5
5
  import type { Article, AuthorProfile } from './articleTypes'
6
+ import type { ArticlesConfig } from './articlesConfig'
6
7
 
7
8
  type ArticleDetailHeroProps = Readonly<{
8
9
  article: Article
@@ -10,6 +11,8 @@ type ArticleDetailHeroProps = Readonly<{
10
11
  showDate?: boolean
11
12
  showAuthor?: boolean
12
13
  authors?: AuthorProfile[]
14
+ /** Optional - when `config.theme.headerFontFamily` is set, applies it to the title. */
15
+ config?: ArticlesConfig
13
16
  }>
14
17
 
15
18
  function toSlug(cat: string): string {
@@ -25,6 +28,7 @@ export function ArticleDetailHero({
25
28
  showDate = false,
26
29
  showAuthor = true,
27
30
  authors = [],
31
+ config,
28
32
  }: ArticleDetailHeroProps) {
29
33
  const showConfiguredAuthors = showAuthor && authors.length > 0
30
34
  const showLegacyAuthor = showAuthor && authors.length === 0 && article.author.trim().length > 0
@@ -98,7 +102,12 @@ export function ArticleDetailHero({
98
102
  )}
99
103
  </div>
100
104
  )}
101
- <h1 className="text-4xl md:text-5xl font-bold mb-4">{article.title}</h1>
105
+ <h1
106
+ className="text-4xl md:text-5xl font-bold mb-4"
107
+ style={{ fontFamily: config?.theme?.headerFontFamily }}
108
+ >
109
+ {article.title}
110
+ </h1>
102
111
  <div
103
112
  style={{
104
113
  display: 'flex',
@@ -36,6 +36,7 @@ function buildThemeVars(theme?: ArticlesTheme): React.CSSProperties {
36
36
  if (!theme) return {}
37
37
  const vars: Record<string, string> = {}
38
38
  if (theme.fontFamily) vars['--articles-font-family'] = theme.fontFamily
39
+ if (theme.headerFontFamily) vars['--articles-header-font-family'] = theme.headerFontFamily
39
40
  if (theme.headerColor) vars['--articles-header-color'] = theme.headerColor
40
41
  if (theme.textColor) vars['--articles-text-color'] = theme.textColor
41
42
  if (theme.backgroundColor) vars['--articles-bg-color'] = theme.backgroundColor
@@ -29,7 +29,10 @@ export function RelatedArticlesSection({
29
29
 
30
30
  return (
31
31
  <section className="mt-12 pt-8 border-t border-border" aria-label="Related articles">
32
- <h2 className="text-xl font-semibold text-foreground mb-6">
32
+ <h2
33
+ className="text-xl font-semibold text-foreground mb-6"
34
+ style={{ fontFamily: config?.theme?.headerFontFamily }}
35
+ >
33
36
  {heading ?? `More in ${category}`}
34
37
  </h2>
35
38
  <div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
@@ -18,6 +18,14 @@ export type ArticlesSection =
18
18
  export interface ArticlesTheme {
19
19
  /** Font family for the articles section. Example: `"'Inter', sans-serif"` */
20
20
  fontFamily?: string
21
+ /**
22
+ * Font family for headings only (article title, card titles, section
23
+ * headings) - falls back to `fontFamily` when omitted. Lets a site use a
24
+ * distinct display face for headings (e.g. a serif) while keeping a
25
+ * separate body font, without hardcoding either into the package.
26
+ * Example: `"'Cinzel', serif"`
27
+ */
28
+ headerFontFamily?: string
21
29
  /** Color for article card titles and section headings. Example: `'#111827'` */
22
30
  headerColor?: string
23
31
  /** Color for body and excerpt text. Example: `'#6b7280'` */