diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2024-06-14 06:45:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-14 04:45:52 +0000 |
commit | 4e7b067a7fdfb3e2c8dfdf87475e3938051fd400 (patch) | |
tree | d481ee424bd8c7509935e71b109b7b352f188266 /templates/package | |
parent | fa82a8af12ece9eaf78a0cf9d9330adb60c01724 (diff) | |
download | gitea-4e7b067a7fdfb3e2c8dfdf87475e3938051fd400.tar.gz gitea-4e7b067a7fdfb3e2c8dfdf87475e3938051fd400.zip |
Extract and display readme and comments for Composer packages (#30927)
Related #30075
CC @thojo0
Example with rendered readme:
![grafik](https://github.com/go-gitea/gitea/assets/1666336/3516fef5-2631-40fd-8841-5d9894ec8904)
Diffstat (limited to 'templates/package')
-rw-r--r-- | templates/package/content/composer.tmpl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/templates/package/content/composer.tmpl b/templates/package/content/composer.tmpl index c2dc6345c3..8d48e6c95d 100644 --- a/templates/package/content/composer.tmpl +++ b/templates/package/content/composer.tmpl @@ -22,11 +22,11 @@ </div> </div> - {{if .PackageDescriptor.Metadata.Description}} + {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Comments}} <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> - <div class="ui attached segment"> - {{.PackageDescriptor.Metadata.Description}} - </div> + {{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment markup markdown">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Comments}}<div class="ui attached segment">{{StringUtils.Join .PackageDescriptor.Metadata.Comments " "}}</div>{{end}} {{end}} {{if or .PackageDescriptor.Metadata.Require .PackageDescriptor.Metadata.RequireDev}} @@ -39,7 +39,7 @@ </div> {{end}} - {{if or .PackageDescriptor.Metadata.Keywords}} + {{if .PackageDescriptor.Metadata.Keywords}} <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4> <div class="ui attached segment"> {{range .PackageDescriptor.Metadata.Keywords}} |