Skip to content

Commit

Permalink
tie tag+cat to blog
Browse files Browse the repository at this point in the history
  • Loading branch information
Reed Nelson committed Aug 11, 2023
1 parent 13187d8 commit d3b7b7a
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 18 deletions.
8 changes: 0 additions & 8 deletions src/config/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,9 @@
"name": "Authors",
"url": "/authors"
},
{
"name": "Categories",
"url": "/categories"
},
{
"name": "Search",
"url": "/search"
},
{
"name": "404 Page",
"url": "/404"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const { title, description, author, categories, image, date, tags } = post.data;
<FaRegFolder className={"mr-2 -mt-1 inline-block"} />
{
categories.map((category: string, index: number) => (
<a href={`/categories/${slugify(category)}`}>
<a href={`/blog/categories/${slugify(category)}`}>
{humanize(category)}
{index !== categories.length - 1 && ","}
</a>
Expand All @@ -75,7 +75,7 @@ const { title, description, author, categories, image, date, tags } = post.data;
<li class="inline-block">
<a
class="m-1 block rounded bg-theme-light px-3 py-1 hover:bg-primary hover:text-white dark:bg-darkmode-theme-light dark:hover:bg-darkmode-primary dark:hover:text-dark"
href={`/tags/${slugify(tag)}`}
href={`/blog/tags/${slugify(tag)}`}
>
{humanize(tag)}
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const Search = ({ searchList }: Props) => {
{item.data.categories.map(
(category: string, index: number) => (
<a
href={`/categories/${slugify(category)}`}
href={`/blog/categories/${slugify(category)}`}
key={category}
>
{humanize(category)}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/components/BlogCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const { title, image, date, author, categories } = data.data;
<FaRegFolder className={"mr-2 -mt-1 inline-block"} />
{
categories.map((category: string, index: number) => (
<a href={`/categories/${slugify(category)}`}>
<a href={`/blog/categories/${slugify(category)}`}>
{humanize(category)}
{index !== categories.length - 1 && ","}
</a>
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/partials/PostSidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const { tags, categories, allCategories } = Astro.props;
<li>
<a
class="flex justify-between hover:text-primary dark:hover:text-darkmode-primary"
href={`/categories/${category}`}
href={`/blog/categories/${category}`}
>
{humanize(category)} <span>({count})</span>
</a>
Expand All @@ -41,7 +41,7 @@ const { tags, categories, allCategories } = Astro.props;
<li class="inline-block">
<a
class="m-1 block rounded bg-white px-3 py-1 hover:bg-primary hover:text-white dark:bg-darkmode-body dark:hover:bg-darkmode-primary dark:hover:text-dark"
href={`/tags/${tag}`}
href={`/blog/tags/${tag}`}
>
{humanize(tag)}
</a>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/blog/[single].astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import PostSingle from "@/layouts/PostSingle.astro";
import BlogPostSingle from "@/layouts/BlogPostSingle.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
export async function getStaticPaths() {
Expand All @@ -26,5 +26,5 @@ const { title, meta_title, description, image } = post.data;
description={description}
image={image}
>
<PostSingle post={post} />
<BlogPostSingle post={post} />
</Base>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const allCategories = await getAllTaxonomy(blog_folder, "categories");
return (
<li class="m-3 inline-block">
<a
href={`/categories/${category}`}
href={`/blog/categories/${category}`}
class="block rounded bg-theme-light px-4 py-2 text-xl text-dark dark:bg-darkmode-theme-light dark:text-darkmode-dark"
>
{humanize(category)}{" "}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const allTags = await getAllTaxonomy(blog_folder, "tags");
return (
<li class="m-3 inline-block">
<a
href={`/tags/${tag}`}
href={`/blog/tags/${tag}`}
class="block rounded bg-theme-light px-4 py-2 text-xl text-dark dark:bg-darkmode-theme-light dark:text-darkmode-dark"
>
{humanize(tag)}{" "}
Expand Down

0 comments on commit d3b7b7a

Please sign in to comment.