-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the most interesting commit about the 11ty port, where all changes have been dome
- Loading branch information
1 parent
dbdd203
commit 99072ea
Showing
52 changed files
with
8,054 additions
and
86 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,81 @@ | ||
const htmlmin = require("html-minifier"); | ||
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); | ||
const {Liquid} = require("liquidjs"); | ||
const markdownIt = require("markdown-it"); | ||
|
||
function watchAndPass(file, config) { | ||
config.addWatchTarget(file); | ||
config.addPassthroughCopy(file); | ||
} | ||
module.exports = function (eleventyConfig) { | ||
watchAndPass("./assets/js", eleventyConfig); | ||
watchAndPass("./assets/dist", eleventyConfig); | ||
watchAndPass("./assets/img", eleventyConfig); | ||
watchAndPass("./api", eleventyConfig); | ||
watchAndPass("./favicon.ico", eleventyConfig); | ||
watchAndPass("./favicon-16x16.png", eleventyConfig); | ||
watchAndPass("./favicon-32x32.png", eleventyConfig); | ||
watchAndPass("./android-chrome-192x192.png", eleventyConfig); | ||
watchAndPass("./android-chrome-256x256.png", eleventyConfig); | ||
watchAndPass("./safari-pinned-tab.svg", eleventyConfig); | ||
watchAndPass("./apple-touch-icon.png", eleventyConfig); | ||
eleventyConfig.addWatchTarget("./docs"); | ||
|
||
eleventyConfig.addPlugin(syntaxHighlight); | ||
|
||
// Reduce HTML output size | ||
eleventyConfig.addTransform("htmlmin", function(content, outputPath) { | ||
if( this.outputPath && this.outputPath.endsWith(".html") ) { | ||
let minified = htmlmin.minify(content, { | ||
useShortDoctype: true, | ||
removeComments: true, | ||
collapseWhitespace: true | ||
}); | ||
return minified; | ||
} | ||
|
||
return content; | ||
}); | ||
|
||
eleventyConfig.addCollection("apps", function(collectionApi) { | ||
return collectionApi.getFilteredByGlob("_apps/*.md"); | ||
}); | ||
|
||
eleventyConfig.addCollection("docs", function(collectionApi) { | ||
return collectionApi.getFilteredByGlob("_docs/*.md"); | ||
}); | ||
|
||
// Pass custom options to liquid | ||
let options = { | ||
extname: ".liquid", | ||
dynamicPartials: true, | ||
strict_filters: true, | ||
root: ["_includes"] | ||
}; | ||
const liquid = new Liquid(options); | ||
liquid.registerTag('octicon', require("./js/octicons-liquid/tag.js")); | ||
eleventyConfig.setLibrary("liquid", liquid); | ||
|
||
// Customize markdown-it settings | ||
let markdown = markdownIt({ | ||
html: true, | ||
breaks: true, | ||
linkify: true | ||
}); | ||
|
||
eleventyConfig.addFilter('markdown', function(value) { | ||
return markdown.render(value); | ||
}); | ||
|
||
eleventyConfig.setLibrary("md", markdown); | ||
|
||
// Speed up dev builds by not watching JS deps for changes | ||
eleventyConfig.setWatchJavaScriptDependencies(false); | ||
|
||
return { | ||
passthroughFileCopy: true, | ||
dir: { | ||
layouts: "_layouts" | ||
} | ||
} | ||
} |
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 @@ | ||
README.md | ||
CONTRIBUTING.md | ||
CODE_OF_CONDUCT.md | ||
LICENSE | ||
node_modules | ||
_submodules | ||
.yarn | ||
api | ||
assets/sass | ||
.github |
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,13 @@ | ||
env: | ||
es2020: true | ||
node: true | ||
extends: | ||
- 'plugin:prettier/recommended' | ||
parser: '@typescript-eslint/parser' | ||
parserOptions: | ||
ecmaVersion: 12 | ||
sourceType: module | ||
plugins: | ||
- '@typescript-eslint' | ||
- 'prettier' | ||
rules: {} |
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,42 @@ | ||
name: Build Eleventy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Cache yarn packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
.yarn/cache | ||
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install dependencies & build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git submodule init | ||
git submodule update | ||
yarn | ||
yarn sass | ||
yarn build | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
publish_dir: ./_site | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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,44 @@ | ||
name: Sync app data | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Cache yarn packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
.yarn/cache | ||
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install dependencies & sync data | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
yarn install | ||
yarn sync-data | ||
- name: Determine default branch | ||
run: | | ||
DEFAULT_BRANCH=$(git remote show origin | awk '/HEAD branch/ {print $NF}') | ||
echo "default_branch=$DEFAULT_BRANCH" >> $GITHUB_ENV | ||
echo "default_branch_ref=refs/heads/$DEFAULT_BRANCH" >> $GITHUB_ENV | ||
- name: Commit & Push changes | ||
uses: actions-js/push@4decc2887d2770f29177082be3c8b04d342f5b64 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
message: 'chore: Sync data' | ||
branch: ${{ env.default_branch }} |
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
.jekyll-metadata | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/releases | ||
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
.pnp.* | ||
.env | ||
private | ||
lib/tsconfig.tsbuildinfo | ||
_site | ||
Gemfile.lock | ||
vendor | ||
bin | ||
.bundle | ||
node_modules |
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,14 @@ | ||
{ | ||
"search.exclude": { | ||
"**/.yarn": true, | ||
"**/.pnp.*": true | ||
}, | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"files.watcherExclude": { | ||
"**/.git/objects/**": true, | ||
"**/.git/subtree-cache/**": true, | ||
"**/node_modules/*/**": true, | ||
"**/.yarn/cache/**": true, | ||
"**/.yarn/unplugged/**": true, | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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,3 @@ | ||
nodeLinker: 'node-modules' | ||
|
||
yarnPath: .yarn/releases/yarn-3.0.0-rc.5.cjs |
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
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
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
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,47 @@ | ||
{ | ||
"Getting Started": [ | ||
"docs/README.md", | ||
"docs/hello-world.md", | ||
"docs/development.md", | ||
"docs/webhooks.md", | ||
"docs/github-api.md" | ||
], | ||
"Advanced": [ | ||
"docs/configuration.md", | ||
"docs/testing.md", | ||
"docs/simulating-webhooks.md", | ||
"docs/logging.md", | ||
"docs/deployment.md", | ||
"docs/http.md", | ||
"docs/pagination.md", | ||
"docs/extensions.md", | ||
"docs/persistence.md", | ||
"docs/best-practices.md" | ||
], | ||
"Reference": [ | ||
{ | ||
"title": "Probot", | ||
"url": "https://probot.github.io/api/latest/classes/probot.html" | ||
}, | ||
{ | ||
"title": "context", | ||
"url": "https://probot.github.io/api/latest/classes/context.html" | ||
}, | ||
{ | ||
"title": "context.octokit", | ||
"url": "http://octokit.github.io/rest.js/" | ||
}, | ||
{ | ||
"title": "run", | ||
"url": "https://probot.github.io/api/latest/index.html#run" | ||
}, | ||
{ | ||
"title": "createNodeMiddleware", | ||
"url": "https://probot.github.io/api/latest/index.html#createnodemiddleware" | ||
}, | ||
{ | ||
"title": "GitHub Webhook Events", | ||
"url": "https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads" | ||
} | ||
] | ||
} |
File renamed without changes.
Oops, something went wrong.