diff --git a/CHANGELOG.md b/CHANGELOG.md index 36066a70..f6e3884c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # v1.10.0-rc.18 ## mm/dd/2020 +1. [](#improved) + * Auto-link a plugin/theme license in details if it starts with `http` + * Don't link to readme unless a `readme:` is provided in blueprint 1. [](#bugfix) * Fixed Safari issue with new ACL picker field [#1955](https://github.com/getgrav/grav-plugin-admin/issues/1955) diff --git a/themes/grav/templates/partials/plugin-data.html.twig b/themes/grav/templates/partials/plugin-data.html.twig index 6ce89d23..daf7ccad 100644 --- a/themes/grav/templates/partials/plugin-data.html.twig +++ b/themes/grav/templates/partials/plugin-data.html.twig @@ -41,7 +41,11 @@ {% if plugin.license %} {{ "PLUGIN_ADMIN.LICENSE"|tu }}: - {{ plugin.license }} + {% if plugin.license|starts_with('http') %} + {{ plugin.license }} + {% else %} + {{ plugin.license }} + {% endif %} {% endif %} @@ -52,8 +56,8 @@ {% endif %} - {% if plugin.readme or plugin.homepage %} - {% set readme_link = plugin.readme ?: plugin.docs|default(plugin.homepage ~ '/blob/master/README.md') %} + {% if plugin.readme %} + {% set readme_link = plugin.readme %} {{ "PLUGIN_ADMIN.README"|tu }}: {{ readme_link }} diff --git a/themes/grav/templates/partials/themes-details.html.twig b/themes/grav/templates/partials/themes-details.html.twig index 7cfdf466..5bfb2f5d 100644 --- a/themes/grav/templates/partials/themes-details.html.twig +++ b/themes/grav/templates/partials/themes-details.html.twig @@ -74,7 +74,11 @@ {% if theme.license %} {{ "PLUGIN_ADMIN.LICENSE"|tu }}: - {{ theme.license }} + {% if theme.license|starts_with('http') %} + {{ theme.license }} + {% else %} + {{ theme.license }} + {% endif %} {% endif %} {% if theme.description %} @@ -84,8 +88,8 @@ {% endif %} - {% if theme.readme or theme.homepage %} - {% set readme_link = theme.readme ?: theme.homepage ~ '/blob/master/README.md' %} + {% if theme.readme %} + {% set readme_link = theme.readme %} {{ "PLUGIN_ADMIN.README"|tu }}: {{ readme_link }}