generated from jeremydaly/eleventy-tailwind-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d82a768
Showing
16 changed files
with
9,292 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# package directories | ||
node_modules | ||
jspm_packages | ||
dist | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[](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` | ||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>© {{ '' | 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: base | ||
--- | ||
|
||
{{ content | safe }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
permalink: /sitemap.xml | ||
layout: sitemap | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" %} |
Oops, something went wrong.