Reverted logic to display readme/docs and added proper Docs language reference

This commit is contained in:
Djamil Legato
2020-10-19 13:29:09 -07:00
parent eace47f70a
commit 81f8fa8af0
4 changed files with 8 additions and 7 deletions

View File

@@ -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)

View File

@@ -71,6 +71,7 @@ PLUGIN_ADMIN:
LICENSE: "License"
DESCRIPTION: "Description"
README: "Readme"
DOCS: "Docs"
REMOVE_THEME: "Remove Theme"
INSTALL_THEME: "Install Theme"
THEME: "Theme"

View File

@@ -56,10 +56,10 @@
</tr>
{% 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') %}
<tr>
<td>{{ "PLUGIN_ADMIN.README"|tu }}:</td>
<td>{{ plugin.readme ? "PLUGIN_ADMIN.README"|tu : "PLUGIN_ADMIN.DOCS"|tu }}:</td>
<td class="double"><a href="{{ readme_link }}" target="_blank" rel="noopener noreferrer">{{ readme_link }}</a></td>
</tr>
{% endif %}

View File

@@ -88,10 +88,10 @@
</tr>
{% 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') %}
<tr>
<td>{{ "PLUGIN_ADMIN.README"|tu }}:</td>
<td>{{ plugin.readme ? "PLUGIN_ADMIN.README"|tu : "PLUGIN_ADMIN.DOCS"|tu }}:</td>
<td class="double"><a href="{{ readme_link }}" target="_blank" rel="noopener noreferrer">{{ readme_link }}</a></td>
</tr>
{% endif %}