Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post index landing #254

Merged
merged 4 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addCollection("allNotification", require("./src/_system/11ty/collection/allNotification.js"));
eleventyConfig.addCollection("allTags", require("./src/_system/11ty/collection/allTags.js"));
eleventyConfig.addCollection("tags", require("./src/_system/11ty/collection/tags.js"));
eleventyConfig.addCollection("blocks", require("./src/_system/11ty/collection/blocks.js"));
eleventyConfig.addCollection("styleguide", require("./src/_system/11ty/collection/styleguide.js"));

// Transform
Expand Down
4 changes: 0 additions & 4 deletions src/_system/11ty/collection/blocks.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/_system/11ty/collection/tags.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The filter hides the tag from collections
function filterTags(tags) {
return (tags || []).filter((tag) => ["rssfeed", "relation"].indexOf(tag) === -1);
return (tags || []).filter((tag) => ["rssfeed"].indexOf(tag) === -1);
}

module.exports = function (collection) {
Expand Down
15 changes: 8 additions & 7 deletions src/_system/_decapcms/contenttypes/menuitem.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- name: menuitem
label: 🍔 Menu Items
label_singular: 🍔 Menu Item
description: "Single menu items to be included in the exising navigation structre. | Version: 1.0"
description: "Single menu items to be included in the exising navigation"
folder: "src/content/menuitem"
slug: "{{title}}"
preview_path: notification/{{title}}/
Expand All @@ -25,22 +25,23 @@
fields:
{% include "_system/_decapcms/widgets/string",
name: "title",
label: "title",
label: "Title",
default: "",
required: true,
hint: ""
hint: "The title is used for admin reference - the menu items title is set in the navigation"
%}
- name: eleventyNavigation
label: 🍔 Navigation
widget: object
collapsed: false
summary: "{{fields.key}} | {{fields.parent}}"
fields:
- { label: "key", name: key, widget: "string", required: true, hint: "Title and key"}
- { label: "url", name: url, widget: "string", required: false, hint: "Full url https://saga11.dev"}
- { label: "Title", name: title, widget: "string", required: true, hint: "Title"}
- { label: "Machine key", name: key, widget: "string", required: true, hint: "Title and key"}
- { label: "Url", name: url, widget: "string", required: false, hint: "Full url https://saga11.dev"}
- { label: "Open in new window", name: "target", widget: "boolean", default: false, required: false, }
- name: "parent"
label: parent menu item
label: Parent menu item
widget: relation
collection: page
default: main
Expand All @@ -49,6 +50,6 @@
displayFields: ["Title: {% raw %}{{title}} | key: '{{eleventyNavigation.key}} {% endraw %}'"]
required: false
multiple: false
- { label: "order", name: "order", widget: "number", required: false}
- { label: "Order", name: "order", widget: "number", required: false}
- { label: "text", name: "text", widget: "text", required: false}

8 changes: 3 additions & 5 deletions src/_system/_decapcms/contenttypes/page.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
create: true
delete: true
editor:
preview: true
summary: "{% raw %}🏩 {{title}} | url: {{url}} | {{permalink}}{% endraw %} "
preview: false
summary: "{% raw %}🏩 Title '{{title}}' Url: '{{url}}' {% endraw %} "
sortable_fields: ["url", "title", "order"]
view_filters:
- label: collection
Expand All @@ -21,10 +21,8 @@
view_groups:
- label: Tags
field: tags
- label: permalink
field: permalink
nested:
depth: 5 # max depth to show in the collection tree
depth: 1
summary: "{% raw %}{{title}}{% endraw %}"
fields:
{% include "_system/_decapcms/widgets/string",
Expand Down
4 changes: 2 additions & 2 deletions src/_system/_decapcms/fields/menu.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
multiple: false
- { label: "Machine key", name: "key", widget: "string", required: false, hint: "The Key is used by the system Main is used for the frontpage - and should always be" }
- { label: "Order", name: "order", widget: "number", required: false}
- { label: "Description", name: "description", widget: "text", default : "", required: false }
- { label: "Text string", name: "string", widget: "string", default : "", required: false, hint: "a string that can be used for icon name / color" }
- { label: "Text", name: "text", widget: "text", required: false}
- { label: "String", name: "optional", widget: "string", required: false, hint: "an optional text string that can be used in the theme ala {% raw %}{{ item.optional }}{% endraw %}" }
6 changes: 0 additions & 6 deletions src/_system/systempages/tags.liquid

This file was deleted.

3 changes: 2 additions & 1 deletion src/content/menuitem/saga11.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: saga11
title: Saga11 !!
eleventyNavigation:
url: https://saga11.dev
target: true
order: 100
key: saga11
parent: component
title: "SAGA "
---
2 changes: 1 addition & 1 deletion src/content/menuitem/styleguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ eleventyNavigation:
target: true
parent: main
key: Styleguide
order: 10
order: 100
---
28 changes: 14 additions & 14 deletions src/content/page/component.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
---
title: Components
card:
title: Title from a card
image: /content/upload/default.png
alt: alt text for image
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
"
title: Components overview
url: component
image: https://images.unsplash.com/photo-1496449903678-68ddcb189a24
components:
- type: pagecard
template: components/pagecard/pagecard.liquid
Expand Down Expand Up @@ -279,12 +270,21 @@ components:
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.
image: https://images.unsplash.com/photo-1496449903678-68ddcb189a24
card:
title: Title from a card
image: /content/upload/default.png
alt: alt text for image
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
"
tags:
- saga11
- rssfeed
order: 3
url: component
layout: page/page.liquid
date: 2023-06-12 11:58:55
eleventyExcludeFromCollections: false
Expand Down
2 changes: 1 addition & 1 deletion src/content/page/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ components:
- type: form
title: "Contact form "
name: contact
action: /submitted
action: /contact/thanx
template: components/form/form.liquid
elements:
- type: text
Expand Down
8 changes: 4 additions & 4 deletions src/content/page/footer-menu-placeholder.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: Footer placeholder
title: Footer menu placeholder
url: footer
image: ""
order: 1
eleventyExcludeFromCollections: true
layout: page/page.liquid
date: 2023-06-25 22:58:55
eleventyNavigation:
key: footer
title: footer
order: 0
layout: page/page.liquid
date: 2023-06-25 22:58:55
---
nope
This page is used as a placeholder for the footer menu ...
20 changes: 20 additions & 0 deletions src/content/page/post-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Blog Posts
url: post
image: ""
components:
- type: njktemplate
template: components/templates/all-post.liquid
order: 1
eleventyExcludeFromCollections: false
eleventyNavigation:
description: ""
string: ""
title: Blog post
parent: main
order: 20
seo:
index: index
follow: nofollow
layout: page/page.liquid
---
21 changes: 21 additions & 0 deletions src/content/page/tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: tags
url: tag
image: /content/upload/default.png
components:
- type: njktemplate
template: components/templates/all-tags.liquid
order: 1
eleventyExcludeFromCollections: false
eleventyNavigation:
description: ""
string: ""
title: Tags
parent: main
key: ""
order: 15
seo:
index: index
follow: nofollow
layout: page/page-tags.liquid
---
8 changes: 4 additions & 4 deletions src/content/page/thanks.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Form Submitted thanx
image: /content/upload/default.png
url: submitted
title: Thanx
url: contact/thanx
image: ""
eleventyExcludeFromCollections: true
eleventyNavigation:
excerpt: ""
layout: page/page.liquid
eleventyExcludeFromCollections: true
---
The message is sent :)
4 changes: 2 additions & 2 deletions src/content/tag/saga11.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ icon: icons/arrow-down-left.svg
eleventyExcludeFromCollections: false
rssfeed: true
eleventyNavigation:
title: Tag page
parent: main
title: ""
parent: ""
order: 20
layout: tag/tag.liquid
---
Expand Down
3 changes: 1 addition & 2 deletions src/theme-grunn/includes/card.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
<h3 class="mt-2 text-2xl dark:text-cyan-200">{{ title }}</h3>

<div class="mt-2 line-clamp-3">
date: {{ dateLocalize }}
{{ text }}
{{ text }}
</div>
{% if date %}
<div class="pt-2 text-tone-600 text-right">
Expand Down
6 changes: 4 additions & 2 deletions src/theme-grunn/includes/components/form/form.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
</div>


<form name="{{ component.name | url_encode }}" method="POST" data-netlify="true" netlify-honeypot="bot-field" action="/{{ component.action }}/"
<form name="{{ component.name | url_encode }}"
method="POST"
data-netlify="true" netlify-honeypot="bot-field" action="{{ component.action }}/"
class="basis-1/2 py-20 px-20 flex flex-col space-y-4">
{% comment %}<div data-netlify-recaptcha="true"></div> {% endcomment %}
<div hidden>
<label for="supersecret">secret</label>
<input name="bot-field" id="supersecret" />
</div>

action : {{ component.action }}
{% comment %}All the form elements {% endcomment %}
{% for item in component.elements %}
{% if item.type == "textarea" %}
Expand Down
33 changes: 17 additions & 16 deletions src/theme-grunn/includes/components/templates/all-pages.liquid
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{%- if env.mode != 'prod' %}
<!-- src/theme-grunn/includes/components/templates/all-pages.liquid -->
{%- endif -%}
{%- if env.mode != 'prod' %}<!-- src/theme-grunn/includes/components/templates/all-pages.liquid -->{%- endif -%}

<section>
<h2 class="text-5xl text-center text-cyan-700 dark:text-cyan-200">All pages</h2>
<section class="grid md:grid-cols-3 gap-4 py-4">

<div class="grid md:grid-cols-3 gap-4 py-4">
{% for item in collections.allPages %}

{% for item in collections.allPages %}
{% render 'card',
title: item.data.card.title,
text: item.data.card.text,
image: item.data.card.image,
url: item.url,
date: item.date
{% assign title = item.data.card.title | default: item.data.title %}
{% assign image = item.data.card.image | default: item.data.image %}
{% assign text = item.data.card.text | default: item.data.text | truncatewords: "20", " ..." %}
{%
render 'card.liquid',
title: title,
text: text,
image: image,
url: item.url,
date: item.date
%}

{% endfor %}
</div>
</section>

{% endfor %}
</section>

21 changes: 12 additions & 9 deletions src/theme-grunn/includes/components/templates/all-post.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
<!-- src/theme-grunn/includes/components/templates/all-post.liquid -->
{%- endif -%}

<h2 class="text-5xl text-center text-cyan-700 dark:text-cyan-200">All Post</h2>

<section class="grid md:grid-cols-3 gap-4 py-4">

{% for item in collections.allPosts %}

{% render 'card',
title: item.data.card.title,
text: item.data.card.text,
image: item.data.card.image,
url: item.url,
date: item.date
{% assign title = item.data.card.title | default: item.data.title %}
{% assign image = item.data.card.image | default: item.data.image %}
{% assign text = item.data.card.text | default: item.data.text | truncatewords: "20", " ..." %}
{%
render 'card.liquid',
title: title,
text: text,
image: image,
url: item.url,
date: item.date
%}


{% endfor %}
</section>
</section>
22 changes: 22 additions & 0 deletions src/theme-grunn/includes/components/templates/all-tags.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{%- if env.mode != 'prod' %}<!-- src/theme-grunn/includes/components/templates/all-pages.liquid -->{%- endif -%}

<section class="grid md:grid-cols-3 gap-4 py-4">

{% for item in collections.allTags %}
{% if item.fileSlug != "rssfeed" %}
{% assign title = item.data.card.title | default: item.data.title %}
{% assign image = item.data.card.image | default: item.data.image %}
{% assign text = item.data.card.text | default: item.data.text | truncatewords: "20", " ..." %}
{%
render 'card.liquid',
title: title,
text: text,
image: image,
url: item.url,
date: item.date
%}

{% endif %}
{% endfor %}
</section>

6 changes: 0 additions & 6 deletions src/theme-grunn/includes/components/templates/default.liquid

This file was deleted.

Loading