Template
Compare commits
14
Commits
3b22f8dab9
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
500bf7b7a2 | ||
|
|
154d735555 | ||
|
|
dcbf9ade39 | ||
|
|
8e303c0c29 | ||
|
|
b339e45499 | ||
|
|
303af97c61 | ||
|
|
80d1df8600 | ||
|
|
1c633b7a3e | ||
|
|
1aa210caeb | ||
|
|
218baa9539 | ||
|
|
9f321024cf | ||
|
|
9a9ad5133e | ||
|
|
8201b368ed | ||
|
|
03e85bcb35 |
No files matched your search
+25
@@ -0,0 +1,25 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: node:current
|
||||||
|
environment:
|
||||||
|
REPOSITORY: <dest-repo>
|
||||||
|
GIT_USER: <username>
|
||||||
|
GIT_TOKEN:
|
||||||
|
from_secret: GIT_TOKEN
|
||||||
|
commands:
|
||||||
|
- git config credential.helper '!f() { echo username=$GIT_USER; echo "password=$GIT_TOKEN"; };f'
|
||||||
|
- git submodule update --remote --init --merge
|
||||||
|
- npm install
|
||||||
|
- npm run build
|
||||||
|
- apt-get update && apt-get install -y rsync
|
||||||
|
- rsync -uavh _site/ $REPOSITORY --delete --exclude .git
|
||||||
|
- cd $REPOSITORY
|
||||||
|
- git checkout main
|
||||||
|
- git config --global --add safe.directory /drone/src/$REPOSITORY
|
||||||
|
- git add -A
|
||||||
|
- git commit -m "drone build $(TZ=':America/Los_Angeles' date)"
|
||||||
|
- git push
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
_live
|
|
||||||
_site
|
_site
|
||||||
node_modules
|
node_modules
|
||||||
@@ -8,50 +8,22 @@ Template repository for my 11ty projects.
|
|||||||
|
|
||||||
in heckin gitea, create destination repo.
|
in heckin gitea, create destination repo.
|
||||||
|
|
||||||
### 2. add dronefile to source repo
|
### 2. update dronefile in source repo
|
||||||
|
|
||||||
Filename: `.drone.yml`, in root of repo. Note the `<vars>` to replace.
|
Update the `<placeholder values>` in [.drone.yml](.drone.yml).
|
||||||
|
|
||||||
```yaml
|
### 3. create and add PAT (one-time, not per repo)
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: node:current
|
|
||||||
environment:
|
|
||||||
REPOSITORY: <dest-repo>
|
|
||||||
GIT_USER: <username>
|
|
||||||
GIT_TOKEN:
|
|
||||||
from_secret: GIT_TOKEN
|
|
||||||
commands:
|
|
||||||
- git config credential.helper '!f() { echo username=$GIT_USER; echo "password=$GIT_TOKEN"; };f'
|
|
||||||
- git submodule update --remote --init --merge
|
|
||||||
- npm install
|
|
||||||
- npm run build
|
|
||||||
- apt-get update && apt-get install -y rsync
|
|
||||||
- rsync -uavh _site/ $REPOSITORY --delete --exclude .git
|
|
||||||
- cd $REPOSITORY
|
|
||||||
- git checkout main
|
|
||||||
- git config --global --add safe.directory /drone/src/$REPOSITORY
|
|
||||||
- git add -A
|
|
||||||
- git commit -m "drone build $(TZ=':America/Los_Angeles' date)"
|
|
||||||
- git push
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. create PAT (one-time, not per repo)
|
|
||||||
|
|
||||||
in heckin, go to settings > applications, and create a PAT with read & write permissions to repositories.
|
in heckin, go to settings > applications, and create a PAT with read & write permissions to repositories.
|
||||||
|
|
||||||
### 4. activate project in drone and add PAT
|
in drone, you can set your PAT either as a project secret or an organization secret. In either case call it `GIT_TOKEN`.
|
||||||
|
|
||||||
|
### 4. activate project in drone
|
||||||
|
|
||||||
in drone, find your project and activate it.
|
in drone, find your project and activate it.
|
||||||
|
|
||||||
in the settings, I chose to disable pull requests and forks. I set my runner timeout to 15m.
|
in the settings, I chose to disable pull requests and forks. I set my runner timeout to 15m.
|
||||||
|
|
||||||
you can set your PAT either as a project secret or an organization secret. In either case call it `GIT_TOKEN`.
|
|
||||||
|
|
||||||
### 5. first commit to submodule
|
### 5. first commit to submodule
|
||||||
|
|
||||||
assuming we are committing the _site folder...
|
assuming we are committing the _site folder...
|
||||||
@@ -68,6 +40,8 @@ git remote add origin <remote-url>
|
|||||||
git push -u origin main
|
git push -u origin main
|
||||||
```
|
```
|
||||||
|
|
||||||
|
then you can delete the temp directory.
|
||||||
|
|
||||||
### 6. add submodule to local repo
|
### 6. add submodule to local repo
|
||||||
|
|
||||||
in root dir of local repo, add the submodule.
|
in root dir of local repo, add the submodule.
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
layout: base.njk
|
|
||||||
---
|
|
||||||
|
|
||||||
<h1>{{ title }}</h1>
|
|
||||||
|
|
||||||
{{ content | safe }}
|
|
||||||
+7
-7
@@ -3,6 +3,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* numbered components are from https://www.joshwcomeau.com/css/custom-css-reset/ */
|
/* numbered components are from https://www.joshwcomeau.com/css/custom-css-reset/ */
|
||||||
|
#root, #__next {
|
||||||
|
isolation: isolate; /* 10. Create a root stacking context */
|
||||||
|
}
|
||||||
|
|
||||||
*, *::before, *::after {
|
*, *::before, *::after {
|
||||||
box-sizing: border-box; /* 1. Use a more-intuitive box-sizing model */
|
box-sizing: border-box; /* 1. Use a more-intuitive box-sizing model */
|
||||||
}
|
}
|
||||||
@@ -32,18 +36,14 @@ input, button, textarea, select {
|
|||||||
font: inherit; /* 7. Inherit fonts for form controls */
|
font: inherit; /* 7. Inherit fonts for form controls */
|
||||||
}
|
}
|
||||||
|
|
||||||
p, h1, h2, h3, h4, h5, h6 {
|
h1, h2, h3, h4, h5, h6, p {
|
||||||
overflow-wrap: break-word; /* 8. Avoid text overflows */
|
overflow-wrap: break-word; /* 8. Avoid text overflows */
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
|
||||||
text-wrap: pretty; /* 9. Improve line wrapping */
|
|
||||||
}
|
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
h1, h2, h3, h4, h5, h6 {
|
||||||
text-wrap: balance; /* 9. Improve line wrapping */
|
text-wrap: balance; /* 9. Improve line wrapping */
|
||||||
}
|
}
|
||||||
|
|
||||||
#root, #__next {
|
p {
|
||||||
isolation: isolate; /* 10. Create a root stacking context */
|
text-wrap: pretty; /* 9. Improve line wrapping */
|
||||||
}
|
}
|
||||||
+26
-3
@@ -1,7 +1,9 @@
|
|||||||
|
import { HtmlBasePlugin } from "@11ty/eleventy";
|
||||||
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
||||||
|
|
||||||
import { attrs } from "@mdit/plugin-attrs";
|
import { attrs } from "@mdit/plugin-attrs";
|
||||||
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
|
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
|
||||||
|
import markdownitIdAttributes from "markdown-it-anchor";
|
||||||
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
@@ -12,7 +14,7 @@ export default async function (eleventyConfig) {
|
|||||||
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(attrs));
|
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(attrs));
|
||||||
|
|
||||||
/* Markdown apply target="_blank" to all external links */
|
/* Markdown apply target="_blank" to all external links */
|
||||||
const milaOptions = {
|
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitLinkAttributes, {
|
||||||
matcher(href) {
|
matcher(href) {
|
||||||
return href.match(/^https?:\/\//);
|
return href.match(/^https?:\/\//);
|
||||||
},
|
},
|
||||||
@@ -20,8 +22,13 @@ export default async function (eleventyConfig) {
|
|||||||
target: "_blank",
|
target: "_blank",
|
||||||
rel: "external",
|
rel: "external",
|
||||||
},
|
},
|
||||||
};
|
}));
|
||||||
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitLinkAttributes, milaOptions));
|
|
||||||
|
/* Markdown apply ID attributes to headers */
|
||||||
|
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitIdAttributes, {
|
||||||
|
level: [2, 3, 4],
|
||||||
|
tabIndex: false,
|
||||||
|
}));
|
||||||
|
|
||||||
/* Bundles */
|
/* Bundles */
|
||||||
/* CSS */
|
/* CSS */
|
||||||
@@ -41,6 +48,9 @@ export default async function (eleventyConfig) {
|
|||||||
.addPassthroughCopy("favicon.ico")
|
.addPassthroughCopy("favicon.ico")
|
||||||
.addPassthroughCopy("robots.txt");
|
.addPassthroughCopy("robots.txt");
|
||||||
|
|
||||||
|
/* HTML base */
|
||||||
|
eleventyConfig.addPlugin(HtmlBasePlugin);
|
||||||
|
|
||||||
/* Images */
|
/* Images */
|
||||||
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
|
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
|
||||||
// output image formats
|
// output image formats
|
||||||
@@ -56,6 +66,7 @@ export default async function (eleventyConfig) {
|
|||||||
decoding: "async",
|
decoding: "async",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
/* If you want to use specific images as the OG image...
|
||||||
filenameFormat: function (hash, src, width, format, options) {
|
filenameFormat: function (hash, src, width, format, options) {
|
||||||
// If you're building multiple widths
|
// If you're building multiple widths
|
||||||
// const extension = path.extname(src);
|
// const extension = path.extname(src);
|
||||||
@@ -64,11 +75,23 @@ export default async function (eleventyConfig) {
|
|||||||
|
|
||||||
return path.basename(src);
|
return path.basename(src);
|
||||||
},
|
},
|
||||||
|
*/
|
||||||
});
|
});
|
||||||
|
|
||||||
/* All filters from _config/filters.js */
|
/* All filters from _config/filters.js */
|
||||||
eleventyConfig.addPlugin(pluginFilters);
|
eleventyConfig.addPlugin(pluginFilters);
|
||||||
|
|
||||||
|
/* Draft handling */
|
||||||
|
eleventyConfig.addPreprocessor("drafts", "*", (data, content) => {
|
||||||
|
if (data.draft) {
|
||||||
|
data.title = `${data.title} (draft)`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data.draft && process.env.ELEVENTY_RUN_MODE === "build") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/* Shortcodes */
|
/* Shortcodes */
|
||||||
eleventyConfig.addShortcode("currentBuildDate", () => {
|
eleventyConfig.addShortcode("currentBuildDate", () => {
|
||||||
return new Date().toISOString();
|
return new Date().toISOString();
|
||||||
|
|||||||
Generated
+26
-13
@@ -5,6 +5,7 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
|
"name": "11ty",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -12,6 +13,7 @@
|
|||||||
"@11ty/eleventy-img": "^6.0.4",
|
"@11ty/eleventy-img": "^6.0.4",
|
||||||
"@mdit/plugin-attrs": "^0.25.1",
|
"@mdit/plugin-attrs": "^0.25.1",
|
||||||
"luxon": "^3.7.2",
|
"luxon": "^3.7.2",
|
||||||
|
"markdown-it-anchor": "^10.0.0",
|
||||||
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
|
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -39,9 +41,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@11ty/eleventy": {
|
"node_modules/@11ty/eleventy": {
|
||||||
"version": "3.1.5",
|
"version": "3.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/@11ty/eleventy/-/eleventy-3.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@11ty/eleventy/-/eleventy-3.1.6.tgz",
|
||||||
"integrity": "sha512-hZ0g6MwZyRxCqXsPm82gIM304LraKbUz3ZmezOSjsqxttZG6cHTib3Qq8QkESJoKwnr+yX1eyfOkPC5/mEgZnQ==",
|
"integrity": "sha512-ZlSiR1PLdS2lv7TelBgWAhcvMiLNZkPBlLEb+lh7kGYZ+Mk0bo9qcYgVsewvw9W7Em0RH3wd01h5fAstNDh0zA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -51,7 +53,7 @@
|
|||||||
"@11ty/eleventy-plugin-bundle": "^3.0.7",
|
"@11ty/eleventy-plugin-bundle": "^3.0.7",
|
||||||
"@11ty/eleventy-utils": "^2.0.7",
|
"@11ty/eleventy-utils": "^2.0.7",
|
||||||
"@11ty/lodash-custom": "^4.17.21",
|
"@11ty/lodash-custom": "^4.17.21",
|
||||||
"@11ty/posthtml-urls": "^1.0.2",
|
"@11ty/posthtml-urls": "^1.0.3",
|
||||||
"@11ty/recursive-copy": "^4.0.4",
|
"@11ty/recursive-copy": "^4.0.4",
|
||||||
"@sindresorhus/slugify": "^2.2.1",
|
"@sindresorhus/slugify": "^2.2.1",
|
||||||
"bcp-47-normalize": "^2.3.0",
|
"bcp-47-normalize": "^2.3.0",
|
||||||
@@ -64,20 +66,20 @@
|
|||||||
"iso-639-1": "^3.1.5",
|
"iso-639-1": "^3.1.5",
|
||||||
"js-yaml": "^4.1.1",
|
"js-yaml": "^4.1.1",
|
||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
"liquidjs": "^10.25.0",
|
"liquidjs": "^10.27.0",
|
||||||
"luxon": "^3.7.2",
|
"luxon": "^3.7.2",
|
||||||
"markdown-it": "^14.1.1",
|
"markdown-it": "^14.2.0",
|
||||||
"minimist": "^1.2.8",
|
"minimist": "^1.2.8",
|
||||||
"moo": "0.5.2",
|
"moo": "0.5.2",
|
||||||
"node-retrieve-globals": "^6.0.1",
|
"node-retrieve-globals": "^6.0.1",
|
||||||
"nunjucks": "^3.2.4",
|
"nunjucks": "^3.2.4",
|
||||||
"picomatch": "^4.0.3",
|
"picomatch": "^4.0.4",
|
||||||
"please-upgrade-node": "^3.2.0",
|
"please-upgrade-node": "^3.2.0",
|
||||||
"posthtml": "^0.16.7",
|
"posthtml": "^0.16.7",
|
||||||
"posthtml-match-helper": "^2.0.3",
|
"posthtml-match-helper": "^2.0.3",
|
||||||
"semver": "^7.7.4",
|
"semver": "^7.8.1",
|
||||||
"slugify": "^1.6.8",
|
"slugify": "^1.6.9",
|
||||||
"tinyglobby": "^0.2.15"
|
"tinyglobby": "^0.2.16"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"eleventy": "cmd.cjs"
|
"eleventy": "cmd.cjs"
|
||||||
@@ -1798,6 +1800,17 @@
|
|||||||
"markdown-it": "bin/markdown-it.mjs"
|
"markdown-it": "bin/markdown-it.mjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/markdown-it-anchor": {
|
||||||
|
"version": "10.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-10.0.0.tgz",
|
||||||
|
"integrity": "sha512-Q8g7Z6OBdH3eXF0lujFqukIxUvgCDZcjzCrJxmD6QiEzU1HWR9fVN+Bf6gxmM+0yrPFs+jUw8gNjLmUQqt6Eew==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Unlicense",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/markdown-it": "*",
|
||||||
|
"markdown-it": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/markdown-it-link-attributes": {
|
"node_modules/markdown-it-link-attributes": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main",
|
"resolved": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main",
|
||||||
@@ -2201,9 +2214,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "7.8.0",
|
"version": "7.8.5",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
|
||||||
"integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==",
|
"integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
+2
-1
@@ -4,7 +4,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rm -rf _site && npx @11ty/eleventy --quiet",
|
"build": "rm -rf _site && npx @11ty/eleventy --quiet",
|
||||||
"dev": "rm -rf _live && npx @11ty/eleventy --serve --quiet --output _live"
|
"dev": "rm -rf _site && npx @11ty/eleventy --serve --quiet"
|
||||||
},
|
},
|
||||||
"author": "Lee Cattarin",
|
"author": "Lee Cattarin",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
"@11ty/eleventy-img": "^6.0.4",
|
"@11ty/eleventy-img": "^6.0.4",
|
||||||
"@mdit/plugin-attrs": "^0.25.1",
|
"@mdit/plugin-attrs": "^0.25.1",
|
||||||
"luxon": "^3.7.2",
|
"luxon": "^3.7.2",
|
||||||
|
"markdown-it-anchor": "^10.0.0",
|
||||||
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
|
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
permalink: 404.html
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Content not found.
|
||||||
|
|
||||||
|
Sorry, can't find this page. Return [home](/).
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
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 %}
|
||||||
|
{% if page.data.permalink != false %}
|
||||||
|
{% set absoluteUrl %}{{ page.url | htmlBaseUrl(metadata.url) }}{% endset %}
|
||||||
|
<url>
|
||||||
|
<loc>{{ absoluteUrl }}</loc>
|
||||||
|
<lastmod>{{ page.date | htmlDateString }}</lastmod>
|
||||||
|
</url>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</urlset>
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
export default {
|
export default {
|
||||||
layout: "page.njk",
|
layout: "base.njk",
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user