diff --git a/CHANGELOG.md b/CHANGELOG.md index f6e3884c..13467c99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ 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 + * Allow to fallback to `docs:` instead of `readme:` 1. [](#bugfix) * Fixed Safari issue with new ACL picker field [#1955](https://github.com/getgrav/grav-plugin-admin/issues/1955) diff --git a/languages/en.yaml b/languages/en.yaml index ff69a872..945224e2 100644 --- a/languages/en.yaml +++ b/languages/en.yaml @@ -71,6 +71,7 @@ PLUGIN_ADMIN: LICENSE: "License" DESCRIPTION: "Description" README: "Readme" + DOCS: "Docs" REMOVE_THEME: "Remove Theme" INSTALL_THEME: "Install Theme" THEME: "Theme" diff --git a/themes/grav/templates/partials/plugin-data.html.twig b/themes/grav/templates/partials/plugin-data.html.twig index daf7ccad..ebf7da1c 100644 --- a/themes/grav/templates/partials/plugin-data.html.twig +++ b/themes/grav/templates/partials/plugin-data.html.twig @@ -56,10 +56,10 @@ {% endif %} - {% if plugin.readme %} - {% set readme_link = plugin.readme %} + {% if plugin.readme or plugin.homepage %} + {% set readme_link = plugin.readme ?: plugin.docs|default(plugin.homepage ~ '/blob/master/README.md') %} - {{ "PLUGIN_ADMIN.README"|tu }}: + {{ plugin.readme ? "PLUGIN_ADMIN.README"|tu : "PLUGIN_ADMIN.DOCS"|tu }}: {{ readme_link }} {% endif %} diff --git a/themes/grav/templates/partials/themes-details.html.twig b/themes/grav/templates/partials/themes-details.html.twig index 5bfb2f5d..c77e3ccc 100644 --- a/themes/grav/templates/partials/themes-details.html.twig +++ b/themes/grav/templates/partials/themes-details.html.twig @@ -88,10 +88,10 @@ {% endif %} - {% if theme.readme %} - {% set readme_link = theme.readme %} + {% if theme.readme or theme.homepage %} + {% set readme_link = theme.readme ?: theme.docs|default(theme.homepage ~ '/blob/master/README.md') %} - {{ "PLUGIN_ADMIN.README"|tu }}: + {{ plugin.readme ? "PLUGIN_ADMIN.README"|tu : "PLUGIN_ADMIN.DOCS"|tu }}: {{ readme_link }} {% endif %}