1.0.8-rc.4

This commit is contained in:
Talon Poole 2021-02-25 21:37:21 +00:00
parent bf8b806ed5
commit 5fda4c14e0
2 changed files with 4 additions and 3 deletions

View file

@ -129,7 +129,8 @@ export function head(tokens, options) {
const truncate = (text, limit) => const truncate = (text, limit) =>
text.length > limit ? `${text.substring(0, limit)}...` : text; text.length > limit ? `${text.substring(0, limit)}...` : text;
let description = const heading = tokens.find(({ h1 }) => h1)
const description =
options.description > 0 options.description > 0
? tokens.find((token) => { ? tokens.find((token) => {
return token.text && token.text !== ""; return token.text && token.text !== "";
@ -141,7 +142,7 @@ export function head(tokens, options) {
<meta name="viewport" content="width=device-width,initial-scale=1">${ <meta name="viewport" content="width=device-width,initial-scale=1">${
options.styleTag options.styleTag
} }
<title>${tokens.find(({ h1 }) => h1).h1 || ""}</title>${ <title>${heading ? heading.h1 : ""}</title>${
options.author ? `\n<meta name="author" content="${options.author}">` : "" options.author ? `\n<meta name="author" content="${options.author}">` : ""
}${ }${
description description

View file

@ -1,6 +1,6 @@
{ {
"name": "gmi-web-cli", "name": "gmi-web-cli",
"version": "1.0.8-rc.4", "version": "1.0.9-rc.4",
"description": "Convert text/gemini to text/html.", "description": "Convert text/gemini to text/html.",
"main": "html.js", "main": "html.js",
"type": "module", "type": "module",