Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
Merge branch 'dev' of github.com:pedronauck/docz into dev
Browse files Browse the repository at this point in the history
* 'dev' of github.com:pedronauck/docz:
  fix(docz-core): join head tags (#255)
  • Loading branch information
pedronauck committed Aug 25, 2018
2 parents 9db9231 + 065e8b3 commit 9996292
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/docz-core/src/utils/parse-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ const wrapItems = (item: any) =>
.map(key => `${key}="${item[key]}"`)
.join(' ')

const generateMetaTags = (items: any[] = []) => {
return items.map(item => `<meta ${wrapItems(item)}>`)
}
export type tagsTemplate = (type: string) => string
const generateTags = (template: tagsTemplate) => (items: any[] = []) =>
items.map(template).join('')

const generateLinkTags = (items: any[] = []) => {
return items.map(item => `<link ${wrapItems(item)}>`)
}
const generateMetaTags = generateTags(item => `<meta ${wrapItems(item)}>`)

const generateScriptTags = (items: any[] = []) => {
return items.map(item => `<script ${wrapItems(item)}></script>`)
}
const generateLinkTags = generateTags(item => `<link ${wrapItems(item)}>`)

const generateScriptTags = generateTags(
item => `<script ${wrapItems(item)}></script>`
)

const generateRawTags = (items: any[] = []) => {
if (typeof items === 'string' || items instanceof String) return items
return items.map(item => item)
return items.map(item => item).join('')
}

const getHtmlFilepath = (indexHtml: string | undefined) =>
Expand Down

0 comments on commit 9996292

Please sign in to comment.