diff --git a/app/views/components/work.hbs b/app/views/components/work.hbs index 80c0eb1..122c0d5 100644 --- a/app/views/components/work.hbs +++ b/app/views/components/work.hbs @@ -2,7 +2,7 @@
{{> title value="Experience"}} - {{#each resume.work}} + {{#each (filterRepeatKey resume.work "company")}}
{{> section-header name=this.company }} diff --git a/index.js b/index.js index e4a4a80..7c70992 100644 --- a/index.js +++ b/index.js @@ -40,6 +40,15 @@ handlebars.registerHelper({ formatDate: function (date) { return moment(date).format('MM/YYYY'); + }, + + filterRepeatKey: function(list, key) { + return list.map((curr, i, array) => { + if (curr[key] == array[i-1]?.[key]) { + curr[key] = undefined + } + return curr + }) } });