is this it?
This commit is contained in:
parent
267576aa4d
commit
f62f270e5e
5
cli.js
5
cli.js
|
@ -89,10 +89,7 @@ Object.keys(CSS_VARS).forEach((key) => {
|
|||
cli.conflicts(key, "core");
|
||||
cli.conflicts(key, "none");
|
||||
});
|
||||
cli.group(
|
||||
Object.keys(CSS_VARS),
|
||||
`${css}:`
|
||||
);
|
||||
cli.group(Object.keys(CSS_VARS), `${css}:`);
|
||||
|
||||
const argv = cli
|
||||
.conflicts("author", "body")
|
||||
|
|
7
css.js
7
css.js
|
@ -46,7 +46,8 @@ export function load(options) {
|
|||
if (
|
||||
!["gmi.css", "gmi-web.css"].includes(options.css) ||
|
||||
!existsSync(options.css)
|
||||
) throw new Error(`Cannot find file ${options.css}.`);
|
||||
)
|
||||
throw new Error(`Cannot find file ${options.css}.`);
|
||||
|
||||
const internal = (file) =>
|
||||
path.resolve(path.dirname(new URL(import.meta.url).pathname), file);
|
||||
|
@ -69,7 +70,9 @@ export function rootVariables(rules) {
|
|||
if (!root) return {};
|
||||
return root.declarations.reduce(
|
||||
(obj, { property, value }) =>
|
||||
!/^\-\-/.test(property) ? obj : Object.assign(obj, { [property.replace("--", "")]: value }),
|
||||
!/^\-\-/.test(property)
|
||||
? obj
|
||||
: Object.assign(obj, { [property.replace("--", "")]: value }),
|
||||
{}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ fashion!
|
|||
|
||||
Use *--author* _NAME_ to set the author <meta> tag on every file.
|
||||
|
||||
Use *--descriptions* [_LIMIT_] to apply the first non-empty text line of each
|
||||
Use *--description* [_LIMIT_] to apply the first non-empty text line of each
|
||||
file as the description <meta> tag. _LIMIT_ may be used to truncate the text
|
||||
with an ellipsis at that number of characters.
|
||||
|
||||
|
|
6
html.js
6
html.js
|
@ -141,11 +141,13 @@ export function head(tokens, options) {
|
|||
<meta name="viewport" content="width=device-width,initial-scale=1">${
|
||||
options.styleTag
|
||||
}
|
||||
<title>${tokens.find(({h1}) => h1).h1 || ""}</title>${
|
||||
<title>${tokens.find(({ h1 }) => h1).h1 || ""}</title>${
|
||||
options.author ? `\n<meta name="author" content="${options.author}">` : ""
|
||||
}${
|
||||
description
|
||||
? `\n<meta name="description" content="${escape(truncate(description.text, options.description))}">`
|
||||
? `\n<meta name="description" content="${escape(
|
||||
truncate(description.text, options.description)
|
||||
)}">`
|
||||
: ""
|
||||
}${
|
||||
options.canonical
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gmi-web-cli",
|
||||
"version": "1.0.0-rc.4",
|
||||
"version": "1.0.0",
|
||||
"description": "A bridge between Gemini and HTML",
|
||||
"main": "html.js",
|
||||
"type": "module",
|
||||
|
|
Loading…
Reference in a new issue