{"id":28378810,"url":"https://github.com/typecho/plugin-template","last_synced_at":"2025-06-28T15:37:33.213Z","repository":{"id":212974915,"uuid":"732310264","full_name":"typecho/plugin-template","owner":"typecho","description":"A template for creating plugins for Typecho","archived":false,"fork":false,"pushed_at":"2025-05-09T10:03:49.000Z","size":18,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-06T02:38:55.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/typecho.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-16T08:48:11.000Z","updated_at":"2025-05-09T10:03:53.000Z","dependencies_parsed_at":"2023-12-17T18:24:41.856Z","dependency_job_id":"3819191c-5d08-42af-8f2b-0b8dc28b2e96","html_url":"https://github.com/typecho/plugin-template","commit_stats":null,"previous_names":["typecho/plugin-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/typecho/plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typecho%2Fplugin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typecho%2Fplugin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typecho%2Fplugin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typecho%2Fplugin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typecho","download_url":"https://codeload.github.com/typecho/plugin-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typecho%2Fplugin-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261032033,"owners_count":23100047,"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":"2025-05-30T02:07:21.319Z","updated_at":"2025-06-28T15:37:33.208Z","avatar_url":"https://github.com/typecho.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typecho Plugin Template\n\nThis is a template for developing Typecho plugins.\n\n[中文说明](README.zh-CN.md)\n\n## How to Use\n\nClick the \"Use this template\" button to create a new repository from this template.\n\n## Suggested Directory Structure\n\n```\nLICENSE\nREADME.md\n/plugin\n    ├── Plugin.php\n    ├── ...\n```\n\nAll source code should be placed in the `/plugin` directory.\n\n## Plugin.php\n\nThe `Plugin.php` file is the main file of the plugin. It should contain a class named `Plugin` which implements the `Typecho\\Plugin\\PluginInterface` interface.\n\n```php\n\nnamespace TypechoPlugin\\Example;\n\nuse Typecho\\Plugin\\PluginInterface;\n\n/**\n * Example plugin.\n *\n * @package Example\n * @author Typecho\n * @version %version%\n * @link https://typecho.org\n */\nclass Plugin implements PluginInterface\n{\n    // Methods to implement the PluginInterface.\n}\n```\n\n⚠️ Important notes:\n\n- The namespace of the plugin should be `TypechoPlugin\\{PluginName}`. For example, if the plugin name is `Example`, the namespace should be `TypechoPlugin\\Example`. This is required for the plugin to be loaded by Typecho.\n- The version of the plugin should be replaced with `%version%`. The version number will be replaced by the build script automatically. **Do not** replace the version number manually.\n\nNaming rules:\n\n- The plugin name should contain only letters, numbers.\n- The plugin name should be in PascalCase.\n\nExamples:\n\n- `Example` is a valid plugin name.\n- `ExamplePlugin` is a valid plugin name.\n- `Example-Plugin` is not a valid plugin name.\n- `Example_Plugin` is not a valid plugin name.\n\n## Debugging \u0026 Development\n\nUse soft links to link the plugin directory to the `usr/plugins` directory of Typecho.\n\nFor example, if here is the directory structure of the plugin project and the Typecho project:\n\n```\n/path/to/plugin\n    ├── /plugin\n    │   ├── Plugin.php\n    │   ├── ...\n    │   └── ...\n    └── ...\n/path/to/typecho\n    ├── /usr\n    │   ├── /plugins\n    │   │   ├── /Example\n    │   │   │   ├── Plugin.php\n    │   │   │   ├── ...\n    │   │   │   └── ...\n    │   │   └── ...\n    │   └── ...\n    └── ...\n```\n\nRun the following command in the `/path/to/typecho/usr/plugins` directory:\n\n```bash\nln -s /path/to/plugin/plugin Example\n```\n\nThen you can debug and develop the plugin in the `/path/to/plugin` directory. The plugin directory name `Example` is the same as the plugin name.\n\nNote: If you are using Windows, you can use [mklink](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink) to create soft links.\n\n## Release Steps\n\nCreate a release on GitHub and name a tag with the version number. For example, if the version number is `1.0.0`, the tag name should be `1.0.0` or `v1.0.0`.\n\nThe build script will automatically create a zip file for the release and upload it to the release page.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypecho%2Fplugin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypecho%2Fplugin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypecho%2Fplugin-template/lists"}