diff --git a/css/style.css b/css/style.css index 0aa655a..1784a63 100644 --- a/css/style.css +++ b/css/style.css @@ -64,6 +64,28 @@ a { color: var(--secondary-color); } +/* Section header with view all link */ +.section-header { + display: flex; + justify-content: space-between; + align-items: flex-start; +} + +.section-header h1 { + margin: 1.5rem 0 1rem; +} + +.view-all { + margin-top: 1.5rem; + font-size: 0.9rem; + color: var(--secondary-color); + text-decoration: none; +} + +.view-all:hover { + text-decoration: underline; +} + /* Blog post list */ .post-list { list-style: none; diff --git a/index.njk b/index.njk index 40a2ea4..71793b8 100644 --- a/index.njk +++ b/index.njk @@ -9,10 +9,16 @@ description: Welcome to my website! I write about tech, politics, food, and hobb {% if collections.posts.length > 0 %} -

Blog Posts

+
+

Blog Posts

+ {% if collections.posts.length > 3 %} + view all + {% endif %} +
{% endif %} -{% set hasRecipes = false %} +{% set recipesList = [] %} {% for slug, recipeData in collections.recipesBySlug %} {% if recipeData.newest %} - {% set hasRecipes = true %} + {% set recipesList = recipesList.concat([{slug: slug, data: recipeData}]) %} {% endif %} {% endfor %} -{% if hasRecipes %} -

Recipes

+{% if recipesList.length > 0 %} +
+

Recipes

+ {% if recipesList.length > 3 %} + view all + {% endif %} +
{% endif %} \ No newline at end of file diff --git a/posts-index.njk b/posts-index.njk new file mode 100644 index 0000000..abb3d19 --- /dev/null +++ b/posts-index.njk @@ -0,0 +1,26 @@ +--- +layout: base.njk +title: All Blog Posts +description: All blog posts on Volpe. +permalink: /posts/ +--- + +

Blog Posts

+ +{% if collections.posts.length > 0 %} + +{% else %} +

No blog posts yet.

+{% endif %} \ No newline at end of file diff --git a/recipes-index.njk b/recipes-index.njk new file mode 100644 index 0000000..b129f8c --- /dev/null +++ b/recipes-index.njk @@ -0,0 +1,34 @@ +--- +layout: base.njk +title: All Recipes +description: All recipes on Volpe. +permalink: /recipes/ +--- + +

Recipes

+ +{% set hasRecipes = false %} +{% for slug, recipeData in collections.recipesBySlug %} + {% if recipeData.newest %} + {% set hasRecipes = true %} + {% endif %} +{% endfor %} + +{% if hasRecipes %} + +{% else %} +

No recipes yet.

+{% endif %} \ No newline at end of file