mirror of
https://github.com/github/awesome-copilot.git
synced 2026-03-13 04:35:12 +00:00
feat: migrate learning-hub articles into Astro website
- Add Astro Content Collection for learning-hub articles - Move 5 fundamentals articles into website/src/content/learning-hub/ - Create ArticleLayout.astro for rendering markdown articles - Create index page listing all articles in recommended reading order - Create dynamic [slug].astro route for individual articles - Add Learning Hub to main navigation and homepage cards - Add article prose and index page CSS styles - Update internal links to use website URLs
This commit is contained in:
47
website/src/layouts/ArticleLayout.astro
Normal file
47
website/src/layouts/ArticleLayout.astro
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
import BaseLayout from './BaseLayout.astro';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
description?: string;
|
||||
estimatedReadingTime?: string;
|
||||
lastUpdated?: string;
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
const { title, description, estimatedReadingTime, lastUpdated, tags } = Astro.props;
|
||||
const base = import.meta.env.BASE_URL;
|
||||
---
|
||||
|
||||
<BaseLayout title={title} description={description} activeNav="learning-hub">
|
||||
<main id="main-content">
|
||||
<div class="page-header">
|
||||
<div class="container">
|
||||
<nav class="breadcrumb" aria-label="Breadcrumb">
|
||||
<a href={`${base}learning-hub/`}>← Learning Hub</a>
|
||||
</nav>
|
||||
<h1>{title}</h1>
|
||||
{description && <p>{description}</p>}
|
||||
<div class="article-meta">
|
||||
{estimatedReadingTime && <span class="meta-item">📖 {estimatedReadingTime}</span>}
|
||||
{lastUpdated && <span class="meta-item">Updated: {lastUpdated}</span>}
|
||||
</div>
|
||||
{tags && tags.length > 0 && (
|
||||
<div class="article-tags">
|
||||
{tags.map((tag) => (
|
||||
<span class="tag">{tag}</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="container">
|
||||
<article class="article-content">
|
||||
<slot />
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</BaseLayout>
|
||||
Reference in New Issue
Block a user