Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Calculate deploy URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Nov 19, 2019
1 parent 3b18a6f commit a29179e
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const moment = require("moment");
const htmlparser2 = require("htmlparser2");

module.exports = function(eleventyConfig) {
eleventyConfig.addCollection("posts", collection => collection.getFilteredByGlob("_posts/*.md").reverse());

// https://www.11ty.io/docs/dates/#dates-off-by-one-day
eleventyConfig.addFilter("date", (date, format) => moment(date.toUTCString()).format(format));
Expand Down Expand Up @@ -42,6 +41,7 @@ module.exports = function(eleventyConfig) {
parser.parseComplete(templateContent);
return htmlTextContent.trim().split(/\s+/).length;
});
eleventyConfig.addCollection("posts", collection => collection.getFilteredByGlob("_posts/*.md").reverse());
eleventyConfig.addPassthroughCopy("assets");
eleventyConfig.setBrowserSyncConfig({
callbacks: {
Expand Down
15 changes: 15 additions & 0 deletions _data/metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use strict";

const DEFAULT_URL = "https://eslint.org";

module.exports = {
title: "ESLint - Pluggable JavaScript linter",
repository: "eslint/eslint.github.io",
description: "A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.",

/*
* Netlify sets the following environment variables
* https://www.netlify.com/docs/continuous-deployment/#environment-variables
*/
url: (process.env.CONTEXT === "production" ? process.env.URL : process.env.DEPLOY_PRIME_URL) || DEFAULT_URL
};
5 changes: 0 additions & 5 deletions _data/site.json

This file was deleted.

1 change: 0 additions & 1 deletion _pages/404.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: 404
layout: doc
permalink: /404.html
edit_link: https://github.com/eslint/eslint.github.io/edit/master/_pages/404.md
---

Expand Down
3 changes: 3 additions & 0 deletions _pages/_pages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"permalink": "{{ page.fileSlug }}/index.html"
}
1 change: 0 additions & 1 deletion _pages/blog.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: ESLint Blog
layout: doc
permalink: /blog/index.html
edit_link: https://github.com/eslint/eslint.github.io/edit/master/_pages/blog.html
---
<br/>
Expand Down
1 change: 0 additions & 1 deletion _pages/cla.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: ESLint Contributor License Agreement
layout: redirect
permalink: /cla/index.html
edit_link: https://github.com/eslint/eslint.github.io/edit/master/_pages/cla.md
---
1 change: 0 additions & 1 deletion _pages/demo.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: ESLint Demo
layout: demo
permalink: /demo/index.html
edit_link: https://github.com/eslint/eslint.github.io/edit/master/_pages/demo.html
---
<div id="app">
Expand Down
1 change: 0 additions & 1 deletion _pages/index.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: ESLint - Pluggable JavaScript linter
layout: default
permalink: /index.html
homepage: true
---

Expand Down
1 change: 0 additions & 1 deletion _pages/parser.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: ESLint Parser Demo
layout: demo
permalink: /parser/index.html
edit_link: https://github.com/eslint/eslint.github.io/edit/master/_pages/parser.html
---
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion _posts/_posts.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"layout": "post",
"permalink": "/blog/{{ page.date | date: \"YYYY/MM\" }}/{{ page.fileSlug }}/index.html"
"permalink": "blog/{{ page.date | date: \"YYYY/MM\" }}/{{ page.fileSlug }}/index.html"
}

0 comments on commit a29179e

Please sign in to comment.