-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
THC 856 create main article theme template (#267)
- Loading branch information
1 parent
df979c0
commit d46a83b
Showing
15 changed files
with
219 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
import classNames from "classnames"; | ||
import type { NavigationData } from "src/utils/helpers/navigation/types"; | ||
import "./breadcrumbs.css"; | ||
interface BreadcrumbsProps { | ||
breadcrumbs: NavigationData["breadcrumbs"]; | ||
} | ||
const { breadcrumbs } = Astro.props as BreadcrumbsProps; | ||
const currentPage = Astro.url.pathname; | ||
const currentPageMatch = currentPage.endsWith("/") | ||
? currentPage.slice(1, -1) | ||
: currentPage.slice(1); | ||
--- | ||
|
||
<div aria-label="breadcrumbs" class="mb-8"> | ||
<nav> | ||
<ul class="flex flex-row gap-x-6"> | ||
{ | ||
breadcrumbs.map((breadcrumb, i) => ( | ||
<li | ||
class={classNames(" relative", { | ||
"breadcrumbs-item": | ||
breadcrumbs.length > 1 && i !== breadcrumbs.length - 1, | ||
})} | ||
> | ||
<a | ||
class={classNames("cursor-pointer text-sm", { | ||
"text-black font-semibold": currentPageMatch === breadcrumb.url, | ||
"text-secondary font-medium": | ||
currentPageMatch !== breadcrumb.url, | ||
})} | ||
href={`/${breadcrumb.url}`} | ||
> | ||
{breadcrumb.title} | ||
</a> | ||
</li> | ||
)) | ||
} | ||
</ul> | ||
</nav> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.breadcrumbs-item::after { | ||
content: "•"; | ||
font-weight: 500; | ||
position: absolute; | ||
top: -5px; | ||
right: -16px; | ||
font-size: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
--- | ||
import type { MarkdownHeading } from "astro"; | ||
import MoreMenu from "../RightSidebar/MoreMenu.astro"; | ||
import TableOfContents from "../RightSidebar/TableOfContents"; | ||
type Props = { | ||
title: string; | ||
headings: MarkdownHeading[]; | ||
githubEditUrl: string; | ||
}; | ||
const { title, headings, githubEditUrl } = Astro.props; | ||
const { title, headings } = Astro.props; | ||
--- | ||
|
||
<article id="article" class="w-full"> | ||
<article id="article" class="article-main w-full"> | ||
<section class="main-section"> | ||
<h1 class="content-title" id="overview">{title}</h1> | ||
<nav class="block sm:hidden"> | ||
<TableOfContents client:media="(max-width: 50em)" headings={headings} /> | ||
</nav> | ||
<slot /> | ||
</section> | ||
<nav class="block sm:hidden"> | ||
<MoreMenu editHref={githubEditUrl} /> | ||
</nav> | ||
</article> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
--- | ||
import type { MarkdownHeading } from "astro"; | ||
import TableOfContents from "./TableOfContents"; | ||
import MoreMenu from "./MoreMenu.astro"; | ||
type Props = { | ||
headings: MarkdownHeading[]; | ||
githubEditUrl: string; | ||
}; | ||
const { headings, githubEditUrl } = Astro.props; | ||
const { headings } = Astro.props; | ||
--- | ||
|
||
<nav class="w-full sticky top-10" aria-labelledby="grid-right"> | ||
<div class="h-full p-0 overflow-auto xs:hidden lg:block"> | ||
<TableOfContents client:visible headings={headings} /> | ||
<MoreMenu editHref={githubEditUrl} /> | ||
</div> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.