Skip to content

Commit

Permalink
馃悰 Now handled the tag inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
atapas committed Apr 11, 2022
1 parent 410d526 commit fdb94c1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plop-templates/play.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
component: () => {return <{{trim component}} />},
path: '/plays/{{trim folder}}',
level: '{{level}}',
tags: '{{tags}}',
tags: '{{removeAllSpaces tags}}',
github: '{{github}}',
cover: '{{cover}}',
blog: '{{blog}}',
Expand Down
1 change: 1 addition & 0 deletions plopfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = plop => {
plop.setHelper('trim', str => str.trim());
plop.setHelper('removeAllSpaces', str => str.replaceAll(/\s/g,''));

// demo generator
plop.setGenerator('play', {
Expand Down
2 changes: 1 addition & 1 deletion src/common/playlists/PlayHeaderInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const PlayHeaderInfo = ({ play }) => {
<span className="sr-only">Back</span>
</Link>
<h3 className="header-title">{play.name}</h3>
<LevelBadge level={play.level} /> { play.tags && <Tags tags={play.tags.split(', ')} /> }
<LevelBadge level={play.level} /> { play.tags && <Tags tags={play.tags.split(',')} /> }
</div>
<div className="header-secondary">
{ play.github && <Author github={play.github} /> }
Expand Down
2 changes: 1 addition & 1 deletion src/meta/play-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const getPlaysByCreator = creator => {

const getAllTags = () => {
const tags = plays.reduce((acc, play) => {
return acc.concat(play.tags.split(', '));
return acc.concat(play.tags.split(','));
}, []);

return Array.from(new Set([...tags]));
Expand Down

0 comments on commit fdb94c1

Please sign in to comment.