Skip to content

Commit

Permalink
refactor: remove duplicate quadrant name definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Clift authored and bastianccm committed Jul 15, 2020
1 parent b713bb4 commit 445c53c
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tasks/template.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pug from 'pug';
import moment from 'moment';
import { translate } from '../common/config';
import { relativePath } from '../common/file';
import {
groupByQuadrants,
Expand All @@ -10,22 +11,13 @@ import {
const templateFolder = 'templates';

export const vars = (vars) => ({
translate: (text) => {
const mappings = {
'languages-and-frameworks': 'Languages & Frameworks',
'methods-and-patterns': 'Methods & Patterns',
'platforms-and-aoe-services': 'Platforms and AOE Services',
'tools': 'Tools',
};

return mappings[text.trim()] || '-';
},
translate: translate,
formatRelease: (release) => moment(release, 'YYYY-MM-DD').format('MMM YYYY'),
groupByQuadrants,
groupByFirstLetter,
groupByRing,
...vars,
})
});

export const item = pug.compileFile(relativePath(templateFolder, 'item-page.pug'));

Expand Down

0 comments on commit 445c53c

Please sign in to comment.