Skip to content

Commit 6b14bba

Browse files
committed
Adding custom titles and resources to docs page
1 parent 51d40be commit 6b14bba

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

src/layouts/Docs.astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ import { BsArrowRightCircle } from "react-icons/bs";
66
77
const { docs, headings } = Astro.props;
88
---
9-
109
<div class="row">
10+
<h2 class="text-3xl p-5">Voluntering Guide</h2>
1111
<div class="flex flex-col">
1212
{
1313
docs.map((doc) => (
14-
<div class="p-1">
14+
<div class="p-1 pl-5">
1515
<a href={`/docs/${doc.id}`}
1616
class="flex flex-col pl-5 shadow-sm hover:bg-red-100">
1717
<div class="flex flex-col justify-between p-2 leading-normal">
18-
<h5 class="mb-2 text-2xl font-bold text-black">{doc.data.title}</h5>
19-
<p class="mb-2 font-normal text-gray-800">
20-
{doc.data.description}
21-
</p>
18+
<h3 class="mb-1 text-xl font-bold text-black">{doc.data.title}</h5>
19+
<p class="mb-2 font-normal text-gray-800">
20+
{doc.data.description}
21+
</p>
2222
</div>
2323
</a>
2424
</div>

src/pages/docs/index.astro

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ const docs = await getSinglePage("docs");
1111
const sortedPosts = sortByWeight(docs);
1212
const totalPages = Math.ceil(docs.length / config.settings.pagination_docs);
1313
const currentPosts = sortedPosts.slice(0, config.settings.pagination_docs);
14+
15+
const resources = [
16+
{
17+
"title": "Astro",
18+
"url": "https://astro.build",
19+
"description": "The framework for this website, in case you want to contribute to it."
20+
}
21+
]
1422
---
1523

1624
<Base title={"PyLadiesCon Documentation"}>
@@ -23,8 +31,35 @@ const currentPosts = sortedPosts.slice(0, config.settings.pagination_docs);
2331
<p class="p-5 text-black">
2432
This is the index of all the documentation pages we have gathered related to the organization and processes of PyLadiesCon.
2533
</p>
34+
<!--
35+
This first part is for the documents that are found in src/content/docs
36+
and will be listed automatically.
37+
-->
2638
<Docs docs={currentPosts} />
2739
<Pagination section={"docs"} currentPage={1} totalPages={totalPages} />
40+
41+
<!--
42+
This second part is for the content that the `resources` variable on the top of this
43+
document has inside. These are not actual mdx files, but simplified URL-based content
44+
-->
45+
<h2 class="text-3xl p-5">Voluntering Resources</h2>
46+
<div class="flex flex-col">
47+
{
48+
resources.map((resource) => (
49+
<div class="p-1 pl-5">
50+
<a href={resource.url}
51+
class="flex flex-col pl-5 shadow-sm hover:bg-red-100">
52+
<div class="flex flex-col justify-between p-2 leading-normal">
53+
<h3 class="mb-1 text-xl font-bold text-black">{resource.title}</h5>
54+
<p class="mb-2 font-normal text-gray-800">
55+
{resource.description}
56+
</p>
57+
</div>
58+
</a>
59+
</div>
60+
))
61+
}
62+
</div>
2863
</div>
2964
</section>
3065
</Base>

0 commit comments

Comments
 (0)