aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/about.md7
-rw-r--r--src/assets/assets.11tydata.js8
-rw-r--r--src/assets/atom.njk (renamed from src/feed.njk)3
-rw-r--r--src/assets/error.md (renamed from src/error.md)1
-rw-r--r--src/assets/index.css126
-rw-r--r--src/assets/index.mjs12
-rw-r--r--src/assets/json.njk30
-rw-r--r--src/assets/manifest.njk30
-rw-r--r--src/assets/prism.css162
-rw-r--r--src/assets/robot.njk (renamed from src/robot.njk)1
-rw-r--r--src/assets/sitemap.njk (renamed from src/sitemap.njk)1
-rw-r--r--src/assets/sw.mjs59
-rw-r--r--src/blog.njk26
-rw-r--r--src/css.11ty.js36
-rw-r--r--src/data/env.js3
-rw-r--r--src/data/err.js121
-rw-r--r--src/data/err.json166
-rw-r--r--src/data/metadata.js16
-rw-r--r--src/data/metadata.json12
-rw-r--r--src/data/navigator.js13
-rw-r--r--src/data/navigator.json14
-rw-r--r--src/index.css62
-rw-r--r--src/js.11ty.js35
-rw-r--r--src/layouts/base.njk58
-rw-r--r--src/layouts/post.njk4
-rw-r--r--src/post/hello_world.md8
-rw-r--r--src/post/post.11tydata.js8
-rw-r--r--src/post/post.json3
-rw-r--r--src/prism.css130
29 files changed, 648 insertions, 507 deletions
diff --git a/src/about.md b/src/about.md
index 4524f7a..8dda981 100644
--- a/src/about.md
+++ b/src/about.md
@@ -6,3 +6,10 @@ tags:
---
# About Me
+## {{ metadata.author.name }}
+
+!["A Photo of me]({{ "/favicon/512.png" | url}}){.side}
+
+Email: <{{ metadata.author.email }}>
+
+Github: <{{ metadata.author.github }}>
diff --git a/src/assets/assets.11tydata.js b/src/assets/assets.11tydata.js
new file mode 100644
index 0000000..6704307
--- /dev/null
+++ b/src/assets/assets.11tydata.js
@@ -0,0 +1,8 @@
+const path = require("path")
+
+module.exports = {
+ eleventyExcludeFromCollections: true,
+ eleventyComputed: {
+ permalink: data => data.permalink || `/${path.relative("/assets", data.page.filePathStem)}.${data.page.outputFileExtension}`
+ }
+} \ No newline at end of file
diff --git a/src/feed.njk b/src/assets/atom.njk
index 120c33b..4e517ca 100644
--- a/src/feed.njk
+++ b/src/assets/atom.njk
@@ -1,6 +1,5 @@
---
permalink: /feed.xml
-eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
@@ -21,7 +20,7 @@ eleventyExcludeFromCollections: true
<link href="{{ absolutePostUrl }}"/>
<updated>{{ post.date | dateToRfc3339 }}</updated>
<id>{{ '/' | url | absoluteUrl(metadata.url) }}</id>
- <content type="html">{{ post.templateContent | htmlToAbsoluteUrls( absolutePostUrl ) }}</content>
+ <content type="html"><![CDATA[{{ post.templateContent | htmlToAbsoluteUrls( absolutePostUrl ) }}]]></content>
</entry>
{% endfor %}
</feed>
diff --git a/src/error.md b/src/assets/error.md
index a84fe07..65655f3 100644
--- a/src/error.md
+++ b/src/assets/error.md
@@ -5,7 +5,6 @@ pagination:
size: 1
alias: error
permalink: "/{{ error.code }}.html"
-eleventyExcludeFromCollections: true
---
# ERROR: {{ error.code }} {.err}
diff --git a/src/assets/index.css b/src/assets/index.css
new file mode 100644
index 0000000..db51dc8
--- /dev/null
+++ b/src/assets/index.css
@@ -0,0 +1,126 @@
+:root {
+ --fg: rgb(0 0 0);
+ --bg: rgb(255 255 255);
+ --brand: rgb(139 0 0);
+
+ @media screen and (prefers-color-scheme: dark) {
+ --bg: rgb(0 0 0);
+ --fg: rgb(255 255 255);
+ --brand: rgb(255 0 0);
+ }
+}
+
+body {
+ font-family: serif;
+ background-color: var(--bg);
+ color: var(--fg);
+
+ @media screen {
+ max-width: 920px;
+ min-height: calc(100vh - 1rem);
+ margin: 0.5rem auto;
+ display: grid;
+ grid-template: "head" auto "main" auto "footer" 1fr / auto;
+
+ & > header {
+ background-color: var(--brand);
+ font-weight: bold;
+ color: rgb(255 255 255);
+ padding: 1rem;
+ grid-area: head;
+
+ & *:any-link {
+ text-decoration: none;
+ }
+ }
+
+ & > footer {
+ background-color: var(--brand);
+ color: rgb(255 255 255);
+ padding: 0.5rem;
+ align-self: end;
+ grid-area: footer;
+
+ & *:any-link {
+ text-decoration: none;
+ }
+
+ & > main {
+ grid-area: main;
+ }
+ }
+ }
+}
+
+* :any-link {
+ color: inherit;
+ text-decoration: underline;
+
+ @media screen {
+ &:is(:hover, :active) {
+ font-style: italic;
+ }
+ }
+}
+
+a[href^="mailto:"]::after {
+ content: "📧";
+}
+
+.err {
+ color: var(--brand);
+}
+
+aside {
+ width: 40%;
+ padding: 0.5rem;
+ margin-left: 0.5rem;
+ float: right;
+ background-color: var(--brand);
+ color: rgb(255 255 255);
+}
+
+img {
+ max-width: 100%;
+ max-height: 100%;
+
+ &.side {
+ width: 40%;
+ float: right;
+
+ @media screen and (max-width: 450px) {
+ width: 100%;
+ float: none;
+ }
+ }
+}
+
+@media screen {
+ nav > a {
+ margin-right: 1rem;
+ padding-left: 0;
+ padding-right: 0;
+
+ @media (max-width: 450px) {
+ display: block;
+ margin: auto;
+ text-align: center;
+ padding: 16px;
+
+ .navlinks {
+ display: none;
+
+ .navopen {
+ display: block;
+ }
+ }
+ }
+ }
+}
+
+@media print {
+ header,
+ footer {
+ display: none;
+ }
+}
diff --git a/src/assets/index.mjs b/src/assets/index.mjs
new file mode 100644
index 0000000..4d7c2b0
--- /dev/null
+++ b/src/assets/index.mjs
@@ -0,0 +1,12 @@
+document.getElementById("nav-toogle").addEventListener("click", async() => {
+ const navlinks = Array.from(document.getElementsByClassName("navlinks"))
+ for (const navlink of navlinks) {
+ navlink.classList.toggle("navopen")
+ }
+ return false
+})
+window.addEventListener('load', async() => {
+ if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register('/sw.js')
+ }
+}) \ No newline at end of file
diff --git a/src/assets/json.njk b/src/assets/json.njk
new file mode 100644
index 0000000..6d8c7ec
--- /dev/null
+++ b/src/assets/json.njk
@@ -0,0 +1,30 @@
+---
+permalink: /feed.json
+---
+{
+ "version": "https://jsonfeed.org/version/1.1",
+ "title": "{{ metadata.title }}",
+ "language": "{{ metadata.language }}",
+ "home_page_url": "{{ "/" | url | absoluteUrl(metadata.url) }}",
+ "feed_url": "{{ permalink | url | absoluteUrl(metadata.url) }}",
+ "description": "{{ metadata.description }}",
+ "author": {
+ "name": "{{ metadata.author.name }}"
+ },
+ "items": [
+ {%- for post in collections.posts | reverse %}
+ {%- set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset -%}
+ {
+ "id": "{{ absolutePostUrl }}",
+ "url": "{{ absolutePostUrl }}",
+ "title": "{{ post.data.title }}",
+ "content_html": {% if post.templateContent %}{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) | dump | safe }}
+ {% else %}""{% endif %},
+ "date_published": "{{ post.date | rssDate }}"
+ }
+ {%- if not loop.last -%}
+ ,
+ {%- endif -%}
+{%- endfor %}
+]
+}
diff --git a/src/assets/manifest.njk b/src/assets/manifest.njk
new file mode 100644
index 0000000..cbdefea
--- /dev/null
+++ b/src/assets/manifest.njk
@@ -0,0 +1,30 @@
+---
+permalink: /app.webmanifest
+---
+{
+ "$schema": "https://json.schemastore.org/web-manifest-combined.json",
+ "name": "{{ metadata.title }}",
+
+ "lang": "en-GB",
+ "start_url": "{{ '/' | url }}",
+ "id": "{{ '/' | url }}",
+ "scope": "{{ '/' | url }}",
+ "display": "minimal-ui",
+ "background_color": "#8b0000",
+ "theme_color": "#8b0000",
+ "description": "{{ metadata.description }}",
+ "icons": [
+ {
+ "src": "{{ '/favicon/192.png' | url }}",
+ "type": "image/png",
+ "sizes": "192x192",
+ "purpose": "any"
+ },
+ {
+ "src": "{{ '/favicon/512.png' | url }}",
+ "type": "image/png",
+ "sizes": "512x512",
+ "purpose": "any"
+ }
+ ]
+}
diff --git a/src/assets/prism.css b/src/assets/prism.css
new file mode 100644
index 0000000..110c6be
--- /dev/null
+++ b/src/assets/prism.css
@@ -0,0 +1,162 @@
+code[class*="language-"],
+pre[class*="language-"] {
+ color: rgb(248 248 242);
+ background: none;
+ text-shadow: 0 1px rgb(0 0 0 / 30%);
+ font-family: monospace;
+ font-size: 1em;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+ word-break: normal;
+ word-wrap: normal;
+ line-height: 1.5;
+ tab-size: 4;
+ hyphens: none;
+
+ @media screen and (prefers-color-scheme: dark) {
+ code[class*="language-"],
+ pre[class*="language-"] {
+ color: #000;
+ text-shadow: 0 1px #fff;
+ }
+ }
+}
+
+/* Code blocks */
+
+pre[class*="language-"] {
+ padding: 1em;
+ margin: 0.5em 0;
+ overflow: auto;
+ border-radius: 0.3em;
+}
+
+:not(pre) > code[class*="language-"],
+pre[class*="language-"] {
+ background: rgb(39 40 34);
+
+ @media screen and (prefers-color-scheme: dark) {
+ background: rgb(245 242 240);
+ }
+}
+
+/* Inline code */
+
+:not(pre) > code[class*="language-"] {
+ padding: 0.1em;
+ border-radius: 0.3em;
+ white-space: normal;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+ color: rgb(130 146 162);
+
+ @media screen and (prefers-color-scheme: dark) {
+ color: rgb(112 128 144);
+ }
+}
+
+.token.punctuation {
+ color: rgb(248 248 242);
+
+ @media screen and (prefers-color-scheme: dark) {
+ color: rgb(153 0 85);
+ }
+}
+
+.token.namespace {
+ opacity: 0.7;
+}
+
+.token.property,
+.token.tag,
+.token.constant,
+.token.symbol,
+.token.deleted {
+ color: rgb(249 38 114);
+
+ @media screen and (prefers-color-scheme: dark) {
+ color: rgb(153 0 85);
+ }
+}
+
+.token.boolean,
+.token.number {
+ color: rgb(174 129 255);
+
+ @media screen and (prefers-color-scheme: dark) {
+ color: rgb(153 0 85);
+ }
+}
+
+.token.selector,
+.token.attr-name,
+.token.string,
+.token.char,
+.token.builtin,
+.token.inserted {
+ color: rgb(166 226 46);
+
+ @media screen and (prefers-color-scheme: dark) {
+ color: rgb(102 153 0);
+ }
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string,
+.token.variable {
+ color: rgb(248 248 242);
+
+ @media screen and (prefers-color-scheme: dark) {
+ color: rgb(154 110 58);
+ background: rgb(255 255 255 / 50%);
+ }
+}
+
+.token.atrule,
+.token.attr-value,
+.token.function,
+.token.class-name {
+ color: rgb(230 219 116);
+
+ @media screen and (prefers-color-scheme: dark) {
+ color: rgb(0 118 168);
+ }
+}
+
+.token.keyword {
+ color: rgb(102 217 239);
+
+ @media screen and (prefers-color-scheme: dark) {
+ color: rgb(221 75 104);
+ }
+}
+
+.token.regex,
+.token.important {
+ color: rgb(253 151 31);
+
+ @media screen (prefers-color-scheme: dark) {
+ color: rgb(238 153 0);
+ }
+}
+
+.token.important,
+.token.bold {
+ font-weight: bold;
+}
+
+.token.italic {
+ font-style: italic;
+}
+
+.token.entity {
+ cursor: help;
+}
diff --git a/src/robot.njk b/src/assets/robot.njk
index 79c49c0..dcaa728 100644
--- a/src/robot.njk
+++ b/src/assets/robot.njk
@@ -1,6 +1,5 @@
---
permalink: /robot.txt
-eleventyExcludeFromCollections: true
---
User-agent: *
Allow: /
diff --git a/src/sitemap.njk b/src/assets/sitemap.njk
index b2ff291..910b238 100644
--- a/src/sitemap.njk
+++ b/src/assets/sitemap.njk
@@ -1,6 +1,5 @@
---
permalink: /sitemap.xml
-eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
diff --git a/src/assets/sw.mjs b/src/assets/sw.mjs
new file mode 100644
index 0000000..78d659a
--- /dev/null
+++ b/src/assets/sw.mjs
@@ -0,0 +1,59 @@
+const sw_cache = {
+ offline: "/offline.html",
+ default: [
+ "/index.css",
+ "/prism.css",
+ "/index.js",
+ "/favicon/icon.svg",
+ "/offline.html",
+ "/"
+ ],
+ // eslint-disable-next-line no-undef
+ store: VERSION,
+}
+
+self.addEventListener('install', event => {
+ self.skipWaiting()
+ event.waitUntil((async() => {
+ const cache = await self.caches.open(sw_cache.store)
+ return cache.addAll(sw_cache.default)
+ })())
+})
+
+self.addEventListener('activate', event => {
+ event.waitUntil((async() => {
+ const keys = await self.caches.keys()
+ Promise.all(keys.map(key => {
+ if (key !== sw_cache.store) {
+ return self.caches.delete(key)
+ }
+ }))
+ })())
+})
+
+self.addEventListener('fetch', event => {
+ event.respondWith((async() => {
+ if (event.request.method != 'GET') {
+ return fetch(event.request)
+ }
+
+ const req_url = new URL(event.request.url)
+ if (req_url.origin != self.location.origin) {
+ return fetch(event.request)
+ }
+
+ const cacheres = await self.caches.match(event.request)
+ return cacheres || (async() => {
+ try {
+ const response = await self.fetch(event.request)
+ const cache = await self.caches.open(sw_cache.store)
+ cache.put(event.request, response.clone())
+ return response
+ } catch {
+ return self.caches.match(sw_cache.offline)
+ }
+ })()
+ })())
+
+
+}) \ No newline at end of file
diff --git a/src/blog.njk b/src/blog.njk
index d2ac3e7..9bd2a05 100644
--- a/src/blog.njk
+++ b/src/blog.njk
@@ -4,16 +4,16 @@ title: Blog
tags:
- navigator
---
-<ul style="list-style-type:none">
-{% for post in collections.posts %}
-<li>
- <h1>
- <a href="{{ post.url | url }}">{{ post.data.title }}</a>
- </h1>
- <small>
- <p>{{ metadata.author.name }} - {{ post.data.date | datefmt }}<p>
- </small>
- <p>{{ post.data.description }}<p>
-</li>
-{% endfor %}
-</ul>
+<div role="feed" aria-busy="false">
+ {% for post in collections.posts %}
+ <article aria-posinset="{{ loop.index }}" aria-setsize="{{ loop.size }}">
+ <h1>
+ <a href="{{ post.url | url }}">{{ post.data.title }}</a>
+ </h1>
+ <small>
+ <p>{{ metadata.author.name }} - {{ post.data.date | datefmt }}</p>
+ </small>
+ <p>{{ post.data.description }}</p>
+ </article>
+ {% endfor %}
+</div> \ No newline at end of file
diff --git a/src/css.11ty.js b/src/css.11ty.js
deleted file mode 100644
index 3a5b9df..0000000
--- a/src/css.11ty.js
+++ /dev/null
@@ -1,36 +0,0 @@
-const fs = require('fs')
-const path = require('path')
-const postcss = require('postcss')
-
-module.exports = class {
- async data() {
- return {
- inputs: [
- 'index.css',
- 'prism.css'
- ],
-
- pagination: {
- data: 'inputs',
- alias: 'inputfiles',
- size: 1
- },
-
- permalink: ({ inputfiles }) => `/${inputfiles}`,
-
- eleventyExcludeFromCollections: true
- }
- };
-
- async render({ inputfiles}) {
- const inputfile = path.join(__dirname, inputfiles);
- return await postcss([
- require('postcss-import'),
- require('autoprefixer'),
- ])
- .process(await fs.readFileSync(inputfile), {
- from: inputfile
- })
- .then(result => result.css)
- };
-}
diff --git a/src/data/env.js b/src/data/env.js
new file mode 100644
index 0000000..91842b4
--- /dev/null
+++ b/src/data/env.js
@@ -0,0 +1,3 @@
+const process = require("process")
+
+module.exports = () => process.env \ No newline at end of file
diff --git a/src/data/err.js b/src/data/err.js
new file mode 100644
index 0000000..0e3fe56
--- /dev/null
+++ b/src/data/err.js
@@ -0,0 +1,121 @@
+module.exports = [{
+ code: "offline",
+ msg: "The Page is offline"
+ },
+ {
+ code: 400,
+ msg: "Bad Request"
+ },
+ {
+ code: 401,
+ msg: "Unauthorized"
+ },
+ {
+ code: 402,
+ msg: "Payment Required"
+ },
+ {
+ code: 403,
+ msg: "Forbidden"
+ },
+ {
+ code: 404,
+ msg: "Not Found"
+ },
+ {
+ code: 405,
+ msg: "Method Not Allowed"
+ },
+ {
+ code: 406,
+ msg: "Not Acceptable"
+ },
+ {
+ code: 407,
+ msg: "Proxy Authentication Required"
+ },
+ {
+ code: 408,
+ msg: "Request Timeout"
+ },
+ {
+ code: 409,
+ msg: "Conflict"
+ },
+ {
+ code: 410,
+ msg: "Gone"
+ },
+ {
+ code: 411,
+ msg: "Length Required"
+ },
+ {
+ code: 412,
+ msg: "Precondition Failed"
+ },
+ {
+ code: 413,
+ msg: "Payload Too Large"
+ },
+ {
+ code: 414,
+ msg: "URI Too Long"
+ },
+ {
+ code: 415,
+ msg: "Unsupported Media Type"
+ },
+ {
+ code: 416,
+ msg: "Range Not Satisfiable"
+ },
+ {
+ code: 417,
+ msg: "Expectation Failed"
+ },
+ {
+ code: 418,
+ msg: "I\"m a teapot"
+ },
+ {
+ code: 421,
+ msg: "Misdirected Request"
+ },
+ {
+ code: 422,
+ msg: "Unprocessable Entity"
+ },
+ {
+ code: 423,
+ msg: "Locked"
+ },
+ {
+ code: 424,
+ msg: "Failed Dependency"
+ },
+ {
+ code: 425,
+ msg: "Too Early"
+ },
+ {
+ code: 426,
+ msg: "Upgrade Required"
+ },
+ {
+ code: 428,
+ msg: "Precondition Required"
+ },
+ {
+ code: 429,
+ msg: "Too Many Requests"
+ },
+ {
+ code: 431,
+ msg: "Request Header Fields Too Large"
+ },
+ {
+ code: 451,
+ msg: "Unavailable For Legal Reasons"
+ }
+] \ No newline at end of file
diff --git a/src/data/err.json b/src/data/err.json
deleted file mode 100644
index 87e3603..0000000
--- a/src/data/err.json
+++ /dev/null
@@ -1,166 +0,0 @@
-[
- {
- "code": "offline",
- "msg": "The Page is offline"
- },
- {
- "code": 400,
- "msg": "Bad Request"
- },
- {
- "code": 401,
- "msg": "Unauthorized"
- },
- {
- "code": 402,
- "msg": "Payment Required"
- },
- {
- "code": 403,
- "msg": "Forbidden"
- },
- {
- "code": 404,
- "msg": "Not Found"
- },
- {
- "code": 405,
- "msg": "Method Not Allowed"
- },
- {
- "code": 406,
- "msg": "Not Acceptable"
- },
- {
- "code": 407,
- "msg": "Proxy Authentication Required"
- },
- {
- "code": 408,
- "msg": "Request Timeout"
- },
- {
- "code": 409,
- "msg": "Conflict"
- },
- {
- "code": 410,
- "msg": "Gone"
- },
- {
- "code": 411,
- "msg": "Length Required"
- },
- {
- "code": 412,
- "msg": "Precondition Failed"
- },
- {
- "code": 413,
- "msg": "Payload Too Large"
- },
- {
- "code": 414,
- "msg": "URI Too Long"
- },
- {
- "code": 415,
- "msg": "Unsupported Media Type"
- },
- {
- "code": 416,
- "msg": "Range Not Satisfiable"
- },
- {
- "code": 417,
- "msg": "Expectation Failed"
- },
- {
- "code": 418,
- "msg": "I\"m a teapot"
- },
- {
- "code": 421,
- "msg": "Misdirected Request"
- },
- {
- "code": 422,
- "msg": "Unprocessable Entity"
- },
- {
- "code": 423,
- "msg": "Locked"
- },
- {
- "code": 424,
- "msg": "Failed Dependency"
- },
- {
- "code": 425,
- "msg": "Too Early"
- },
- {
- "code": 426,
- "msg": "Upgrade Required"
- },
- {
- "code": 428,
- "msg": "Precondition Required"
- },
- {
- "code": 429,
- "msg": "Too Many Requests"
- },
- {
- "code": 431,
- "msg": "Request Header Fields Too Large"
- },
- {
- "code": 451,
- "msg": "Unavailable For Legal Reasons"
- },
- {
- "code": 500,
- "msg": "Internal Server Error"
- },
- {
- "code": 501,
- "msg": "Not Implemented"
- },
- {
- "code": 502,
- "msg": "Bad Gateway"
- },
- {
- "code": 503,
- "msg": "Service Unavailable"
- },
- {
- "code": 504,
- "msg": "Gateway Timeout"
- },
- {
- "code": 505,
- "msg": "HTTP Version Not Supported"
- },
- {
- "code": 506,
- "msg": "Variant Also Negotiates"
- },
- {
- "code": 507,
- "msg": "Insufficient Storage"
- },
- {
- "code": 508,
- "msg": "Loop Detected"
- },
- {
- "code": 510,
- "msg": "Not Extended"
- },
- {
- "code": 511,
- "msg": "Network Authentication Required"
- }
-] \ No newline at end of file
diff --git a/src/data/metadata.js b/src/data/metadata.js
new file mode 100644
index 0000000..5d18f0d
--- /dev/null
+++ b/src/data/metadata.js
@@ -0,0 +1,16 @@
+module.exports = {
+ title: "Sudomsg",
+ url: "https://sudomsg.xyz/",
+ language: "en-GB",
+ description: "Messages from root",
+ feed: {
+ atom: "/feed.xml",
+ json: "/feed.json"
+ },
+ author: {
+ name: "Marc Pervaz Boocha",
+ email: "mboocha@sudomsg.xyz",
+ github: "https://github.com/marcthe12",
+ url: "https://sudomsg.xyz/about"
+ }
+} \ No newline at end of file
diff --git a/src/data/metadata.json b/src/data/metadata.json
deleted file mode 100644
index e2d7d6c..0000000
--- a/src/data/metadata.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "title": "Sudomsg",
- "url": "https://sudomsg.xyz/",
- "language": "en-GB",
- "description": "Messages from root",
- "feed": "/feed.xml",
- "author": {
- "name": "Marc Pervaz Boocha",
- "email": "mboocha@sudomsg.xyz",
- "url": "https://sudomsg.xyz/about"
- }
-}
diff --git a/src/data/navigator.js b/src/data/navigator.js
new file mode 100644
index 0000000..2081e7d
--- /dev/null
+++ b/src/data/navigator.js
@@ -0,0 +1,13 @@
+module.exports = [{
+ url: "/",
+ title: "Home"
+ },
+ {
+ url: "/blog/",
+ title: "Blog"
+ },
+ {
+ url: "/about/",
+ title: "About"
+ }
+] \ No newline at end of file
diff --git a/src/data/navigator.json b/src/data/navigator.json
deleted file mode 100644
index 5fb27a7..0000000
--- a/src/data/navigator.json
+++ /dev/null
@@ -1,14 +0,0 @@
-[
- {
- "url": "/",
- "title": "Home"
- },
- {
- "url": "/blog/",
- "title": "Blog"
- },
- {
- "url": "/about/",
- "title": "About"
- }
-]
diff --git a/src/index.css b/src/index.css
deleted file mode 100644
index a55d276..0000000
--- a/src/index.css
+++ /dev/null
@@ -1,62 +0,0 @@
-:root {
- font-family: sans-serif;
-}
-
-@media screen {
-
- body {
- max-width: 920px;
- margin: auto;
- padding: 0.5rem;
- }
-
- :any-link {
- color: inherit;
- text-decoration: underline;
- }
-
- .menu :any-link {
- text-decoration: inherit;
- }
-
- .menu ul {
- background: darkred;
- color: white;
- padding: 1rem;
- font-size: 1rem;
- }
-
- .menu li {
- display: inline;
- margin-right: 1rem;
- padding-left: 0rem;
- padding-right: 0rem;
- }
-
- .err {
- color: darkred;
- }
-
- @media (prefers-color-scheme: dark) {
- :root {
- background: black;
- color: white;
- }
-
- .menu ul {
- background: red;
- }
-
- .err {
- color: red;
- }
-
- }
-}
-
-@media print {
- header,nav,footer{
- display:none;
- }
-}
-
diff --git a/src/js.11ty.js b/src/js.11ty.js
deleted file mode 100644
index b4b04c7..0000000
--- a/src/js.11ty.js
+++ /dev/null
@@ -1,35 +0,0 @@
-const fs = require('fs')
-const path = require('path')
-const postcss = require('postcss')
-
-module.exports = class {
- async data() {
- return {
- inputs: [
- ],
-
- pagination: {
- data: 'inputs',
- alias: 'inputfiles',
- size: 1
- },
-
- permalink: ({ inputfiles }) => `/${inputfiles}.css`,
-
- eleventyExcludeFromCollections: true
- }
- };
-
- async render({ inputfiles}) {
- const inputfile = path.join(__dirname, inputfiles);
- return await postcss([
- require('postcss-import'),
- require('autoprefixer'),
- require('cssnano')
- ])
- .process(await fs.readFileSync(inputfile), {
- from: inputfile
- })
- .then(result => result.css)
- };
-}
diff --git a/src/layouts/base.njk b/src/layouts/base.njk
index c7c33ab..204a4f1 100644
--- a/src/layouts/base.njk
+++ b/src/layouts/base.njk
@@ -1,30 +1,46 @@
<!DOCTYPE html>
<html lang="en-GB">
<head>
- <meta charset="utf-8">
+ <meta charset="utf-8"/>
+ <meta property="og:locale" content="en_GB"/>
<title>{{ title or metadata.title }}</title>
- <meta name="author" content="{{ metadata.author.name }}">
- <meta name="description" content="{{ description or metadata.description }}">
- <meta name="generator" contents="eleventy">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link async rel="icon" href="{{ '/favicon.svg' | url }}" type="image/svg+xml">
- <link rel="alternate" href="{{ metadata.feed | url }}" type="application/atom+xml" title="{{ metadata.title }}">
+ <meta property="og:title" content="{{ title or metadata.title }}"/>
+ <meta property="og:site_name" content="{{ metadata.title }}"/>
+ <meta name="author" content="{{ metadata.author.name }}"/>
+ <meta name="description" content="{{ description or metadata.description }}"/>
+ <meta property="og:description" content="{{ description or metadata.description }}"/>
+ <meta name="keywords" contents="{{ keywords }}"/>
+ <meta name="generator" contents="eleventy"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1"/>
+ <meta name="twitter:card" content="summary"/>
+ <meta property="og:url" content="{{ page.url | url | absoluteUrl(metadata.url) }}"/>
<link rel="canonical" href="{{ page.url | url | absoluteUrl(metadata.url) }}"/>
+ <link rel="alternate" href="{{ metadata.feed.atom | url }}" type="application/atom+xml" title="{{ metadata.title }}"/>
+ <link rel="alternate" href="{ metadata.feed.json | url }" type="application/feed+json" title="{{ metadata.title }}"/>
+ <link rel="icon" href="{{ '/favicon.ico' | url }}" sizes="any"/>
+ <link rel="icon" href="{{ '/favicon/icon.svg' | url }}" type="image/svg+xml"/>
+ <link rel="apple-touch-icon" href="{{ '/favicon/192.png' | url }}"/>
+ <link rel="manifest" href="{{ '/app.webmanifest' | url }}" crossorigin="use-credentials"/>
+ <meta name="theme-color" content="#8b0000"/>
<link as="style" href="{{ '/index.css' | url }}" rel="stylesheet"/>
- <link as="style" href="{{ '/prism.css' | url }}" rel="stylesheet">
+ {% if syntaxhighlight %}<link as="style" href="{{ '/prism.css' | url }}" rel="stylesheet"/>{% endif %}
+ <script type="module" src="{{ '/index.js' | url }}"></script>
</head>
<body>
- <header>
- <nav class="menu"><ul>
- {% for nav in navigator %}
- <li><a href="{{ nav.url | url }}">{{ nav.title }}</a></li>
- {% endfor %}
- </ul></nav>
- </header>
- <main>
- {{ content | safe }}
- </main>
- <script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "b70b2446607f42a4a139dea42210880e"}'></script>
+ <header>
+ <nav>
+ <a href="#" id="nav-toogle">Sudomsg</a>
+ {% for nav in navigator %}
+ <a class="navlinks" href="{{ nav.url | url }}">{{ nav.title }}</a>
+ {% endfor %}
+ </nav>
+ </header>
+ <main>
+ {{ content | safe }}
+ </main>
+ <footer>
+ Subscribe: <a href="{{ metadata.feed.atom | url }}" >RSS</a>
+ <a href="{{ metadata.feed.json | url }}" >JSON</a>
+ </footer>
</body>
-</html>
-
+</html> \ No newline at end of file
diff --git a/src/layouts/post.njk b/src/layouts/post.njk
index b2eb5e5..f8a4aee 100644
--- a/src/layouts/post.njk
+++ b/src/layouts/post.njk
@@ -6,7 +6,7 @@ tags:
<article>
<h1>{{ title }}</h1>
<small>
- <time datetime="{{ date | datefmt }}">{{ date | datefmt }}</time> - {{ metadata.author.name }}
+ <time datetime="{{ date | datefmt }}">{{ date | datefmt }}</time> - <a href="{{ metadata.author.url }}">{{ metadata.author.name }}</a>
</small>
{{ content | safe }}
-</article>
+</article> \ No newline at end of file
diff --git a/src/post/hello_world.md b/src/post/hello_world.md
deleted file mode 100644
index 923ad0b..0000000
--- a/src/post/hello_world.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Hello World
-description: The First Post to the World
-date: 2021-09-12
----
-This is the first post on my blog.
-
-Eleventy is super fresh init.
diff --git a/src/post/post.11tydata.js b/src/post/post.11tydata.js
new file mode 100644
index 0000000..68f56d2
--- /dev/null
+++ b/src/post/post.11tydata.js
@@ -0,0 +1,8 @@
+const slugify = require("@sindresorhus/slugify")
+
+module.exports = () => ({
+ layout: "post.njk",
+ eleventyComputed: {
+ permalink: data => `/posts/${slugify(data.title)}/`
+ }
+}) \ No newline at end of file
diff --git a/src/post/post.json b/src/post/post.json
deleted file mode 100644
index 60ff6df..0000000
--- a/src/post/post.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "layout": "post.njk"
-} \ No newline at end of file
diff --git a/src/prism.css b/src/prism.css
deleted file mode 100644
index 431fe8a..0000000
--- a/src/prism.css
+++ /dev/null
@@ -1,130 +0,0 @@
-code[class*="language-"],pre[class*="language-"] {
- color: #f8f8f2;
- background: none;
- text-shadow: 0 1px rgba(0, 0, 0, 0.3);
- font-family: monospace;
- font-size: 1em;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- word-wrap: normal;
- line-height: 1.5;
- tab-size: 4;
- hyphens: none;
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
- border-radius: 0.3em;
-}
-
-:not(pre) > code[class*="language-"],pre[class*="language-"] {
- background: #272822;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
- white-space: normal;
-}
-
-.token.comment,.token.prolog,.token.doctype,.token.cdata {
- color: #8292a2;
-}
-
-.token.punctuation {
- color: #f8f8f2;
-}
-
-.token.namespace {
- opacity: .7;
-}
-
-.token.property,.token.tag,.token.constant,.token.symbol,.token.deleted {
- color: #f92672;
-}
-
-.token.boolean,.token.number {
- color: #ae81ff;
-}
-
-.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted {
- color: #a6e22e;
-}
-
-.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string,.token.variable {
- color: #f8f8f2;
-}
-
-.token.atrule,.token.attr-value,.token.function,.token.class-name {
- color: #e6db74;
-}
-
-.token.keyword {
- color: #66d9ef;
-}
-
-.token.regex,.token.important {
- color: #fd971f;
-}
-
-.token.important,
-.token.bold {
- font-weight: bold;
-}
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-
-@media screen and (prefers-color-scheme: dark){
- code[class*="language-"],pre[class*="language-"] {
- color: black;
- text-shadow: 0 1px white;
- }
-
- :not(pre) > code[class*="language-"], pre[class*="language-"] {
- background: #f5f2f0;
- }
-
- .token.comment,.token.prolog,.token.doctype,.token.cdata {
- color: slategray;
- }
-
- .token.punctuation {
- color: #999;
- }
-
- .token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted {
- color: #905;
- }
-
- .token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted {
- color: #690;
- }
-
- .token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string {
- color: #9a6e3a;
- background: hsla(0, 0%, 100%, .5);
- }
-
- .token.atrule,.token.attr-value,.token.keyword {
- color: #07a;
- }
-
- .token.function,.token.class-name {
- color: #DD4A68;
- }
-
- .token.regex,.token.important,.token.variable {
- color: #e90;
- }
-} \ No newline at end of file