Skip to content

Commit

Permalink
🚀 initial commit
Browse files Browse the repository at this point in the history
Initial Commit
  • Loading branch information
adamdjbrett committed Nov 10, 2024
1 parent 6c91ce5 commit 061ac73
Show file tree
Hide file tree
Showing 45 changed files with 861 additions and 2 deletions.
Binary file added .DS_Store
Binary file not shown.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
Empty file added .nojekyll
Empty file.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Adam DJ Brett
Copyright (c) 2017–2023 Zach Leatherman @zachleat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# 11covers-theme
# 11ty Cover Theme
A hopefully stylish 11ty **minor** update to the common cover card theme type. This 11ty theme is based on:
1. [Front Cover Jekyll Theme](https://github.com/dashingcode/front-cover) by [@dashingcode](https://github.com/dashingcode/front-cover)
2. [@epidrome's cover-card Fork of Front Cover Jekyll Theme](https://github.com/epidrome/cover-card) by [@epidrome](https://github.com/epidrome/cover-card)
3. [Eleventy Base Blog Starter Project](https://github.com/11ty/eleventy-base-blog)

## Credits
1. Adam DJ Brett
2. [Creative by Dre](https://www.creativitas.dev/)

## Image Credits
- Profile Avatar by This Person Does Not Exist
- Background photo NASA/JPL-Caltech, October 30, 2013

## Setup

### eleventy.config.js
in `eleventy.config.js` go to metadata and personalize lines 64-73. Keep it short and simple

### Metadata.js
the majority of the personalization changes you will need to make will be to `metadata.js`

### Font Awesome
Once you have finished your modifications to `metadata.js` visit [Font Awesome](https://fontawesome.com/) and
1. create a free account
2. create a free or paid [Font Kit](https://fontawesome.com/kits)
3. Once you have created your font kit paste the code to `base.njk` layout line 38

### humans.njk
Now update humans.njk and give credit to all of the folks who have helepd to make your site an dlet everyone know that a real human built your site and not AI.

### Publication
Once you have completed all of these steps now you are ready to publish your site to Cloudflare Pages, Github Pages, Netlify, Vercel, Surge, Render, or your prefered static site hosting provider.

40 changes: 40 additions & 0 deletions _config/filters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { DateTime } from "luxon";

export default function(eleventyConfig) {
eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => {
// Formatting tokens for Luxon: https://moment.github.io/luxon/#/formatting?id=table-of-tokens
return DateTime.fromJSDate(dateObj, { zone: zone || "utc" }).toFormat(format || "dd LLLL yyyy");
});

eleventyConfig.addFilter("htmlDateString", (dateObj) => {
// dateObj input: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat('yyyy-LL-dd');
});

// Get the first `n` elements of a collection.
eleventyConfig.addFilter("head", (array, n) => {
if(!Array.isArray(array) || array.length === 0) {
return [];
}
if( n < 0 ) {
return array.slice(n);
}

return array.slice(0, n);
});

// Return the smallest number argument
eleventyConfig.addFilter("min", (...numbers) => {
return Math.min.apply(null, numbers);
});

// Return the keys used in an object
eleventyConfig.addFilter("getKeys", target => {
return Object.keys(target);
});

eleventyConfig.addFilter("filterTagList", function filterTagList(tags) {
return (tags || []).filter(tag => ["all", "posts"].indexOf(tag) === -1);
});

};
13 changes: 13 additions & 0 deletions _data/eleventyDataSchema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { z } from "zod";
import { fromZodError } from 'zod-validation-error';

export default function(data) {
// Draft content, validate `draft` front matter
let result = z.object({
draft: z.boolean().or(z.undefined()),
}).safeParse(data);

if(result.error) {
throw fromZodError(result.error);
}
}
71 changes: 71 additions & 0 deletions _data/metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
export default {
title: "Kathryn Janeway",
url: "https://cover.000000076.xyz",
language: "en",
locale: "en-US",
description: "Captain of the Intrepid-class USS Voyager in 2371",
avatar: "/img/avatar.jpg",
cover: "/img/witch-head-brews-baby-stars-1920x1152.jpg",
github_username: "11ty",
favicon: "/img/favicon.png",
twitter_username: "eleven_ty",
facebook_username: "eleven_ty",
facebook_appid: "",
footer: {
copyrights: "MIT License/CC BY 4.0 License",
text_link: "Kathryn Janeway",
url: "https://en.wikipedia.org/wiki/Kathryn_Janeway"
},
author: {
name: "Kathryn Janeway",
email: "info@example.com",
url: "Kathryn Janeway"
},
social: [
{
icon: "globe",
description: "Main website",
link: "https://www.11ty.dev"
},
{
icon: "github",
description: "Follow 11ty on Github",
link: "https://github.com/11ty/eleventy/"
},
{
icon: "mastodon",
description: "11ty on Mastodon",
link: "https://fosstodon.org/@eleventy"
},
{
icon: "bluesky",
description: "11ty on Bluesky",
link: "https://bsky.app/profile/11ty.dev"
},
{
icon: "youtube",
description: "11ty on YouTube",
link: "https://www.youtube.com/c/EleventyVideo"
}, {
icon: "discord",
description: "11ty on Discord",
link: "https://www.11ty.dev/blog/discord/"
},
{
icon: "twitter",
description: "11ty on Twitter",
link: "https://twitter.com/leven_ty"
},
{
icon: "codepen",
description: "11ty Codepen",
link: "https://codepen.io/search/pens?q=11ty"
},
{
icon: "tags",
description: "11ty Blogs",
link: "https://www.11ty.dev/blog/"
}
]

}
Binary file added _includes/.DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions _includes/fa.njk

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions _includes/layouts/404.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="{{site.og_locale}}">
<head>
<meta charset="utf-8">
<title>{{site.title}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/css/404.css">
<link rel="stylesheet" href="/css/index.css">
<link rel="stylesheet" href="/css/main.css">
</head>
<body>
<h1>Page Not Found</h1>
<p><a href="/" title="{{site.title}}" rel="noopener">⬅︎ Return Home</a>.</p>
<p>&nbsp;</p>
<footer>Built with <a href="http://11ty.dev" rel="noopener">Eleventy</a>.</footer>
</body>
</html>
59 changes: 59 additions & 0 deletions _includes/layouts/base.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!doctype html>
<html lang="{{ metadata.language }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title or metadata.title }}</title>
<meta name="description" content="{{ description or metadata.description }}">
<link rel="alternate" href="feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}">
<link rel="canonical" href="{{metadata.url}}">
{% if site.favicon_img %}
<link rel="shortcut icon" href="{{metadata.favicon}}" />
{% endif %}
<meta name="twitter:title" content="{{metadata.title}}">
<meta name="twitter:description" content="{{ metadata.description }}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ metadata.avatar }}">
<meta name="twitter:site" content="@{{ site.twitter_username }}">
<meta name="twitter:creator" content="@{{ site.twitter_username }}">
<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="{{metadata.title}}">
<meta property="og:description" content="{{ metadata.description }}">
<meta property="og:url" content="{{ site.url }}">
<meta property="fb:admins" content="{{ site.facebook_username }}"/>
<meta property="fb:app_id" content="{{ site.facebooK_appid }}"/>
<meta property="og:site_name" content="{{ metadata.title }}">
<meta property="og:image" content="{{ metadata.avatar }}">
<meta property="og:image" content="{{metadata.avatar}}" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="1920" />
<meta property="og:image:height" content="1080" />
<meta property="og:image:alt" content="{{metadata.title}}" />
<meta name="generator" content="{{ eleventy.generator }}">
{% include "fa.njk" %}
<link rel="stylesheet" href="/css/404.css">
<link rel="stylesheet" href="/css/index.css">
<link rel="stylesheet" href="/css/main.css">
<script src="https://kit.fontawesome.com/f7bad4bd2f.js"></script>
<link rel="dns-prefetch" href="https://kit.fontawesome.com/" />
</head>
<body>
<div class="content">
{% if metadata.cover %}<img src="{{metadata.cover}}" alt="{{metadata.title}}" id="fullscreen">{% endif %}
{% if metadata.avatar %}<img src="{{metadata.avatar}}" alt="{{metadata.title}}" id="avatar">{% endif %}
<h1>{{metadata.title}}</h1><br/>
<h3>{{metadata.description}}</h3>
</div>
<ul>
{% for s in metadata.social %}
<li>
<a class="fa fa-2x fa-{{s.icon}}" href="{{s.link}}" aria-hidden="true">
<span class="description">{{s.description}}</span>
</a>
</li>
{% endfor %}
</ul>
<p class="footer-text">{% if metadata.footer.copyrights %}{{metadata.footer.copyrights}}{% endif %} {% if metadata.footer.text_link %}<a class="des" href="{{metadata.footer.url}}">{{metadata.footer.text_link}}</a>{% endif %} , Powered by <a class="des" href="https://11ty.dev">11ty</a></p>
</body>
</html>
5 changes: 5 additions & 0 deletions _includes/layouts/home.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: layouts/base.njk
---

{{ content | safe }}
Binary file added content/.DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions content/404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
layout: layouts/404.njk
permalink: 404.html
eleventyExcludeFromCollections: true
---
# Content not found.

Go <a href="index.njk">home</a>.

<!--
Read more: https://www.11ty.dev/docs/quicktips/not-found/
This will work for both GitHub pages and Netlify:
* https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/
* https://www.netlify.com/docs/redirects/#custom-404
-->
3 changes: 3 additions & 0 deletions content/content.11tydata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
layout: "layouts/home.njk",
};
1 change: 1 addition & 0 deletions content/feed/.virtual
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For RSS feed, Atom Feed, and JSON feed templates, see the plugin in eleventy.config.js
89 changes: 89 additions & 0 deletions content/feed/pretty-atom-feed.xsl

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions content/humans.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
permalink: /humans.txt
eleventyExcludeFromCollections: true
layout: null
date: Last Modified
---

/* WHO */

Adam DJ Brett
Website: adamdjbrett.com
Twitter: @__adjb
From: Syracuse, NY, USA

Creative by Dre
website: https://www.creativitas.dev/

/* THANKS */

Eleventy Creator: Zachleat
Twitter: @zachleat


/* Credits */

Static Site Generator: Eleventy
Twitter: @eleven_ty
Website: 11ty.dev

Eleventy Base Blog Starter Project
Website: https://github.com/11ty/eleventy-base-blog

Front Cover Jekyll Theme
Website: https://github.com/dashingcode/front-cover

@epidrome cover-card theme fork
Website: https://github.com/epidrome/cover-card


/* SITE */

Last update: {{ page.date }}
Language: English
Generator: Eleventy
Theme: Front Cover Theme
Fonts: Font-Awesome
Doctype: HTML5
IDE: Terminal, VS Code
Binary file added content/img/avatar.jpg
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 content/img/favicon.ico
Binary file not shown.
Binary file added content/img/web-design-g871abf5a4_1920.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added content/index.njk
Empty file.
10 changes: 10 additions & 0 deletions content/robots.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
permalink: /robots.txt
eleventyExcludeFromCollections: true
---
# Allow crawling of all content
User-agent: *
Allow: /
Disallow: /googlebfdcfddbdbfcbd99.html

Sitemap: {{ site.url }}/sitemap.xml
23 changes: 23 additions & 0 deletions content/site.webmanifest.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
permalink: /site.webmanifest
eleventyExcludeFromCollections: true
---
{
"name": "{{metadata.title}}",
"short_name": "{{metadata.github_username}}",
"icons": [
{
"src": "/img/favicon/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/img/favicon/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
15 changes: 15 additions & 0 deletions content/sitemap.xml.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
permalink: /sitemap.xml
layout: false
eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{%- for page in collections.all %}
{% set absoluteUrl %}{{ page.url | htmlBaseUrl(metadata.url) }}{% endset %}
<url>
<loc>{{ absoluteUrl }}</loc>
<lastmod>{{ page.date | htmlDateString }}</lastmod>
</url>
{%- endfor %}
</urlset>
Loading

0 comments on commit 061ac73

Please sign in to comment.