{"id":18565308,"url":"https://github.com/pelican-plugins/injector","last_synced_at":"2025-10-25T19:43:57.068Z","repository":{"id":177584048,"uuid":"657492994","full_name":"pelican-plugins/injector","owner":"pelican-plugins","description":"Pelican plugin to inject custom code before or after specific HTML tags, without modifying your theme.","archived":false,"fork":false,"pushed_at":"2024-07-07T16:46:46.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-23T05:56:20.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/pelican-plugins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"justinmayer","liberapay":"pelican"}},"created_at":"2023-06-23T07:21:56.000Z","updated_at":"2023-08-08T11:22:11.000Z","dependencies_parsed_at":"2025-04-10T04:33:43.696Z","dependency_job_id":"aefd724f-fe91-424a-a7d8-0d2c9e4cd801","html_url":"https://github.com/pelican-plugins/injector","commit_stats":null,"previous_names":["pelican-plugins/injector"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pelican-plugins/injector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Finjector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Finjector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Finjector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Finjector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pelican-plugins","download_url":"https://codeload.github.com/pelican-plugins/injector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Finjector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281012083,"owners_count":26429437,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-06T22:18:18.812Z","updated_at":"2025-10-25T19:43:57.053Z","avatar_url":"https://github.com/pelican-plugins.png","language":"Python","funding_links":["https://github.com/sponsors/justinmayer","https://liberapay.com/pelican"],"categories":[],"sub_categories":[],"readme":"# Injector: A Plugin for Pelican\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/injector/main.yml?branch=main)](https://github.com/pelican-plugins/injector/actions)\n[![PyPI Version](https://img.shields.io/pypi/v/pelican-injector)](https://pypi.org/project/pelican-injector/)\n![License](https://img.shields.io/pypi/l/pelican-injector?color=blue)\n\nInjector is a plugin for the [Pelican](https://github.com/getpelican/pelican) static site generator that allows users to inject custom code before or after specific HTML tags, without modifying your theme.\n\n## Installation\n\nThis plugin can be installed via:\n\n    python -m pip install pelican-injector\n\nAs long as you have not explicitly added a `PLUGINS` setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add `injector` to your existing `PLUGINS` list. For more information, please see the [How to Use Plugins](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.\n\n## Settings\n\nTo configure the plugin, set the `INJECTOR_ITEMS` variable in your\nPelican settings file. This should be a list of tuples, each with two\nor three elements, according to this table:\n\n| Tuple Element | Description |\n| ------ | ----------- |\n| First | Name of the HTML tag where you want to inject your code |\n| Second | The code you want to inject |\n| Third (optional) | Specifies where to inject the code: 'before' or 'after'. If not provided, it defaults to 'after' |\n\n```python\nINJECTOR_ITEMS = [\n    ('head', '\u003cscript\u003e...\u003c/script\u003e', 'after'),\n    ('body', '\u003cdiv\u003e...\u003c/div\u003e', 'before'),\n    // add more tags and code as needed\n]\n```\n\nIn the following example, a script logging \"Hello, world!\" to the console is\ninjected into the `\u003chead\u003e` tag of each page, and a style block is injected\nbefore the `\u003cbody\u003e` tag.\n\n```python\nINJECTOR_ITEMS = [\n    ('head', '\u003cscript\u003econsole.log(\"Hello, world!\");\u003c/script\u003e'),\n    ('body', '\u003cstyle\u003e.custom-style { color: red; }\u003c/style\u003e', 'before'),\n]\nINJECTOR_IN_PAGES = True\nINJECTOR_IN_ARTICLES = False\n```\n\n## Contributing\n\nContributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].\n\nTo start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.\n\n[existing issues]: https://github.com/pelican-plugins/injector/issues\n[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html\n\n## License\n\nThis project is licensed under the [MIT license](https://opensource.org/licenses/MIT).\n\n## Contact\n\nIf you have any questions or feedback, please open an issue on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpelican-plugins%2Finjector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpelican-plugins%2Finjector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpelican-plugins%2Finjector/lists"}