Save blog posts as html.md files so middleman can use pretty urls for it's blog posts
Tom Rutgers
committed Aug 18, 2018
commit 560060961aefeface4cd528fe2ed81eafd071602
Showing 7
changed files with
11 additions
and 19 deletions
source/admin/config.yml
+1
-1
| @@ | @@ -42,7 +42,7 @@ collections: |
| label: Blog | |
| folder: source/posts/ | |
| extension: .html.md | |
| - | format: .html.md |
| + | format: frontmatter |
| create: true | |
| slug: '{{year}}-{{month}}-{{day}}-{{title}}' | |
| fields: | |
source/partials/homepage/_news.slim
+7
-1
| @@ | @@ -3,6 +3,7 @@ section.homepage-news |
| h2 | |
| | News | |
| .news-items | |
| + | //get the first two most recent posts |
| - blog.articles.first(2).each do | post | | |
| .news-item | |
| .row | |
| @@ | @@ -10,12 +11,17 @@ section.homepage-news |
| - if post.data.image | |
| = link_to post | |
| = image_tag post.data.image | |
| + | |
| .date | |
| - | - date = Date.parse post.data.date |
| + | //make sure the post date is actually a date |
| + | - date = Date.parse post.data.date.to_s |
| span = date.strftime("%d-%m-%Y") | |
| + | |
| .content | |
| .wrapper | |
| = link_to post | |
| h3 = post.data.title | |
| + | |
| p = post.data.description | |
| + | |
| = link_to 'Read the story', post, class: 'cta' | |
source/posts/2018-08-14-making-sense-of-the-scaas-new-flavor-wheel.html.md
+1
-1
| @@ | @@ -1,6 +1,6 @@ |
| --- | |
| title: Making sense of the SCAA’s new Flavor Wheel | |
| - | date: '2018-08-14T12:01+02:00' |
| + | date: 2018-08-14T12:01+02:00 |
| description: >- | |
| The Coffee Taster’s Flavor Wheel, the official resource used by coffee | |
| tasters, has been revised for the first time this year. | |
source/posts/2018-08-16-a-beginners-guide-to-brewing-with-chemex.html.md
+1
-1
| @@ | @@ -1,6 +1,6 @@ |
| --- | |
| title: A beginners’ guide to brewing with Chemex | |
| - | date: '2018-08-16T12:01+02:00' |
| + | date: 2018-08-16T12:01+02:00 |
| description: >- | |
| Brewing with a Chemex probably seems like a complicated, time-consuming | |
| ordeal, but once you get used to the process, it becomes a soothing ritual | |
source/posts/2018-08-17-trying-a-html-md-extension-again.md
+0
-7
| @@ | @@ -1,7 +0,0 @@ |
| - | --- |
| - | title: Trying a .html.md extension again |
| - | date: 2018-08-17T11:55:10.648Z |
| - | description: 'Reading works fine, saving doesn''t' |
| - | image: /images/uploads/news_item-01.jpg |
| - | --- |
| - | Let's try again |
source/posts/2018-08-18-just-in-small-batch-of-jamaican-blue-mountain-in-store-next-week.html.md
+1
-1
| @@ | @@ -1,6 +1,6 @@ |
| --- | |
| title: 'Just in: small batch of Jamaican Blue Mountain in store next week' | |
| - | date: '2018-08-18T09:01+02:00' |
| + | date: 2018-08-18T09:01+02:00 |
| description: >- | |
| We’re proud to announce that we’ll be offering a small batch of Jamaica Blue | |
| Mountain coffee beans in our store next week. | |
source/posts/2018-08-18-test.html.md
+0
-7
| @@ | @@ -1,7 +0,0 @@ |
| - | --- |
| - | title: test |
| - | date: 2018-08-18T12:56:04.449Z |
| - | description: test |
| - | image: /images/uploads/news_item-02.jpg |
| - | --- |
| - | test |