{"id":17924524,"url":"https://github.com/itpropro/hexo-tag-ghcode","last_synced_at":"2025-04-03T09:24:52.604Z","repository":{"id":37991957,"uuid":"195794166","full_name":"itpropro/hexo-tag-ghcode","owner":"itpropro","description":"Hexo plugin to insert code from GitHub","archived":false,"fork":false,"pushed_at":"2023-12-15T20:32:22.000Z","size":6,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-02T21:18:41.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itpropro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-08T10:57:48.000Z","updated_at":"2020-11-07T01:14:00.000Z","dependencies_parsed_at":"2022-09-06T19:51:30.789Z","dependency_job_id":null,"html_url":"https://github.com/itpropro/hexo-tag-ghcode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpropro%2Fhexo-tag-ghcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpropro%2Fhexo-tag-ghcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpropro%2Fhexo-tag-ghcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpropro%2Fhexo-tag-ghcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itpropro","download_url":"https://codeload.github.com/itpropro/hexo-tag-ghcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246971500,"owners_count":20862753,"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":[],"created_at":"2024-10-28T20:49:04.782Z","updated_at":"2025-04-03T09:24:52.567Z","avatar_url":"https://github.com/itpropro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hexo-tag-github-code\n\n**Taken over from [hexo-tag-github-code](https://github.com/itpropro/hexo-tag-ghcode), as the author [nkmk](https://github.com/nkmk) has stopped maintaining the repository.**\n\nInsert code from [GitHub](https://github.com/) when static files are generated.\n\nNot embed.\n\n## Install\n\n```sh\n$ npm install hexo-tag-github-code --save\n```\n\n## Usage\n```\n{% ghcode URL [start_line stop_line] [options] %}\n```\n\n## Support URL\n### GitHub / Gist\n- URL of each file page as below\n  - https://github.com/itpropro/hexo-tag-ghcode/blob/master/index.js\n  - https://gist.github.com/nkmk/d60cdbcffdb60d624ac01871543f79a2\n  - https://gist.github.com/nkmk/d60cdbcffdb60d624ac01871543f79a2#file-sample-py\n- URL links to raw file as below\n  - https://raw.githubusercontent.com/itpropro/hexo-tag-ghcode/master/index.js\n  - https://gist.githubusercontent.com/nkmk/d60cdbcffdb60d624ac01871543f79a2/raw/e7528c00addcdd0b4d00cb9bbd8d225cc132fbfc/sample.py\n- URL of github permalink\n  - https://github.com/itpropro/hexo-tag-ghcode/blob/master/index.js#L5-L16\n  - https://github.com/itpropro/hexo-tag-ghcode/blob/master/index.js#L116\n\n### Other site\nIf URL links to raw file, it will work.\n\n## Options\n\nSet like as `{cap:false,re:true,lang:javascript}`. Please do __NOT__ insert any spaces.\n\n| option | description | default |\n| :--- | :--- | :--- |\n| cap| `true`: show caption\u003cbr\u003e `false`: no caption | `true` |\n| re| `true`: the first line number restart from 1\u003cbr\u003e `false`: the first line number start from original code number | `false` |\n| lang| the language to use for highlighting | the extension of the file |\n\n### Config setting\n\nYou can change default settings in `_config.yml` as below.\n\n```yml\ngithub_code:\n  cap: false\n  re: true\n```\n\n\n## Examples\n\n### Full code\n```\n{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js %}\n```\n\n### Selected lines\nInsert code from line 17 to line 22.\n```\n{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 %}\n```\n\n![Selected lines](https://i.gyazo.com/babfb9ad3851b5a3f4267636ccc8a70d.png)\n\n### Without caption\n```\n{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 {cap:false} %}\n```\n\n![Without caption](https://i.gyazo.com/d1e0f94c5041371fc26e5bdc9033edf6.png)\n\n### Restart the first line number from 1\n```\n{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 {re:true} %}\n```\n\n![Restart the first line number from 1](https://i.gyazo.com/dc3611fc637352bbe5c57bf7d94f60f2.png)\n\n\n### Force the language highlighting to HTML for a JavaScript file\n```\n{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 {lang:html} %}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitpropro%2Fhexo-tag-ghcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitpropro%2Fhexo-tag-ghcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitpropro%2Fhexo-tag-ghcode/lists"}