forked from tk-sls.de/linuxfoo-gitlab
53 lines
2.4 KiB
Markdown
53 lines
2.4 KiB
Markdown
# linuxfoo-gitea
|
|
|
|
## Summary
|
|
|
|
Embed a list of the most recent commits to a Gitea project. Information is retrieved from a specified Gitea instance's public REST API.
|
|
|
|
## Shortcode `gitea-show-project`
|
|
|
|
### Examples
|
|
|
|
Add the following shortcode for a list of at most 5 commits to that project:
|
|
|
|
```
|
|
[gitea-show-project url="https://tk-sls.de/git" project_owner=tk-sls.de project_repo=linuxfoo-gitea max=5]
|
|
```
|
|
|
|
Add the following shortcode for a list of at most 3 commits followed by a link to the latest release:
|
|
|
|
```
|
|
[gitea-show-project url="https://tk-sls.de/git" project_owner=tk-sls.de project_repo=linuxfoo-gitea max=3 releases="latest"]
|
|
```
|
|
|
|
Add the following shortcode to just link to the Gitlab project, without a list of commits or releases:
|
|
|
|
```
|
|
[gitea-show-project url="https://tk-sls.de/git" project_owner=tk-sls.de project_repo=linuxfoo-gitea commit="none" releases="none"]
|
|
```
|
|
|
|
### Attributes
|
|
|
|
The following attributes are mandatory:
|
|
|
|
* `url="STRING"`: Base URL of Git instance (example: `https://tk-sls.de/git`).
|
|
* `project_owner=STRING`: ; `STRING`: User or organisation owning the repository in Gitea (examples: `tilman`, `tk-sls.de`).
|
|
* `project_repo=STRING`: ; `STRING`: Name of repository in Gitea (examples: `tilman`, `tk-sls.de`).
|
|
|
|
The following optional attributes enable or disable additional project information:
|
|
|
|
* `commits="STRING"`: Optional; if set, `STRING` can be either `all` (show a list of recent commits, the default) or `none` (do not show a list of recent commits).
|
|
* `releases=STRING`: Optional; if set, `STRING` can be either `all` (show a list of all releases of this project, if any) or `latest` (show a link to the latest release of this project, if any) or `none` (do not show releases of this project, the default).
|
|
|
|
The following optional attributes modify the behavior of the list of commits:
|
|
|
|
* `max=NUM`: Optional; `NUM`: Positive integer; list not more than `NUM` commits (example: `5`).
|
|
* `ref_name=STRING`: Optional: list only commit from branch or reference name `STRING` (examples: `main`, `v1.1`).
|
|
* `default_branch`: Optional; if set, list only commits from the project's default branch.
|
|
* `author="none"`: Optional; do not print names of authors in the commit list.
|
|
|
|
## Author and License
|
|
|
|
* Copyleft 2023 Tilman Kranz <[t.kranz@tk-sls.de](mailto:t.kranz@tk-sls.de)>
|
|
* License: MIT License [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)
|