From e00c030fef92ad57c62394bc729fd99e4ebc319a Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 14 Feb 2019 16:07:26 +0100 Subject: [PATCH] :ambulance: Fixes source links (#8560) --- .../asides/component_navigation.html | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/source/_includes/asides/component_navigation.html b/source/_includes/asides/component_navigation.html index d9c4b26c9ce..21fd0aec209 100644 --- a/source/_includes/asides/component_navigation.html +++ b/source/_includes/asides/component_navigation.html @@ -1,5 +1,5 @@ {%- assign components = site.components | sort_natural: 'title' -%} -{%- assign github_main_repo = 'https://github.com/home-assistant/home-assistant/blob/master/homeassistant' -%} +{%- assign github_main_repo = 'https://github.com/home-assistant/home-assistant/blob/dev/homeassistant' -%}
{%- include edit_github.html -%} @@ -14,13 +14,15 @@ {%- if file_parts.size == 2 -%} {%- assign is_platform = true -%} {%- assign imp_name = file_parts[1] -%} + {%- assign imp_url = imp_name | prepend: '/components/' | append: '/' -%} {%- assign parent_name = file_parts[0] -%} {%- assign parent_url = parent_name | prepend: '/components/' | append: '/' -%} - {%- assign parent_component = components | where: 'url', parent_url | first -%} + {%- assign parent_component = components | where: 'url', imp_url | first -%} {%- else -%} {%- assign is_platform = false -%} {%- assign imp_name = file_parts | first -%} - {%- endif -%} + {%- assign imp_url = imp_name | prepend: '/components/' | append: '/' -%} +{%- endif -%} {%- if page.ha_iot_class -%}
@@ -56,12 +58,13 @@
{%- endif -%} - {%- if is_platform -%} - - {%- endif -%} +
+ {%- if is_platform -%} + Source: {{imp_name}}/{{parent_name}}.py + {%- else -%} + Source: {{imp_url}} + {%- endif -%} +
{%- if is_platform and parent_name != 'sensor' -%}