Skip to content

Commit

Permalink
Fix issues in 2022-12-23-multipage-blog-post.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cadamini authored Nov 16, 2024
1 parent dad4e94 commit 2ae2432
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions _posts/2022-12-23-multipage-blog-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,32 @@ featured: false
author: christian
---

This [Stackoverflow question](https://stackoverflow.com/questions/74813094/how-can-i-create-a-multi-page-blog-post-in-jekyll/74869733#comment132162516_74869733) was how to create a multipage blog post with pagination on top and at the bottom for a sample page.
This [Stackoverflow question](https://stackoverflow.com/questions/74813094/how-can-i-create-a-multi-page-blog-post-in-jekyll/74869733#comment132162516_74869733) asked how to create a multipage blog post with pagination and shared this [sample WordPress page](https://shayallenhill.com/ai-generated-palettes/) with separate subpages.

Here's the [sample Wordpress blog post page](https://shayallenhill.com/ai-generated-palettes/) with separate subpages.
## Approach

I created a new collection, two layouts, and two include files in Jekyll.

### Two layouts

Jekyll allows you to add layouts if you HTML structure differs between pages. The page needs two layouts as the startpage differs from all other pages in the site. Each layout contains two for loops to create links to the subpages on top and at the bottom.
Jekyll allows you to add layouts if your HTML structure differs between pages. The page needs two layouts as the start page differs from all other pages on the site. Each layout contains two for loops to create links to the subpages on top and at the bottom.

### The collection

Jekyll offers posts and collection. In this case, the collection is required to have folder to store pages and to have links to the single pages.
Jekyll offers posts and collections. In this case, the collection is required to have a folder to store pages and to have links to the single pages.

### Includes

Jekyll has includes for shared content. The pages share some content in different places, e.g. the page about Wes and the other artists, depending on which link you click.

## Code

[Code (first version)](https://github.com/cadamini/cadamini.github.io/commit/de2921161ad5748c68d99970bf40639245cc5572) (updated index: index to palettes-index later)
The Stackoverflow answer shares some code, too. You can find all files in GitHub in this [commit](https://github.com/cadamini/cadamini.github.io/commit/de2921161ad5748c68d99970bf40639245cc5572). Note that I updated the index page to palettes-index later.

## Resulting Jekyll example

Here's the resulting example using some hacky, not styled, and not optimized. But at least, it should be good to transfer the idea:

[https://cadamini.github.io/palettes-index/](https://cadamini.github.io/palettes-index/)
## Jekyll result

This [non-styled example page](https://cadamini.github.io/palettes-index/](https://cadamini.github.io/palettes-index/) should transfer the idea well enough.

---

Post image: <a href="https://www.freepik.com/free-vector/blue-round-modern-annual-report-template_1111040.htm#query=cover&position=2&from_view=keyword">Image by new7ducks</a> on Freepik
Post image: <a href="https://www.freepik.com/free-vector/blue-round-modern-annual-report-template_1111040.htm#query=cover&position=2&from_view=keyword">Image by new7ducks</a> on Freepik

0 comments on commit 2ae2432

Please sign in to comment.