nca-ai-cms-astro-plugin 1.0.9 → 1.0.11

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": "nca-ai-cms-astro-plugin",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -14,7 +14,9 @@ const SETTINGS_TABS: SettingsSubTab[] = ['homepage', 'website'];
14
14
 
15
15
  const SETTINGS_FIELDS: Record<string, { key: string; label: string; type: 'input' | 'textarea' }[]> = {
16
16
  homepage: [
17
+ { key: 'hero_kicker', label: 'Hero Kicker', type: 'input' },
17
18
  { key: 'hero_headline', label: 'Hero Ueberschrift', type: 'input' },
19
+ { key: 'hero_title_accent', label: 'Hero Akzent-Text', type: 'input' },
18
20
  { key: 'hero_text', label: 'Hero Text', type: 'textarea' },
19
21
  { key: 'target_audience', label: 'Zielgruppe', type: 'input' },
20
22
  { key: 'tone', label: 'Tonalitaet', type: 'input' },
@@ -20,13 +20,13 @@ const getSetting = async (key: string, fallback: string) => {
20
20
 
21
21
  const heroKicker = await getSetting(
22
22
  'hero_kicker',
23
- 'Web Accessibility Expertise'
23
+ ''
24
24
  );
25
- const heroTitle = await getSetting('hero_title', 'NCA Content');
26
- const heroTitleAccent = await getSetting('hero_title_accent', 'Marketing');
25
+ const heroTitle = await getSetting('hero_headline', '');
26
+ const heroTitleAccent = await getSetting('hero_title_accent', '');
27
27
  const heroDescription = await getSetting(
28
- 'hero_description',
29
- 'Fachartikel für barrierefreie Webentwicklung und digitale Inklusion'
28
+ 'hero_text',
29
+ ''
30
30
  );
31
31
 
32
32
  // Check if user is authenticated
@@ -8,6 +8,11 @@ describe('isPublicPath', () => {
8
8
  expect(isPublicPath('/login')).toBe(true);
9
9
  });
10
10
 
11
+ it('allows article-image paths', () => {
12
+ expect(isPublicPath('/api/article-image/123/hero.webp')).toBe(true);
13
+ expect(isPublicPath('/api/article-image/some-slug/hero.webp')).toBe(true);
14
+ });
15
+
11
16
  it('rejects other paths', () => {
12
17
  expect(isPublicPath('/api/generate-content')).toBe(false);
13
18
  expect(isPublicPath('/editor')).toBe(false);
@@ -1,9 +1,10 @@
1
1
  import { getEnvVariable } from './envUtils.js';
2
2
 
3
3
  const PUBLIC_PATHS = ['/api/auth/login', '/api/auth/logout', '/login'];
4
+ const PUBLIC_PATH_PREFIXES = ['/api/article-image/'];
4
5
 
5
6
  export function isPublicPath(pathname: string): boolean {
6
- return PUBLIC_PATHS.includes(pathname);
7
+ return PUBLIC_PATHS.includes(pathname) || PUBLIC_PATH_PREFIXES.some(prefix => pathname.startsWith(prefix));
7
8
  }
8
9
 
9
10
  export function isProtectedPath(pathname: string): boolean {
package/update.md CHANGED
@@ -1,3 +1,12 @@
1
+ # v1.0.11
2
+
3
+ ## Make article-image API route public
4
+ - Added `/api/article-image/` to public path prefixes in auth middleware
5
+ - Article hero images are now accessible without authentication
6
+ - Fixes image loading on public-facing frontend pages
7
+
8
+ ---
9
+
1
10
  # v1.0.8
2
11
 
3
12
  ## Generalize content generator for any topic