-
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
Reed Nelson
committed
Jul 8, 2024
1 parent
46d9f34
commit 7bb20b5
Showing
9 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,4 @@ | ||
--- | ||
title: Camping Food | ||
description: A modest recipe book for camping. | ||
--- |
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,22 @@ | ||
--- | ||
title: "" | ||
description: "" | ||
cover: "@assets/food/.jpg" | ||
author: Reed Nelson | ||
prep_time: 0 | ||
servings: 0 | ||
diet: "" | ||
draft: true | ||
|
||
ingredients: | ||
list: | ||
- Ingredient | ||
qty: | ||
- qty | ||
|
||
instructions: | ||
- Step | ||
|
||
notes: | ||
- Note | ||
--- |
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,53 @@ | ||
--- | ||
title: Pad Thai | ||
description: This is a test recipe. Pay no mind. | ||
cover: "@assets/campfood/pad-thai.jpg" | ||
author: Reed Nelson | ||
prep_time: 45 | ||
servings: 4 | ||
diet: Vegan, GF | ||
|
||
ingredients: | ||
list: | ||
- Wide rice noodles | ||
- Fresh cilantro | ||
- Green onion | ||
- Garlic (minced) | ||
- Ginger (grated) | ||
- Brown sugar | ||
- Soy sauce (low sodium) | ||
- Peanut butter | ||
- Lime juice | ||
- Sriracha | ||
- Roasted peanuts | ||
qty: | ||
- 14 oz | ||
- 1 bunch | ||
- 6 stalks | ||
- 4 cloves | ||
- 1⁄4 cup | ||
- 1⁄3 cup | ||
- 1⁄2 cup | ||
- 1⁄4 cup | ||
- 1⁄4 cup | ||
- 1 tbsp | ||
- 1⁄4 cup | ||
|
||
instructions: | ||
- "Stir fry prep: chop and combine garlic, ginger, cilantro, green onion, and any other desired ingredients*." | ||
- "Noodle prep: cook noodles al dente; rinse and drain well." | ||
- "Sauce prep: combine brown sugar, peanut butter, soy sauce, lime juice, and sriracha in a bowl." | ||
- "Garnish prep: optionally chop peanuts/limes/cilantro and set aside for serving." | ||
- Saute stir fry ingredients in a large pan; account for differences in cook time among ingredients. | ||
- Add noodles to the pan, combine thoroughly. | ||
- Add sauce, combine thoroughly. | ||
- Remove from heat when sauce is cooked in to your liking. | ||
- Serve. | ||
|
||
notes: | ||
- "*Other desired ingredients may include spinach, broccoli, bell pepper, baby corn, etc." | ||
- Steps 1-4 can be parallelized, and that's where most of the work is. | ||
- Cilantro is really great. | ||
- I recommend dividing the veggies that will saute quickly from those that will slowly. | ||
- Keep the soy sauce and lime juice handy, you may want more flavor toward the end. | ||
--- |
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,29 @@ | ||
--- | ||
import config from "@/config/config.json"; | ||
import Base from "@/layouts/Base.astro"; | ||
import FoodSingle from "@/layouts/FoodSingle.astro"; | ||
import { getSinglePage } from "@/lib/contentParser.astro"; | ||
export async function getStaticPaths() { | ||
const posts = await getSinglePage(config.settings.campfood_folder); | ||
const paths = posts.map((post: any) => ({ | ||
params: { | ||
single: post.slug, | ||
}, | ||
props: { post }, | ||
})); | ||
return paths; | ||
} | ||
const { post } = Astro.props; | ||
const { title, description, image } = post.data; | ||
--- | ||
|
||
<Base | ||
meta_title={title} | ||
description={description} | ||
image={image} | ||
> | ||
<FoodSingle post={post} /> | ||
</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,42 @@ | ||
--- | ||
import FoodCard from "@/components/FoodCard.astro"; | ||
import Pagination from "@/components/Pagination.astro"; | ||
import config from "@/config/config.json"; | ||
import Base from "@/layouts/Base.astro"; | ||
import { getSinglePage } from "@/lib/contentParser.astro"; | ||
import PageHeader from "@/components/PageHeader.astro"; | ||
import { getEntryBySlug } from "astro:content"; | ||
const { campfood_folder } = config.settings; | ||
const postIndex: any = await getEntryBySlug<any, string>(campfood_folder, "-index"); | ||
const posts = await getSinglePage(campfood_folder); | ||
const totalPages: number = Math.ceil(posts.length / config.settings.food_pagination); | ||
const currentPosts = posts.slice(0, config.settings.food_pagination); | ||
--- | ||
|
||
<Base | ||
meta_title={postIndex.data.title} | ||
image={postIndex.data.image} | ||
description={postIndex.data.description} | ||
> | ||
<PageHeader title={postIndex.data.title} /> | ||
<section class="section"> | ||
<div class="container"> | ||
<!-- food posts --> | ||
<div class="row"> | ||
{ | ||
currentPosts.map((post) => ( | ||
<div class="mb-4 md:mb-8 md:col-6 lg:col-4"> | ||
<FoodCard data={post} /> | ||
</div> | ||
)) | ||
} | ||
</div> | ||
<Pagination | ||
section={campfood_folder} | ||
currentPage={1} | ||
totalPages={totalPages} | ||
/> | ||
</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,63 @@ | ||
--- | ||
import FoodCard from "@/components/FoodCard.astro"; | ||
import Pagination from "@/components/Pagination.astro"; | ||
import config from "@/config/config.json"; | ||
import Base from "@/layouts/Base.astro"; | ||
import { getSinglePage } from "@/lib/contentParser.astro"; | ||
import { sortByDate } from "@/lib/utils/sortFunctions"; | ||
import PageHeader from "@/components/PageHeader.astro"; | ||
import { getEntryBySlug } from "astro:content"; | ||
const { campfood_folder } = config.settings; | ||
const { slug } = Astro.params; | ||
const postIndex: any = await getEntryBySlug<any, string>(campfood_folder, "-index"); | ||
const posts = await getSinglePage(campfood_folder); | ||
const sortedPosts = sortByDate(posts); | ||
const totalPages = Math.ceil(posts.length / config.settings.food_pagination); | ||
const currentPage = slug && !isNaN(Number(slug)) ? Number(slug) : 1; | ||
const indexOfLastPost = currentPage * config.settings.food_pagination; | ||
const indexOfFirstPost = indexOfLastPost - config.settings.food_pagination; | ||
const currentPosts = sortedPosts.slice(indexOfFirstPost, indexOfLastPost); | ||
export async function getStaticPaths() { | ||
const posts = await getSinglePage(config.settings.campfood_folder); | ||
const totalPages = Math.ceil(posts.length / config.settings.food_pagination); | ||
const paths = []; | ||
for (let i = 1; i < totalPages; i++) { | ||
paths.push({ | ||
params: { | ||
slug: (i + 1).toString(), | ||
}, | ||
}); | ||
} | ||
return paths; | ||
} | ||
--- | ||
|
||
<Base | ||
meta_title={postIndex.data.title} | ||
image={postIndex.data.image} | ||
description={postIndex.data.description} | ||
> | ||
<PageHeader title={postIndex.data.title} /> | ||
<section class="section"> | ||
<div class="container"> | ||
<!-- food posts --> | ||
<div class="row"> | ||
{ | ||
currentPosts.map((post) => ( | ||
<div class="mb-4 md:mb-8 md:col-6 lg:col-4"> | ||
<FoodCard data={post} /> | ||
</div> | ||
)) | ||
} | ||
</div> | ||
<Pagination | ||
section={campfood_folder} | ||
currentPage={currentPage} | ||
totalPages={totalPages} | ||
/> | ||
</div> | ||
</section> | ||
</Base> |