Skip to content

Commit

Permalink
feat: add date, ISO date, and Markdown filters (resolve #1) (#5)
Browse files Browse the repository at this point in the history
* feat: add date, ISO date, and Markdown filters (resolve #1)
* fix: reformat workflow file, adjust tests
  • Loading branch information
greatislander committed Dec 8, 2020
1 parent 457a5c8 commit 62512ef
Show file tree
Hide file tree
Showing 16 changed files with 1,193 additions and 253 deletions.
6 changes: 6 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ https://github.com/greatislander/eleventy-plugin-fluid/raw/main/LICENSE.md.
*/
"use strict";

var dateFilter = require("./src/filters/date-filter.js");
var isoDateFilter = require("./src/filters/iso-date-filter.js");
var limitFilter = require("./src/filters/limit-filter.js");
var markdownFilter = require("./src/filters/markdown-filter.js");
var slugFilter = require("./src/filters/slug-filter.js");

module.exports = function(eleventyConfig) {
eleventyConfig.addFilter("date", dateFilter);
eleventyConfig.addFilter("isoDate", isoDateFilter);
eleventyConfig.addFilter("limit", limitFilter);
eleventyConfig.addFilter("markdown", markdownFilter);
eleventyConfig.addFilter("slug", slugFilter);
};
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "eslint-config-fluid",
"globals": {
"fluid": true
},
"env": {
"browser": true,
"amd": true,
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6
}
}
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
pull_request:
branches: [main]

jobs:
lint:
name: Lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies, and lint JavaScript and JSON files, and run tests
run: |
npm i
npm run lint
npm test
env:
CI: true
32 changes: 16 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ https://github.com/greatislander/eleventy-plugin-fluid/raw/main/LICENSE.md.

module.exports = function (grunt) {

// Project configuration.
grunt.initConfig({
// Project package file destination.
pkg: grunt.file.readJSON("package.json"),
lintAll: {
sources: {
json: ["package.json"],
js: ["./src/**/*.js",".eleventy.js","Gruntfile.js"]
}
}
});
// Load the plugin(s):
grunt.loadNpmTasks("fluid-grunt-lint-all");
// Custom tasks:
grunt.registerTask("default", ["lint"]);
grunt.registerTask("lint", "Perform all standard lint checks.", ["lint-all"]);
// Project configuration.
grunt.initConfig({
// Project package file destination.
pkg: grunt.file.readJSON("package.json"),
lintAll: {
sources: {
json: [".eslintrc.json", "package.json"],
js: ["./src/**/*.js","!.eleventy.js","Gruntfile.js"]
}
}
});
// Load the plugin(s):
grunt.loadNpmTasks("fluid-grunt-lint-all");
// Custom tasks:
grunt.registerTask("default", ["lint"]);
grunt.registerTask("lint", "Perform all standard lint checks.", ["lint-all"]);
};
Loading

0 comments on commit 62512ef

Please sign in to comment.