remove layouts for home and blog

This commit is contained in:
madrilene 2024-08-14 08:13:46 +02:00
parent 7404c54c22
commit 71de535745
6 changed files with 78 additions and 83 deletions

View file

@ -30,9 +30,7 @@ export default async function (eleventyConfig) {
// --------------------- layout aliases // --------------------- layout aliases
eleventyConfig.addLayoutAlias('base', 'base.njk'); eleventyConfig.addLayoutAlias('base', 'base.njk');
eleventyConfig.addLayoutAlias('home', 'home.njk');
eleventyConfig.addLayoutAlias('page', 'page.njk'); eleventyConfig.addLayoutAlias('page', 'page.njk');
eleventyConfig.addLayoutAlias('blog', 'blog.njk');
eleventyConfig.addLayoutAlias('post', 'post.njk'); eleventyConfig.addLayoutAlias('post', 'post.njk');
eleventyConfig.addLayoutAlias('tags', 'tags.njk'); eleventyConfig.addLayoutAlias('tags', 'tags.njk');

View file

@ -1,41 +0,0 @@
---
layout: base
---
<div class="wrapper">
<header class="full | section" style="--spot-color: var(--color-primary)">
<div class="section__inner flow region">
<h1 class="text-center text-base-light">{{ title }}</h1>
</div>
{% svg "divider/waves", null, "seperator" %}
</header>
<article class="full | region">
<div class="wrapper flow prose">{{ content | safe }}</div>
</article>
<section class="full | region">
<div class="wrapper flow prose">
<h2>{{ blog.title }}</h2>
<!-- blog intro text is optional. -->
{% if blog.intro %}
<p>{{ blog.intro }}</p>
{% endif %}
<div class="feature | region">
<custom-masonry layout="50-50">
<!-- loop posts -->
{% set itemList = collections.allPosts %}
{% asyncEach item in itemList.slice(0, 4) %}
{% set definedDate = item.date %}
{% include "partials/card-blog.njk" %}
{% endeach %}
</custom-masonry>
</div>
</div>
</section>
</div>

View file

@ -1,12 +0,0 @@
---
title: Blog
description: 'All blog posts can be found here'
layout: blog
pagination:
data: collections.allPosts
size: 6
permalink: 'blog/{% if pagination.pageNumber >=1 %}page-{{ pagination.pageNumber + 1 }}/{% endif %}index.html'
---
This blog has a pagination of **{{ pagination.size }}** posts per page.
The pagination is only shown if there are more posts ({{ collections.posts.length }}) than items per page ({{ pagination.size }}).

View file

@ -1,5 +1,11 @@
--- ---
layout: base layout: base
title: Blog
description: 'All blog posts can be found here'
pagination:
data: collections.allPosts
size: 6
permalink: 'blog/{% if pagination.pageNumber >=1 %}page-{{ pagination.pageNumber + 1 }}/{% endif %}index.html'
--- ---
<article class="wrapper"> <article class="wrapper">
@ -11,16 +17,19 @@ layout: base
{% svg "divider/edgy", null, "seperator" %} {% svg "divider/edgy", null, "seperator" %}
</header> </header>
<div class="region flow prose" style="--region-space-top: var(--space-xl-2xl)">{{ content | safe }}</div> <div class="region flow prose" style="--region-space-top: var(--space-xl-2xl)">
<p>This blog has a pagination of <strong>{{ pagination.size }}</strong> posts per page.<br>
The pagination is only shown if there are more posts ({{ collections.posts.length }}) than items per
page ({{ pagination.size }}).
</p>
</div>
<custom-masonry layout="50-50"> <custom-masonry layout="50-50">
{% asyncEach item in pagination.items %} {% asyncEach item in pagination.items %}
{% set definedDate = item.date %} {% set definedDate = item.date %}
{% include "partials/card-blog.njk" %} {% include "partials/card-blog.njk" %}
{% endeach %} {% endeach %}
</custom-masonry> </custom-masonry>
<!-- set collection to paginate --> <!-- set collection to paginate -->

View file

@ -1,20 +0,0 @@
---
permalink: /index.html
title: 'Eleventy Excellent'
description: 'Eleventy starter using modern CSS, fluid type, fluid spacing, flexible layout and progressive enhancement.'
layout: 'home'
blog:
title: 'Blog'
intro: "I'm showing the last 4 blog posts, but there might be more!"
---
## An Eleventy starter
Built around a CSS workflow that emphasizes guiding browser styling rather than micromanaging it. It incorporates progressive enhancement, fluid type and spacing, and utilizes modern CSS features for layout. The goal is to develop frontends that provide a great experience across all devices, connection speeds, and usage contexts.
**This is version 3.**
I keep a [branch of v1](https://github.com/madrilene/eleventy-excellent/tree/v1) and [v2](https://github.com/madrilene/eleventy-excellent/tree/v2) because I have changed a lot of things.
I have tried to [document](/get-started/#docs-lol) most features and methodologies.
**Have fun** and let me know if you find any issues or have ideas for improvements!

61
src/pages/index.njk Normal file
View file

@ -0,0 +1,61 @@
---
layout: base
permalink: /index.html
title: 'Eleventy Excellent'
description: 'Eleventy starter using modern CSS, fluid type, fluid spacing, flexible layout and progressive enhancement.'
blog:
title: 'Blog'
intro: "I'm showing the last 4 blog posts, but there might be more!"
---
<div class="wrapper">
<header class="full | section" style="--spot-color: var(--color-primary)">
<div class="section__inner flow region">
<h1 class="text-center text-base-light">{{ title }}</h1>
</div>
{% svg "divider/waves", null, "seperator" %}
</header>
<article class="full | region">
<div class="wrapper flow prose">
<h2 id="an-eleventy-starter">An Eleventy starter</h2>
<p>
Built around a CSS workflow that emphasizes guiding browser styling rather than micromanaging it. It
incorporates progressive enhancement, fluid type and spacing, and utilizes modern CSS features for
layout. The goal is to develop frontends that provide a great experience across all devices,
connection speeds, and usage contexts.
</p>
<p>
<strong>This is version 3.</strong> I keep a
<a href="https://github.com/madrilene/eleventy-excellent/tree/v1">branch of v1</a> and
<a href="https://github.com/madrilene/eleventy-excellent/tree/v2">v2</a> because I have changed a lot
of things. I have tried to <a href="/get-started/#docs-lol">document</a> most features and
methodologies.
</p>
<p><strong>Have fun</strong> and let me know if you find any issues or have ideas for improvements!</p>
</div>
</article>
<section class="full | region">
<div class="wrapper flow prose">
<h2>{{ blog.title }}</h2>
<!-- blog intro text is optional. -->
{% if blog.intro %}
<p>{{ blog.intro }}</p>
{% endif %}
<div class="feature | region">
<custom-masonry layout="50-50">
<!-- loop posts -->
{% set itemList = collections.allPosts %}
{% asyncEach item in itemList.slice(0, 4) %}
{% set definedDate = item.date %}
{% include "partials/card-blog.njk" %}
{% endeach %}
</custom-masonry>
</div>
</div>
</section>
</div>