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

Restore system pages #184

Merged
merged 4 commits into from
Oct 9, 2022
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
2 changes: 1 addition & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("src/debug/");

// global vars
eleventyConfig.addNunjucksGlobal("saga11version", "0.5 beta");
eleventyConfig.addNunjucksGlobal("saga11version", "0.5.5 beta");
// get the theme folder name
eleventyConfig.addNunjucksGlobal("theme", theme);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "saga11",
"version": "0.5beta",
"version": "0.5.5beta",
"description": "Website builder based on 11ty & netlifycms",
"main": "eleventy.config.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/_custom/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# \_Custom

This folder holds custom setup for the site
content-types.njk sets up collections for netlifycms
settings.njk can be used to define settings files ex a .json file for a content type
1 change: 1 addition & 0 deletions src/_custom/content-types.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% from 'src/system/netlifycms/templatecollection.macro.njk' import templatecollection, templaterelation %}
{# syntax #}
{% raw %}
- name: foobar
label: 💜 Foobar
Expand Down
4 changes: 0 additions & 4 deletions src/content/custom/2022/10/07_foo.md

This file was deleted.

3 changes: 0 additions & 3 deletions src/content/custom/custom.json

This file was deleted.

8 changes: 4 additions & 4 deletions src/system/netlifycms/settings/site.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
file: "src/content/data/site.json"
fields:
- { label: Title, name: title, widget: string }
- { label: Description, name: description, widget: text, required: false }
- { label: Keywords, name: keywords, widget: text, required: false }
- { label: Seo default Description, name: description, widget: text, required: false }
- { label: Seo default Keywords, name: keywords, widget: text, required: false }
- { label: Header, name: header, widget: text, required: false, hint: "Data block placed inside the header tag ex for tracking scripts" }
- { label: "404 Errorpage", name: errorpage, widget: text, required: false }
- { label: "Humans.txt", name: humantxt, widget: text, required: false }
- { label: "RSS Feed", name: rss, widget: boolean, default: true, hint: "/feed.xml",}
- { label: Author (rss), name: authorname, widget: string, required: false, hint: "Feed Author name"}
- { label: Author Email (rss), name: Authoremail,widget: string, required: false,hint: "Feed Author name"}
- { label: "RSS Author", name: authorname, widget: string, required: false, hint: "Feed Author name"}
- { label: "RSS Author Email" , name: Authoremail,widget: string, required: false,hint: "Feed Author name"}
- { label: Browesercolor, name: color, widget: color, required: false }
{% endraw %}
6 changes: 6 additions & 0 deletions src/system/systempages/404.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
permalink: 404.html
title: "404"
layout: system/404.njk
eleventyExcludeFromCollections: true
---
61 changes: 61 additions & 0 deletions src/system/systempages/feed-tag.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
pagination:
data: collections.allTags
size: 1
alias: tag
addAllPagesToCollections: true
eleventyComputed:
title: "{{ tag.data.title }}"
permalink: feed/{{ tag.data.title | replace(" ", "") | slugify }}.xml
eleventyComputed:
title: "{{ tag.data.title }}"
content: "{{ tag.data.content }}"
eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>{{ site.title }}: {{ title }}</title>
<subtitle>{{ content }} </subtitle>
<link href="{{ env.url }}/feed/{{ title | slugify }}.xml" rel="self"/>
<link href="{{ env.url }}"/>
<generator uri="https://saga11.dev">Saga11</generator>
<logo>{{env.url}}/assets/icon/icon-safari.png</logo>
<icon>{{env.url}}/assets/icon/icon-safari.png</icon>
<updated>{{ collections[ tag.fileSlug ] | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
<id>{{ env.url }}/tag/{{ title | slugify }}</id>
<author>
<name>{{ site.authorname }}</name>
<email>{{ site.authoremail }}</email>
</author>

{%- for item in collections[ tag.fileSlug ] | reverse %}

{%- set absolutePostUrl = item.url | url | absoluteUrl(env.url) %}

<entry>
<title>{{ item.data.card.title }}</title>
<link href="{{ absolutePostUrl }}"/>
<summary> {{item.data.card.text }} </summary>
<updated>{{ item.date | dateToRfc3339 }}</updated>
<id>{{ absolutePostUrl }}</id>
<content type="html">
{% if item.data.card.image %}
<![CDATA[
{% picture
img=item.data.card.image,
width=[640],
format="png",
sizes="",
css="",
loading = ""
%}
]]>
{% endif %}
{{ item.templateContent | truncate(400, true, "..." ) | htmlToAbsoluteUrls(absolutePostUrl) }}
</content>
</entry>

{%- endfor %}

</feed>
51 changes: 51 additions & 0 deletions src/system/systempages/feed.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
permalink: feed.xml
eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>{{ site.title }}</title>
<subtitle>{{ site.description }}</subtitle>
<link href="{{ env.url }}/feed.xml" rel="self"/>
<generator uri="https://saga11.dev">Saga11</generator>
<logo>{{env.url}}/assets/icon/icon-safari.png</logo>
<icon>{{env.url}}/assets/icon/icon-safari.png</icon>
<updated>{{ collections.rssfeed | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
<id>{{ env.url }}/</id>
<author>
<name>{{ site.authorname }}</name>
<email>{{ site.authoremail }}</email>
</author>

{%- for item in collections.rssfeed | reverse %}

{%- set absolutePostUrl = item.url | url | absoluteUrl(env.url) %}

<entry>
<title>{{ item.data.card.title }}</title>
<link href="{{ absolutePostUrl }}"/>
<summary> {{item.data.card.text }} </summary>
<updated>{{ item.date | dateToRfc3339 }}</updated>
<id>{{ absolutePostUrl }}</id>
<content type="html">
{% if item.data.card.image %}
<![CDATA[
{% picture
img=item.data.card.image,
width=[640],
format="png",
sizes="",
css="",
loading = ""
%}
]]>
{% endif %}

{{ item.templateContent | truncate(400, true, "..." ) | htmlToAbsoluteUrls(absolutePostUrl) }}
</content>
</entry>

{%- endfor %}

</feed>
16 changes: 16 additions & 0 deletions src/system/systempages/humans.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
permalink: /humans.txt
eleventyExcludeFromCollections: true
---
{{ site.title }}
{{ env.url }}
{{ eleventy.generator }}
saga11: {{saga11.version }}
---

{{ site.humantxt }}

---
Build:
{{ theme }}
{{ page.date | formatDate("cccc d. MMMM yyyy HH:mm") }}
5 changes: 5 additions & 0 deletions src/system/systempages/pwa-splashscreen-dark.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
permalink: /pwa-splashscreen-dark/
layout: system/pwa-splashscreen-dark.njk
eleventyExcludeFromCollections: true
---
5 changes: 5 additions & 0 deletions src/system/systempages/pwa-splashscreen.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
permalink: /pwa-splashscreen/
layout: system/pwa-splashscreen.njk
eleventyExcludeFromCollections: true
---
8 changes: 8 additions & 0 deletions src/system/systempages/robots.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
permalink: /robots.txt
eleventyExcludeFromCollections: true
---
Sitemap: {{ env.url }}/sitemap.xml

User-agent: *
Disallow:
13 changes: 13 additions & 0 deletions src/system/systempages/sitemap.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
permalink: /sitemap.xml
eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in collections.all %}
<url>
<loc>{{ env.url }}{{ page.url | url }}</loc>
<lastmod>{{ page.date.toISOString() }}</lastmod>
</url>
{% endfor %}
</urlset>
23 changes: 23 additions & 0 deletions src/system/systempages/webmanifest.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
permalink: /manifest.webmanifest
eleventyExcludeFromCollections: true
---
{
"name": "{{ site.title }}",
"short_name": "{{ site.title }}",
"start_url": "./",
"scope": "/",
"display": "standalone",
"background_color": "{{site.color}}",
"theme_color": "{{site.color}}",
"description": "{{ site.description }}",
"icons": [
{ "src": "themes/{{ theme }}/assets/icon/icon-192.png", "type": "image/png", "sizes": "192x192" },
{ "src": "themes/{{ theme }}/assets/icon/icon-512.png", "type": "image/png", "sizes": "512x512" }, {
"src": "themes/{{ theme }}/assets/icon/maskable-icon.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
Binary file modified src/themes/grunn/assets/icon/maskable-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/themes/grunn/assets/icon/maskable-icon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.