import tags fix
This commit is contained in:
parent
e54656d27e
commit
28acdaff7f
|
|
@ -8,7 +8,7 @@ const data = JSON.parse(fs.readFileSync(join(HOME_DIR, 'new/tags.json'), 'utf-8'
|
|||
|
||||
for (const [key, tags] of Object.entries(data)) {
|
||||
|
||||
const filename = join(HOME_DIR, `src/_icons/${key}.svg`), tagsInline = tags
|
||||
const filename = join(HOME_DIR, `icons/outline/${key}.svg`), tagsInline = tags
|
||||
.join(' ')
|
||||
.toLowerCase()
|
||||
.split(' ')
|
||||
|
|
@ -17,10 +17,10 @@ for (const [key, tags] of Object.entries(data)) {
|
|||
|
||||
if (key && tags.length) {
|
||||
let data = fs.readFileSync(filename).toString()
|
||||
data = data.replace(/(---[\s\S]+?---)/, function (m, headerContent) {
|
||||
data = data.replace(/(\<\!--[\s\S]+?-->)/, function (m, headerContent) {
|
||||
|
||||
headerContent = headerContent.replace(/tags: .*\n/, '')
|
||||
headerContent = headerContent.replace(/---/, `---\ntags: [${tagsInline}]`)
|
||||
headerContent = headerContent.replace(/\<\!--/, `<!--\ntags: [${tagsInline}]`)
|
||||
|
||||
return headerContent
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue