2023-09-23 15:40:13 +02:00
# linuxfoo-gitea
2021-11-27 03:40:05 +01:00
## Summary
2023-09-23 15:40:13 +02:00
Embed a list of the most recent commits to a Gitea project. Information is retrieved from a specified Gitea instance's public REST API.
2021-11-27 03:40:05 +01:00
2023-09-23 15:40:13 +02:00
## Shortcode `gitea-show-project`
2021-11-27 03:40:05 +01:00
2021-11-27 16:50:54 +01:00
### Examples
2021-11-27 03:40:05 +01:00
2023-09-23 15:40:13 +02:00
Add the following shortcode for a list of at most 5 commits to that project:
2021-11-27 11:28:39 +01:00
```
2023-09-23 15:40:13 +02:00
[gitea-show-project url="https://tk-sls.de/git" project_owner=tk-sls.de project_repo=linuxfoo-gitea max=5]
2021-11-27 16:50:54 +01:00
```
Add the following shortcode for a list of at most 3 commits followed by a link to the latest release:
```
2023-09-23 15:40:13 +02:00
[gitea-show-project url="https://tk-sls.de/git" project_owner=tk-sls.de project_repo=linuxfoo-gitea max=3 releases="latest"]
2021-11-27 20:04:17 +01:00
```
Add the following shortcode to just link to the Gitlab project, without a list of commits or releases:
```
2023-09-23 15:40:13 +02:00
[gitea-show-project url="https://tk-sls.de/git" project_owner=tk-sls.de project_repo=linuxfoo-gitea commit="none" releases="none"]
2021-11-27 11:28:39 +01:00
```
2021-11-27 03:40:05 +01:00
### Attributes
2021-11-27 20:04:17 +01:00
The following attributes are mandatory:
2023-09-23 15:40:13 +02:00
* `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` ).
2021-11-27 20:04:17 +01:00
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:
2021-11-27 11:28:39 +01:00
* `max=NUM` : Optional; `NUM` : Positive integer; list not more than `NUM` commits (example: `5` ).
2021-11-27 16:50:54 +01:00
* `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.
2022-01-01 08:08:04 +01:00
* `author="none"` : Optional; do not print names of authors in the commit list.
2021-11-27 03:40:05 +01:00
## Author and License
2023-09-23 15:40:13 +02:00
* Copyleft 2023 Tilman Kranz < [t.kranz@tk-sls.de](mailto:t.kranz@tk-sls.de)>
2021-11-27 03:40:05 +01:00
* License: MIT License [https://opensource.org/licenses/MIT ](https://opensource.org/licenses/MIT )