Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit c0d0c88

Browse files
committed
Initial commit
0 parents  commit c0d0c88

31 files changed

+750
-0
lines changed

.eleventy.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
const yaml = require("js-yaml");
2+
const { DateTime } = require("luxon");
3+
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
4+
const htmlmin = require("html-minifier");
5+
6+
module.exports = function (eleventyConfig) {
7+
// Disable automatic use of your .gitignore
8+
eleventyConfig.setUseGitIgnore(false);
9+
10+
// Merge data instead of overriding
11+
eleventyConfig.setDataDeepMerge(true);
12+
13+
// human readable date
14+
eleventyConfig.addFilter("readableDate", (dateObj) => {
15+
return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat(
16+
"dd LLL yyyy"
17+
);
18+
});
19+
20+
// Syntax Highlighting for Code blocks
21+
eleventyConfig.addPlugin(syntaxHighlight);
22+
23+
// To Support .yaml Extension in _data
24+
// You may remove this if you can use JSON
25+
eleventyConfig.addDataExtension("yaml", (contents) => yaml.load(contents));
26+
27+
// Copy Static Files to /_Site
28+
eleventyConfig.addPassthroughCopy({
29+
"./src/admin/config.yml": "./admin/config.yml",
30+
"./node_modules/alpinejs/dist/cdn.min.js": "./static/js/alpine.js",
31+
"./node_modules/prismjs/themes/prism-tomorrow.css":
32+
"./static/css/prism-tomorrow.css",
33+
});
34+
35+
// Copy Image Folder to /_site
36+
eleventyConfig.addPassthroughCopy("./src/static/img");
37+
38+
// Copy favicon to route of /_site
39+
eleventyConfig.addPassthroughCopy("./src/favicon.ico");
40+
41+
// Minify HTML
42+
eleventyConfig.addTransform("htmlmin", function (content, outputPath) {
43+
// Eleventy 1.0+: use this.inputPath and this.outputPath instead
44+
if (outputPath.endsWith(".html")) {
45+
let minified = htmlmin.minify(content, {
46+
useShortDoctype: true,
47+
removeComments: true,
48+
collapseWhitespace: true,
49+
});
50+
return minified;
51+
}
52+
53+
return content;
54+
});
55+
56+
// Let Eleventy transform HTML files as nunjucks
57+
// So that we can use .html instead of .njk
58+
return {
59+
dir: {
60+
input: "src",
61+
},
62+
htmlTemplateEngine: "njk",
63+
};
64+
};

.eleventyignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
README.md

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github: surjithctly
2+
open_collective: surjithctly
3+
patreon: surjithctly
4+
custom: https://paypal.me/surjithctly

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
_site/
2+
_tmp/
3+
.DS_Store
4+
node_modules/
5+
.vscode/
6+
*git/
7+
package-lock.json
8+
.env
9+
10+
# Local Netlify folder
11+
.netlify

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 SURJITH S M
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Neat Starter
2+
3+
Starter Template for Static CMS, Eleventy, Alpine JS & Tailwind CSS
4+
5+
### Technologies used:
6+
7+
- [Static CMS](https://staticjscms.netlify.app/)
8+
- [Eleventy](https://www.11ty.dev/)
9+
- [Alpine.js](https://github.com/alpinejs/alpine)
10+
- [Tailwind CSS](https://tailwindcss.com/)
11+
12+
13+
<a href="https://app.netlify.com/start/deploy?repository=https://github.com/StaticJsCMS/static-cms-eleventy-netlify-template&amp;stack=cms"><img src="https://www.netlify.com/img/deploy/button.svg" alt="Deploy to Netlify" /></a>
14+
15+
### 1\. Clone this Repository
16+
17+
```
18+
git clone https://github.com/StaticJsCMS/static-cms-eleventy-netlify-template.git
19+
```
20+
21+
### 2\. Navigate to the directory
22+
23+
```
24+
cd static-cms-eleventy-netlify-template
25+
```
26+
27+
### 3\. Install dependencies
28+
29+
```
30+
npm install
31+
```
32+
33+
### 4\. Build the project to generate the first CSS
34+
35+
This step is only required the very first time.
36+
37+
```
38+
npm run build
39+
```
40+
41+
### 5\. Run Eleventy
42+
43+
```
44+
npm run start
45+
```

netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build]
2+
publish = "_site"
3+
command = "npm run build"

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"scripts": {
3+
"start": "npm-run-all --parallel css eleventy browsersync",
4+
"eleventy": "eleventy --watch",
5+
"debug": "set DEBUG=* & eleventy",
6+
"css": "postcss src/static/css/tailwind.css --o _site/static/css/style.css --watch",
7+
"build": "cross-env NODE_ENV=production eleventy && cross-env NODE_ENV=production tailwindcss -i src/static/css/tailwind.css -o _site/static/css/style.css",
8+
"browsersync": "browser-sync start --server _site --files _site --port 8080 --no-notify --no-open"
9+
},
10+
"devDependencies": {
11+
"@11ty/eleventy": "^1.0.0",
12+
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.3",
13+
"@tailwindcss/typography": "^0.5.0",
14+
"alpinejs": "^3.7.1",
15+
"browser-sync": "^2.27.7",
16+
"cross-env": "^7.0.3",
17+
"cssnano": "^5.0.15",
18+
"html-minifier": "^4.0.0",
19+
"js-yaml": "^4.1.0",
20+
"luxon": "^2.3.0",
21+
"npm-run-all": "^4.1.5",
22+
"postcss-cli": "^9.1.0",
23+
"prismjs": "^1.26.0",
24+
"tailwindcss": "^3.0.13"
25+
},
26+
"dependencies": {
27+
"autoprefixer": "^10.4.2",
28+
"postcss": "^8.4.5"
29+
}
30+
}

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

src/_data/navigation.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
items:
3+
- text: Menu One
4+
url: "#"
5+
- text: Menu Two
6+
url: "#"
7+
- text: Menu Three
8+
url: "#"
9+
- text: Blog
10+
url: "/blog"

0 commit comments

Comments
 (0)