Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
semanticdata authored Feb 6, 2024
0 parents commit d82a768
Show file tree
Hide file tree
Showing 16 changed files with 9,292 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const dayjs = require("dayjs");

module.exports = function (config) {
// Pass-through images
config.addPassthroughCopy("./_site/images");

// Add Date filters
config.addFilter("date", (dateObj) => {
return dayjs(dateObj).format("MMMM D, YYYY");
});

config.addFilter("sitemapDate", (dateObj) => {
return dayjs(dateObj).toISOString();
});

config.addFilter("year", () => {
return dayjs().format("YYYY");
});

// Add pages collection
config.addCollection("pages", function (collections) {
return collections.getFilteredByTag("page").sort(function (a, b) {
return a.data.order - b.data.order;
});
});

return {
markdownTemplateEngine: "njk",
dir: {
input: "_site",
data: "_data",
includes: "_includes",
layouts: "_layouts",
output: "dist",
},
};
};
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# package directories
node_modules
jspm_packages
dist
.DS_Store
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/jeremydaly/eleventy-tailwind-template)

# Starter template for building Eleventy static sites with Tailwind CSS

1. Clone the repo
2. Run `npm install`
3. Run `npm start`

![Screenshot](https://user-images.githubusercontent.com/2053544/148869250-271d81fb-ea64-491a-b811-619d22ca3e25.png)
9 changes: 9 additions & 0 deletions _site/_data/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"siteTitle": "My Eleventy Site with Tailwind CSS",
"url": "https://example.com",
"description": "This is a default template for Eleventy with TailwindCSS",
"keywords": "eleventy, 11ty, tailwind, tailwindcss, css, ssg",
"image": "https://www.11ty.dev/img/built/IdthKOzqFA-350.avif",
"twitter": "@jeremy_daly",
"card": "summary"
}
9 changes: 9 additions & 0 deletions _site/_includes/navigation.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<ul class="text-center py-10 text-lg">
{%- for item in collections.pages -%}
{% if page.url != item.url %}
<li>
<a href="{{ item.url }}">{{ item.data.title }}</a>
</li>
{% endif %}
{%- endfor -%}
</ul>
53 changes: 53 additions & 0 deletions _site/_layouts/base.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!doctype html>
<html lang="en" dir="ltr">
<head>
<link rel="canonical" href="{{ config.url }}{{ page.url }}">
<link rel="stylesheet" href="/css/styles.css" />

<title>{% if title and title != 'Home' %}{{title}} - {% endif %}{{ config.siteTitle }}</title>

<!-- Icons -->
<link rel="shortcut icon" type="image/png" href="/images/x16-favicon.png" sizes="16x16" />
<link rel="shortcut icon" type="image/png" href="/images/x32-favicon.png" sizes="32x32" />
<link rel="shortcut icon" type="image/png" href="/images/x64-favicon.png" sizes="64x64" />
<link rel="shortcut icon" type="image/png" href="/images/x256-favicon.png" sizes="256x256" />
<link rel="apple-touch-icon" type="image/png" href="/images/x256-favicon.png" />

<!-- Meta -->
<meta name="description" content="{% if description %}{{ description }}{% else %}{{ config.description }}{% endif %}">
<meta name="keywords" content="{% if keywords %}{{ keywords }}{% else %}{{ config.keywords }}{% endif %}">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Language" content="en">
<meta name="viewport" content="width=device-width,initial-scale=1">

<!-- Facebook -->
<meta property="og:title" content="{% if (title != 'Home') %}{{title}} - {% endif %}{{ config.siteTitle }}">
<meta property="og:type" content="website">
<meta property="og:description" content="{% if description %}{{ description }}{% else %}{{ config.description }}{% endif %}">
<meta property="og:url" content="{{ config.url }}{{ page.url }}">
<meta property="og:image" content="{% if image %}{{ image }}{% else %}{{ config.image }}{% endif %}">

<!-- Twitter -->
<meta name="twitter:card" content="{{ card }}">
<meta name="twitter:site" content="{{ twitter }}">
<meta name="twitter:title" content="{% if (title != 'Home') %}{{title}} - {% endif %}{{ config.siteTitle }}">
<meta name="twitter:description" content="{% if description %}{{ description }}{% else %}{{ config.description }}{% endif %}">
<meta name="twitter:creator" content="{{ twitter }}">
<meta name="twitter:image" content="{{ config.url }}{{ page.url }}">
<meta name="twitter:domain" content="{% if image %}{{ image }}{% else %}{{ config.image }}{% endif %}">

</head>
<body>
<header>
</header>
<div>
{{ content | safe }}
</div>

<footer class="mt-0 text-center text-base text-gray-500">
<p>&copy; {{ '' | year }} - <a href="{{ config.url }}">{{ config.siteTitle }}</a> | <a href="/sitemap.xml" class="text-indigo-500">Site Map</a></p>
<p class="pt-1 text-sm">Made with ❤️ by <a href="https://twitter.com/jeremy_daly" target="_blank" class="text-pink-500">Jeremy Daly</a></p>
</footer>
</body>
</html>
5 changes: 5 additions & 0 deletions _site/_layouts/home.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: base
---

{{ content | safe }}
10 changes: 10 additions & 0 deletions _site/_layouts/sitemap.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for item in collections.page %}
<url>
<loc>{{ config.url }}{{ item.url }}</loc>
<lastmod>{{ item.data.modified | sitemapDate }}</lastmod>
<priority>{% if item.url == '/' %}1.0{% else %}0.8{% endif %}</priority>
</url>
{% endfor %}
</urlset>
10 changes: 10 additions & 0 deletions _site/css/styles.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

a {
@apply text-purple-500 font-medium;
}
a:hover {
@apply underline;
}
23 changes: 23 additions & 0 deletions _site/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Home
layout: home
tags: page
modified: 2022-01-09 00:00:00
order: 1
---

<h1 class="pt-24 pb-6 text-center">
<span class="text-8xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500">
Hello world!
</span>
</h1>
<h2 class="pb-12 text-4xl font-bold text-center text-gray-500">
{{ config.siteTitle }}
</h2>

<div class="container max-w-lg mx-auto text-xl text-center">
<p>Starter template for building <a href="https://www.11ty.dev/" target="_blank">Eleventy</a> static sites with <a href="https://tailwindcss.com/" target="_blank">Tailwind CSS</a> automatically generating the corresponding styles and writing them to a static CSS file.</p>
<p class="pt-3"><a href="https://github.com/jeremydaly/eleventy-tailwind-template#readme" class="text-2xl text-transparent bg-clip-text bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500">View the README</a></p>
</div>

{% include "navigation.njk" %}
4 changes: 4 additions & 0 deletions _site/sitemap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
permalink: /sitemap.xml
layout: sitemap
---
18 changes: 18 additions & 0 deletions _site/subpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: This is a subpage
layout: base
tags: page
modified: 2022-01-09 00:00:00
order: 2
---

<h1 class="pt-24 pb-6 text-center">
<span class="text-8xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500">
This is a subpage!
</span>
</h1>
<h2 class="pb-12 text-4xl font-bold text-center text-gray-500">
{{ config.siteTitle }}
</h2>

{% include "navigation.njk" %}
Loading

0 comments on commit d82a768

Please sign in to comment.