From f5bb62cc77f93afe7f51b179cbf485b1f0549621 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Wed, 29 Jul 2015 15:37:23 +0200 Subject: [PATCH] Readme link for plugins and themes. If [theme|plugin].readme is set, use that, otherwise append /blob/develop/README.md to theme/plugin homepage url --- themes/grav/templates/partials/plugin-data.html.twig | 9 +++++++++ themes/grav/templates/partials/themes-details.html.twig | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/themes/grav/templates/partials/plugin-data.html.twig b/themes/grav/templates/partials/plugin-data.html.twig index 3f6355a2..dcb1dbeb 100644 --- a/themes/grav/templates/partials/plugin-data.html.twig +++ b/themes/grav/templates/partials/plugin-data.html.twig @@ -51,4 +51,13 @@ {{ plugin.description_html }} {% endif %} + + {% if plugin.readme or plugin.homepage %} + {% set readme_link = plugin.readme ?: plugin.homepage ~ '/blob/develop/README.md' %} + + Readme: + {{ readme_link }} + + {% endif %} + \ No newline at end of file diff --git a/themes/grav/templates/partials/themes-details.html.twig b/themes/grav/templates/partials/themes-details.html.twig index 5fc8da83..44cb15d7 100644 --- a/themes/grav/templates/partials/themes-details.html.twig +++ b/themes/grav/templates/partials/themes-details.html.twig @@ -84,6 +84,14 @@ {{ theme.description_html }} {% endif %} + + {% if theme.readme or theme.homepage %} + {% set readme_link = theme.readme ?: theme.homepage ~ '/blob/develop/README.md' %} + + Readme: + {{ readme_link }} + + {% endif %}