{"id":15450402,"url":"https://github.com/timkley/eleventy-plugin-torchlight","last_synced_at":"2025-04-19T22:58:34.446Z","repository":{"id":57222346,"uuid":"404988305","full_name":"timkley/eleventy-plugin-torchlight","owner":"timkley","description":"Plugin for the static site generator Eleventy to syntax highlight your code blocks with torchlight.dev.","archived":false,"fork":false,"pushed_at":"2024-04-27T13:35:42.000Z","size":315,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T13:51:19.936Z","etag":null,"topics":["eleventy","eleventy-plugin","torchlight"],"latest_commit_sha":null,"homepage":"","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/timkley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-10T07:07:49.000Z","updated_at":"2024-04-27T13:35:13.000Z","dependencies_parsed_at":"2025-03-03T04:40:56.342Z","dependency_job_id":null,"html_url":"https://github.com/timkley/eleventy-plugin-torchlight","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":"5t3ph/eleventy-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkley%2Feleventy-plugin-torchlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkley%2Feleventy-plugin-torchlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkley%2Feleventy-plugin-torchlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkley%2Feleventy-plugin-torchlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timkley","download_url":"https://codeload.github.com/timkley/eleventy-plugin-torchlight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249826664,"owners_count":21330673,"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":["eleventy","eleventy-plugin","torchlight"],"created_at":"2024-10-01T21:05:07.857Z","updated_at":"2025-04-19T22:58:34.408Z","avatar_url":"https://github.com/timkley.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eleventy-plugin-torchlight\n\nThis is a plugin for the static site generator [Eleventy](https://11ty.dev) to syntax highlight your code blocks with [torchlight.dev](https://torchlight.dev).\n\n## Prerequisites\n\nTo use this plugin you need to be registered on [torchlight.dev](https://torchlight.dev) and have obtained an API key.\n\n## Installation\n\n```bash\nnpm install eleventy-plugin-torchlight #or\nyarn add eleventy-plugin-torchlight\n```\n\nThen, include it in your `.eleventy.js` config file:\n\n```js\nconst torchlight = require('eleventy-plugin-torchlight');\n\nmodule.exports = (eleventyConfig) =\u003e {\n  eleventyConfig.addPlugin(torchlight);\n};\n```\n\n## Configuration\n\nRun `npx torchlight init` to initialize a default torchlight config. If you don't create a config yourself this plugin assumes this defaults to match 11ty's\ndefaults:\n\n```\n{\n    token: process.env.TORCHLIGHT_TOKEN,\n    highlight: {\n        input: '_site'\n    }\n}\n```\n\n\u003e If you create a new config remember to update the config to match the input path of Eleventy!\n\nTo verify everything works you can run Eleventy like this to pass the token as environment variable:\n\n```\nTORCHLIGHT_TOKEN=your_token npm run start\n```\n\nYour code should now be highlighted.\n\nIf you are for example using Netflify you can add the token via your site's settings so it's available during the build.\n\n### Cache\n\nTorchlight uses a cache to prevent highlighting code blocks that don't have changed.  \nBy default it uses a [file based cache](https://torchlight.dev/docs/clients/cli#cache) which created a directory called `cache`.\n\nMake sure you add this folder to your `.eleventyignore` file so it doesn't trigger rebuilds after highlighting your output files.\n\n## Credits\n\nThanks to [@5t3ph](https://twitter.com/5t3ph) for her [eleventy-plugin-template](https://github.com/5t3ph/eleventy-plugin-template)\nand [Aaron Francis](https://twitter.com/aarondfrancis) for [Torchlight](https://torchlight.dev).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkley%2Feleventy-plugin-torchlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimkley%2Feleventy-plugin-torchlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkley%2Feleventy-plugin-torchlight/lists"}