-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
INFINITECAMPUS\reed.nelson
committed
Aug 7, 2023
1 parent
ee85887
commit 4097e03
Showing
18 changed files
with
5,431 additions
and
1,481 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,5 @@ | ||
--- | ||
title: "Drinks" | ||
meta_title: "" | ||
description: "this is meta description" | ||
--- |
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,13 @@ | ||
--- | ||
title: "Drink 1" | ||
meta_title: "" | ||
description: "none" | ||
date: 2022-08-30T05:00:00Z | ||
image: "" | ||
categories: ["Drink"] | ||
author: "Reed Nelson" | ||
tags: ["drink"] | ||
draft: false | ||
--- | ||
|
||
This is a recipe. |
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,13 @@ | ||
--- | ||
title: "Drink 2" | ||
meta_title: "" | ||
description: "none" | ||
date: 2022-09-30T05:00:00Z | ||
image: "" | ||
categories: ["Drink2"] | ||
author: "Reed Nelson" | ||
tags: ["drink2"] | ||
draft: false | ||
--- | ||
|
||
This is a recipe. |
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,13 @@ | ||
--- | ||
title: "Drink 3" | ||
meta_title: "" | ||
description: "none" | ||
date: 2022-10-30T05:00:00Z | ||
image: "" | ||
categories: ["Drink"] | ||
author: "Reed Nelson" | ||
tags: ["drink"] | ||
draft: false | ||
--- | ||
|
||
This is a recipe. |
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,59 @@ | ||
--- | ||
import config from "@/config/config.json"; | ||
import { humanize, plainify, slugify } from "@/lib/utils/textConverter"; | ||
import { Image } from "@astrojs/image/components"; | ||
import { FaRegFolder, FaRegUserCircle } from "react-icons/fa/index.js"; | ||
const { | ||
summary_length, | ||
drink_folder, | ||
}: { summary_length: number; drink_folder: string } = config.settings; | ||
const { data } = Astro.props; | ||
const { title, image, date, author, categories } = data.data; | ||
--- | ||
|
||
<div class="bg-body dark:bg-darkmode-body"> | ||
{ | ||
image && ( | ||
<Image | ||
class="mb-6 w-full rounded" | ||
src={image} | ||
alt={title} | ||
width={445} | ||
height={230} | ||
format="webp" | ||
/> | ||
) | ||
} | ||
<h4 class="mb-3"> | ||
<a href={`/${drink_folder}/${data.slug}`}> | ||
{title} | ||
</a> | ||
</h4> | ||
<ul class="mb-4"> | ||
<li class="mr-4 inline-block"> | ||
<a href={`/authors/${slugify(author)}`}> | ||
<FaRegUserCircle className={"mr-2 -mt-1 inline-block"} /> | ||
{humanize(author)} | ||
</a> | ||
</li> | ||
<li class="mr-4 inline-block"> | ||
<FaRegFolder className={"mr-2 -mt-1 inline-block"} /> | ||
{ | ||
categories.map((category: string, index: number) => ( | ||
<a href={`/categories/${slugify(category)}`}> | ||
{humanize(category)} | ||
{index !== categories.length - 1 && ","} | ||
</a> | ||
)) | ||
} | ||
</li> | ||
</ul> | ||
<p class="mb-6">{plainify(data.body?.slice(0, Number(summary_length)))}</p> | ||
<a | ||
class="btn btn-outline-primary btn-sm" | ||
href={`/${drink_folder}/${data.slug}`} | ||
> | ||
read more | ||
</a> | ||
</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,43 @@ | ||
--- | ||
import DrinkCard from "@/components/DrinkCard.astro"; | ||
import config from "@/config/config.json"; | ||
import Base from "@/layouts/Base.astro"; | ||
import { getSinglePage } from "@/lib/contentParser.astro"; | ||
import { getTaxonomy } from "@/lib/taxonomyParser.astro"; | ||
import taxonomyFilter from "@/lib/utils/taxonomyFilter"; | ||
import PageHeader from "@/partials/PageHeader.astro"; | ||
export async function getStaticPaths() { | ||
const categories = await getTaxonomy( | ||
config.settings.drink_folder, | ||
"categories" | ||
); | ||
return categories.map((category) => { | ||
return { | ||
params: { category }, | ||
}; | ||
}); | ||
} | ||
const { category } = Astro.params; | ||
const posts = await getSinglePage(config.settings.drink_folder); | ||
const filterByCategories = taxonomyFilter(posts, "categories", category!); | ||
--- | ||
|
||
<Base title={category}> | ||
<PageHeader title={category} /> | ||
<div class="section-sm pb-0"> | ||
<div class="container"> | ||
<div class="row"> | ||
{ | ||
filterByCategories.map((post) => ( | ||
<div class="mb-14 md:col-6 lg:col-4"> | ||
<DrinkCard data={post} /> | ||
</div> | ||
)) | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
</Base> |
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,39 @@ | ||
--- | ||
import config from "@/config/config.json"; | ||
import Base from "@/layouts/Base.astro"; | ||
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro"; | ||
import { humanize } from "@/lib/utils/textConverter"; | ||
import PageHeader from "@/partials/PageHeader.astro"; | ||
const { drink_folder }: { drink_folder: string } = config.settings; | ||
const categories = await getTaxonomy(drink_folder, "categories"); | ||
const allCategories = await getAllTaxonomy(drink_folder, "categories"); | ||
--- | ||
|
||
<Base title={"Categories"}> | ||
<PageHeader title={"Categories"} /> | ||
<section class="section"> | ||
<div class="container text-center"> | ||
<ul> | ||
{ | ||
categories.map((category: string) => { | ||
const count = allCategories.filter((c) => c === category).length; | ||
return ( | ||
<li class="m-3 inline-block"> | ||
<a | ||
href={`/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)}{" "} | ||
<span class="ml-2 rounded bg-body px-2 dark:bg-darkmode-body"> | ||
{count} | ||
</span> | ||
</a> | ||
</li> | ||
); | ||
}) | ||
} | ||
</ul> | ||
</div> | ||
</section> | ||
</Base> |
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,40 @@ | ||
--- | ||
import DrinkCard from "@/components/DrinkCard.astro"; | ||
import config from "@/config/config.json"; | ||
import Base from "@/layouts/Base.astro"; | ||
import { getSinglePage } from "@/lib/contentParser.astro"; | ||
import { getTaxonomy } from "@/lib/taxonomyParser.astro"; | ||
import taxonomyFilter from "@/lib/utils/taxonomyFilter"; | ||
import PageHeader from "@/partials/PageHeader.astro"; | ||
export async function getStaticPaths() { | ||
const tags = await getTaxonomy(config.settings.drink_folder, "tags"); | ||
return tags.map((tag) => { | ||
return { | ||
params: { tag }, | ||
}; | ||
}); | ||
} | ||
const { tag } = Astro.params; | ||
const posts = await getSinglePage(config.settings.drink_folder); | ||
const filterByCategories = taxonomyFilter(posts, "tags", tag!); | ||
--- | ||
|
||
<Base title={tag}> | ||
<PageHeader title={tag} /> | ||
<div class="section-sm pb-0"> | ||
<div class="container"> | ||
<div class="row"> | ||
{ | ||
filterByCategories.map((post) => ( | ||
<div class="mb-14 md:col-6 lg:col-4"> | ||
<DrinkCard data={post} /> | ||
</div> | ||
)) | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
</Base> |
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,39 @@ | ||
--- | ||
import config from "@/config/config.json"; | ||
import Base from "@/layouts/Base.astro"; | ||
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro"; | ||
import { humanize } from "@/lib/utils/textConverter"; | ||
import PageHeader from "@/partials/PageHeader.astro"; | ||
const { drink_folder }: { drink_folder: string } = config.settings; | ||
const tags = await getTaxonomy(drink_folder, "tags"); | ||
const allTags = await getAllTaxonomy(drink_folder, "tags"); | ||
--- | ||
|
||
<Base title={"Tags"}> | ||
<PageHeader title={"Tags"} /> | ||
<section class="section"> | ||
<div class="container text-center"> | ||
<ul> | ||
{ | ||
tags.map((tag: any) => { | ||
const count = allTags.filter((c) => c === tag).length; | ||
return ( | ||
<li class="m-3 inline-block"> | ||
<a | ||
href={`/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)}{" "} | ||
<span class="ml-2 rounded bg-body px-2 dark:bg-darkmode-body"> | ||
{count} | ||
</span> | ||
</a> | ||
</li> | ||
); | ||
}) | ||
} | ||
</ul> | ||
</div> | ||
</section> | ||
</Base> |
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,30 @@ | ||
--- | ||
import config from "@/config/config.json"; | ||
import Base from "@/layouts/Base.astro"; | ||
import PostSingle from "@/layouts/PostSingle.astro"; | ||
import { getSinglePage } from "@/lib/contentParser.astro"; | ||
export async function getStaticPaths() { | ||
const posts = await getSinglePage(config.settings.drink_folder); | ||
const paths = posts.map((post) => ({ | ||
params: { | ||
single: post.slug, | ||
}, | ||
props: { post }, | ||
})); | ||
return paths; | ||
} | ||
const { post } = Astro.props; | ||
const { title, meta_title, description, image } = post.data; | ||
--- | ||
|
||
<Base | ||
title={title} | ||
meta_title={meta_title} | ||
description={description} | ||
image={image} | ||
> | ||
<PostSingle post={post} /> | ||
</Base> |
Oops, something went wrong.