jaywcjlove / markdown-to-html-cli

Command line tool that converts markdown to HTML.
https://jaywcjlove.github.io/markdown-to-html-cli
MIT License
59 stars 8 forks source link

Add `head` entries #90

Open Regenhardt opened 3 days ago

Regenhardt commented 3 days ago

Is it possible to add arbitrary <head> entries, like a canonical URL? Couldn't find a parameter for it.

jaywcjlove commented 2 days ago

@Regenhardt If you provide the configuration file config/conf.json, it can include the following settings:

{
  "document": {
    "title": "markdown-to-html-cli",
    "description": "Command line tool generates markdown as HTML.",
    "style": "body { color: red; }",
    "meta": [
      { "description": "Command line tool generates markdown as HTML." },
      { "keywords": "store, localStorage, lightweight, JavaScript" }
    ]
  }
}

If the configuration is added in "package.json", it would look like this:

{
  "markdown-to-html": {
    "document": {
      "title": "markdown-to-html-cli",
      "description": "Command line tool generates markdown as html.",
      "style": "body { color: red; }",
      "meta": [
        { "description": "Command line tool generates markdown as html." },
        { "keywords": "store,localStorage,lightweight,JavaScript" }
      ]
    }
}
jaywcjlove commented 2 days ago

@Regenhardt upgrade v4.1.0