@vyriy/html 0.6.0 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/html.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ The function returns a full `<!DOCTYPE html>` page and lets you inject common do
|
|
|
25
25
|
- attributes for the `<body>` tag
|
|
26
26
|
- body markup and footer-like script sections
|
|
27
27
|
|
|
28
|
-
Missing sections default to empty strings,
|
|
28
|
+
Missing sections default to empty strings, except `meta`, which defaults to UTF-8 and responsive viewport tags. Pass `meta: ''` when a document should omit those defaults.
|
|
29
29
|
|
|
30
30
|
`minify` can be used as an explicit wrapper when the rendered document should not contain line breaks. It removes line breaks from the whole document, including injected style and script sections, while preserving ordinary spaces.
|
|
31
31
|
|
|
@@ -58,7 +58,6 @@ import { html } from '@vyriy/html';
|
|
|
58
58
|
const page = html({
|
|
59
59
|
htmlAttributes: 'lang="en"',
|
|
60
60
|
title: '<title>Vyriy</title>',
|
|
61
|
-
meta: '<meta charset="utf-8" />',
|
|
62
61
|
bodyAttributes: 'class="app"',
|
|
63
62
|
body: '<div id="root"></div>',
|
|
64
63
|
script: '<script src="/main.js"></script>',
|
package/html.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
const defaultMeta = '<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />';
|
|
1
2
|
export const html = (props = {}) => {
|
|
2
|
-
const { htmlAttributes = '', title = '', meta =
|
|
3
|
+
const { htmlAttributes = '', title = '', meta = defaultMeta, base = '', link = '', style = '', bodyAttributes = '', body = '', noscript = '', script = '', } = props;
|
|
3
4
|
return `
|
|
4
5
|
<!DOCTYPE html>
|
|
5
6
|
<html ${htmlAttributes}>
|