--- import BaseLayout from '../layouts/BaseLayout.astro'; import { getCollection } from 'astro:content'; import { getToolsData } from '../utils/dataService.js'; import ContributionButton from '../components/ContributionButton.astro'; import { isGatedContentAuthRequired } from '../utils/auth.js'; const data = await getToolsData(); const allKnowledgebaseEntries = await getCollection('knowledgebase', (entry) => { return entry.data.published !== false; }); // Check if gated content authentication is enabled globally const gatedContentAuthEnabled = isGatedContentAuthRequired(); const knowledgebaseEntries = allKnowledgebaseEntries.map((entry) => { const associatedTool = entry.data.tool_name ? data.tools.find((tool: any) => tool.name === entry.data.tool_name) : null; return { slug: entry.slug, title: entry.data.title, description: entry.data.description, author: entry.data.author, last_updated: entry.data.last_updated, difficulty: entry.data.difficulty, categories: entry.data.categories || [], tags: entry.data.tags || [], gated_content: entry.data.gated_content || false, // NEW: Include gated content flag tool_name: entry.data.tool_name, related_tools: entry.data.related_tools || [], associatedTool, name: entry.data.title, type: associatedTool?.type || 'article', icon: associatedTool?.icon || '📖', platforms: associatedTool?.platforms || [], skillLevel: entry.data.difficulty || associatedTool?.skillLevel || 'intermediate', phases: associatedTool?.phases || [], license: associatedTool?.license }; }); knowledgebaseEntries.sort((a: any, b: any) => a.title.localeCompare(b.title)); // Count gated vs public articles for statistics const gatedCount = knowledgebaseEntries.filter(entry => entry.gated_content).length; const publicCount = knowledgebaseEntries.length - gatedCount; ---

Knowledgebase

Erweiterte Dokumentation und Erkenntnisse

Praktische Erfahrungen, Konfigurationshinweise und Lektionen aus der Praxis

{gatedContentAuthEnabled && gatedCount > 0 && ( )}

{knowledgebaseEntries.length} von {knowledgebaseEntries.length} Einträgen

{knowledgebaseEntries.length === 0 ? (

Noch keine Knowledgebase-Einträge

Knowledgebase-Einträge werden automatisch angezeigt, sobald Artikel veröffentlicht werden.

) : (
{knowledgebaseEntries.map((entry: any, index: number) => { const hasAssociatedTool = !!entry.associatedTool; const hasValidProjectUrl = hasAssociatedTool && entry.associatedTool.projectUrl !== undefined && entry.associatedTool.projectUrl !== null && entry.associatedTool.projectUrl !== "" && entry.associatedTool.projectUrl.trim() !== ""; const isMethod = hasAssociatedTool && entry.associatedTool.type === 'method'; const isConcept = hasAssociatedTool && entry.associatedTool.type === 'concept'; const isStandalone = !hasAssociatedTool; const isGated = entry.gated_content === true; const articleUrl = `/knowledgebase/${entry.slug}`; return (
{entry.icon}

{entry.title} {isGated && gatedContentAuthEnabled && ( 🔒 )}

{isStandalone && Artikel} {isConcept && Konzept} {isMethod && Methode} {hasAssociatedTool && !isMethod && !isConcept && Software} {hasValidProjectUrl && CC24-Server} {hasAssociatedTool && entry.associatedTool.license !== 'Proprietary' && !isMethod && !isConcept && Open Source} 📖 {isGated && gatedContentAuthEnabled && 🔒}

{entry.description} {isGated && gatedContentAuthEnabled && ( Authentifizierung erforderlich )}

{entry.difficulty && ( {entry.difficulty} )} {hasAssociatedTool && entry.platforms && entry.platforms.length > 0 && !isMethod && !isConcept && ( {entry.platforms.slice(0, 2).join(', ')}{entry.platforms.length > 2 ? '...' : ''} )} {entry.categories && entry.categories.length > 0 && ( {entry.categories.slice(0, 2).join(', ')}{entry.categories.length > 2 ? '...' : ''} )}
{entry.author} {entry.last_updated.toLocaleDateString('de-DE')}
{entry.tags && entry.tags.length > 0 && (
{entry.tags.slice(0, 8).map((tag: string) => ( {tag} ))}
)}
); })}
)}