Skip to content

Commit 38fcc56

Browse files
Making the migrate snippet script support already migrated json files and contributor array
1 parent b4da317 commit 38fcc56

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

snippets/css/layouts/grid-layout.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ Tags: css,layout,grid
1414
- `minmax(250px, 1fr)`: Defines a minimum column size of 250px and a maximum size of 1fr (fraction of available space).
1515
*/
1616
}
17-
1817
```

utils/migrateSnippets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ function formatSnippet(snippet) {
1818
Title: ${snippet.title}
1919
Description: ${snippet.description}
2020
Author: ${snippet.author}
21-
Tags: ${snippet.tags}
21+
Tags: ${snippet.tags}${('contributors' in snippet) && snippet.contributors.length > 0 ? `\nContributors: ${snippet.contributors}` : ''}
2222
---
2323
2424
\`\`\`
25-
${snippet.code.join('\n')}
25+
${Array.isArray(snippet.code) ? snippet.code.join('\n').trim() : snippet.code.trim()}
2626
\`\`\`
2727
`;
2828
}

0 commit comments

Comments
 (0)