{"id":17028421,"url":"https://github.com/bennycode/hexo-insert-markdown","last_synced_at":"2025-04-12T12:10:44.420Z","repository":{"id":38775081,"uuid":"370723730","full_name":"bennycode/hexo-insert-markdown","owner":"bennycode","description":"A Hexo plugin that allows you to insert Markdown files in existing Markdown files.","archived":false,"fork":false,"pushed_at":"2023-04-20T21:51:55.000Z","size":88,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T06:51:09.100Z","etag":null,"topics":["hexo","insertmd","markdown","plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/hexo-insert-markdown","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bennycode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-25T14:34:12.000Z","updated_at":"2024-10-17T13:40:15.000Z","dependencies_parsed_at":"2022-08-09T15:42:02.687Z","dependency_job_id":null,"html_url":"https://github.com/bennycode/hexo-insert-markdown","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennycode%2Fhexo-insert-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennycode%2Fhexo-insert-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennycode%2Fhexo-insert-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennycode%2Fhexo-insert-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bennycode","download_url":"https://codeload.github.com/bennycode/hexo-insert-markdown/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565074,"owners_count":21125417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hexo","insertmd","markdown","plugin"],"created_at":"2024-10-14T07:54:13.059Z","updated_at":"2025-04-12T12:10:44.402Z","avatar_url":"https://github.com/bennycode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hexo-insert-markdown\n\nA [Hexo](https://hexo.io/) plugin that allows you to insert Markdown files in existing Markdown files.\n\n## Installation\n\n1. Add this plugin to your Hexo site with `npm install hexo-insert-markdown --save`\n2. Insert the `{% insertmd %}` tag in your posts or pages to include Markdown content from files\n3. Rebuild your site to see the effect of this plugin: `hexo clean \u0026\u0026 hexo generate`\n\n**Note:** The path to file includes must be relative to the [source directory](https://hexo.io/docs/configuration.html#Directory) of your Hexo installation. Files in subdirectories of the specified path will also be inserted.\n\n## Usage\n\n### Insert Markdown file\n\nOpen your Markdown file (a post or page) and include this custom tag:\n\n```md\n{% insertmd your/file.md %}\n```\n\n### Insert separator\n\nIf you want to specify a custom separator, that is rendered after each include, you can use:\n\n```md\n{% insertmd your/file.md '---' %}\n```\n\n### Insert Markdown files from directory\n\nInclude all Markdown files from a directory (and its subdirectories):\n\n```md\n{% insertmd your/directory/with/includes '---' %}\n```\n\n### Insert TOC on top of includes\n\nIf you want to render a table of contents (TOC) on top of your includes, you have to supply an empty object (`{}`) as third parameter to `insertmd`:\n\n```md\n{% insertmd your/directory/with/includes '---' '{}' %}\n```\n\nAll options from the [hexo-util tocObj](https://github.com/hexojs/hexo-util/tree/2.6.0#tocobjstr-options) are supported, so you can define the minimum and maximum level of TOC headings:\n\n```md\n{% insertmd error-ts/includes '---' '{ \"max_depth\": 2 }' %}\n```\n\nIt works without using a separator too:\n\n```md\n{% insertmd error-ts/includes '{ \"max_depth\": 2 }' %}\n```\n\n**Note:** The TOC options must be valid JSON (curly braces around objects and double quotes around property names).\n\n## FAQ\n\n\u003e What was your motivation?\n\nThis plugin was inspired by [hexo-include-markdown](https://github.com/tea3/hexo-include-markdown). It extends its functionality with syntax highlighting for [code blocks](https://hexo.io/docs/syntax-highlight.html#How-to-use-code-block-in-posts).\n\n\u003e Why is this plugin using tags (`{% ... %}`) instead of [helpers](https://hexo.io/docs/helpers) (`\u003c%- ... %\u003e`)?\n\nHelpers cannot be used in source files ([source](https://github.com/hexojs/site/pull/118)) which is why this plugin uses tags.\n\n\u003e How can I embed code?\n\nTo include code (JavaScript, TypeScript, etc.) you can use Hexo's built-in [codeblock](https://hexo.io/docs/tag-plugins.html#Code-Block) or [include_code](https://hexo.io/docs/tag-plugins.html#Include-Code) syntax. It works like this:\n\n```\n{% include_code lang:javascript my-code.js %}\n```\n\n**Note:** Your code files must be stored in the `source/downloads/code` directory of your Hexo blog.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennycode%2Fhexo-insert-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbennycode%2Fhexo-insert-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennycode%2Fhexo-insert-markdown/lists"}