From e1596fbdd5794fa8d6f3b4de5fabd6321b71b377 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 9 Feb 2021 15:43:24 +0100 Subject: [PATCH 1/3] Documentation feedback issue form (#16472) Co-authored-by: Martin Hjelmare --- .github/ISSUE_TEMPLATE.md | 26 ++++++++++++-- .github/ISSUE_TEMPLATE/DOCS_ISSUE.md | 11 ------ .github/ISSUE_TEMPLATE/feedback.yml | 51 ++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 14 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/DOCS_ISSUE.md create mode 100644 .github/ISSUE_TEMPLATE/feedback.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 73ec498014a..73f53af73d0 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,7 +1,27 @@ -## The problem +## Feedback + +## Details + + +URL: + + +Version: diff --git a/.github/ISSUE_TEMPLATE/DOCS_ISSUE.md b/.github/ISSUE_TEMPLATE/DOCS_ISSUE.md deleted file mode 100644 index 878ec4b21cb..00000000000 --- a/.github/ISSUE_TEMPLATE/DOCS_ISSUE.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: Website/Docs bug report -about: Report incorrect/missing information or other issues with our website. ---- -## The problem - - - diff --git a/.github/ISSUE_TEMPLATE/feedback.yml b/.github/ISSUE_TEMPLATE/feedback.yml new file mode 100644 index 00000000000..33a0edfc113 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feedback.yml @@ -0,0 +1,51 @@ +name: Documentation feedback +about: Provide feedback on a page on our website +title: "" +issue_body: true +inputs: + - type: description + attributes: | + Thanks for opening an issue to provide feedback on our website/documentation. + + Please note, this form is not for reporting bugs with running Home Assistant or its integrations. + Those bugs should be reported in the [Home Assistant Core issue tracker][core]. + + [core]: https://github.com/home-assistant/core/issues + - type: textarea + attributes: + label: Feedback + required: true + description: >- + Please be sure to provide feedback as clear as possible. Describe what + you think is incorrect or can be improved, and try to provide a + suggestion on how you think it can be improved or fixed. + - type: description + attributes: + value: | + ## Details + - type: input + attributes: + label: URL + required: true + placeholder: "http://www.home-assistant.io/..." + description: >- + A URL with a link to the page you are providing feedback for. + - type: input + attributes: + label: Version + required: false + placeholder: "e.g., 2021.2.0" + description: >- + Current version of the documentation. This usually matches the Home + Assistant Core release version, and can be found at the bottom of the + page. + - type: description + attributes: + value: | + ## Additional information + - type: description + attributes: + value: > + If you have any additional information for us, use the field below. + Please note, you can attach screenshots or screen recordings here, by + dragging and dropping files in the field below. From b7f76b05a0dd0476f323ba2d5fdf4a291fa75b6c Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 9 Feb 2021 16:18:35 +0100 Subject: [PATCH 2/3] Fix issue template --- .github/ISSUE_TEMPLATE/feedback.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feedback.yml b/.github/ISSUE_TEMPLATE/feedback.yml index 33a0edfc113..c84b7196d44 100644 --- a/.github/ISSUE_TEMPLATE/feedback.yml +++ b/.github/ISSUE_TEMPLATE/feedback.yml @@ -4,13 +4,14 @@ title: "" issue_body: true inputs: - type: description - attributes: | - Thanks for opening an issue to provide feedback on our website/documentation. + attributes: + value: | + Thanks for opening an issue to provide feedback on our website/documentation. - Please note, this form is not for reporting bugs with running Home Assistant or its integrations. - Those bugs should be reported in the [Home Assistant Core issue tracker][core]. + Please note, this form is not for reporting bugs with running Home Assistant or its integrations. + Those bugs should be reported in the [Home Assistant Core issue tracker][core]. - [core]: https://github.com/home-assistant/core/issues + [core]: https://github.com/home-assistant/core/issues - type: textarea attributes: label: Feedback @@ -28,14 +29,14 @@ inputs: label: URL required: true placeholder: "http://www.home-assistant.io/..." - description: >- + description: > A URL with a link to the page you are providing feedback for. - type: input attributes: label: Version required: false placeholder: "e.g., 2021.2.0" - description: >- + description: > Current version of the documentation. This usually matches the Home Assistant Core release version, and can be found at the bottom of the page. From ba6d8174ec204283790100adf311f3d33d072940 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 9 Feb 2021 21:24:56 +0100 Subject: [PATCH 3/3] Add feedback block to all pages (#16474) --- plugins/environment_variables.rb | 28 ++++++++++++---- sass/custom/_paulus.scss | 4 +++ .../_includes/asides/cookbook_navigation.html | 33 +++++++++---------- .../asides/getting_started_navigation.html | 26 +++++++++------ source/_includes/asides/help_navigation.html | 13 ++++---- .../_includes/asides/lovelace_navigation.html | 7 ++-- source/_includes/edit_github.html | 21 ++++++++++-- source/_layouts/page.html | 18 +++------- 8 files changed, 92 insertions(+), 58 deletions(-) diff --git a/plugins/environment_variables.rb b/plugins/environment_variables.rb index 9611050ffd9..26f2936a0b9 100644 --- a/plugins/environment_variables.rb +++ b/plugins/environment_variables.rb @@ -1,17 +1,33 @@ module Jekyll class EnvironmentVariablesGenerator < Generator def generate(site) + # https://www.netlify.com/docs/continuous-deployment/#build-environment-variables - repo_url = ENV['REPOSITORY_URL'] || 'https://github.com/home-assistant/home-assistant.io' + repository_url = ENV['REPOSITORY_URL'] || 'https://github.com/home-assistant/home-assistant.io' # Rewrite urls if repo url is the ssh format. - if repo_url.start_with? 'git@github.com:' - repo_url = repo_url.sub 'git@github.com:', 'https://github.com/' + if repository_url.start_with? 'git@github.com:' + repository_url = repository_url.sub 'git@github.com:', 'https://github.com/' end - # These values will be available as {{ site.NLY_REPOSITORY_URL }} - site.config['NLY_REPOSITORY_URL'] = repo_url - site.config['NLY_HEAD'] = ENV['HEAD'] || 'current' + # Figure out deployment URL + url = site.config['url'] + if ENV['context'].eql?('production') + url = ENV['URL'] || url + elsif ENV['context'].eql?('branch-deploy') + url = ENV['DEPLOY_URL'] || url + end + url = url.chomp('/') + + # These values will be available as {{ site.netlify.* }} + site.config['netlify'] = { + 'repository_url' => repository_url, + 'branch' => ENV['BRANCH'] || 'current', + 'commit' => ENV['COMMIT_REF'] || '', + 'head' => ENV['HEAD'] || 'current', + 'url' => url, + 'pull_request' => ENV['PULL_REQUEST'].eql?('true'), + } end end end diff --git a/sass/custom/_paulus.scss b/sass/custom/_paulus.scss index 2175b84ad65..6f4dbb2eb8b 100644 --- a/sass/custom/_paulus.scss +++ b/sass/custom/_paulus.scss @@ -47,6 +47,10 @@ $primary-color: #049cdb; padding-right: 5px; padding-left: 5px; } + + .feedback { + margin-bottom: 32px; + } } .hero { diff --git a/source/_includes/asides/cookbook_navigation.html b/source/_includes/asides/cookbook_navigation.html index 46fe38558c1..8713bb4bf16 100644 --- a/source/_includes/asides/cookbook_navigation.html +++ b/source/_includes/asides/cookbook_navigation.html @@ -1,27 +1,26 @@
- {% include edit_github.html %} {% assign cookbook = site.cookbook | sort_natural: 'title' %} -
- Back to the cookbook + -
+

{{page.ha_category}}

-
    - {% for recipe in cookbook %} - {% if recipe.ha_category == page.ha_category %} -
  • - {% if recipe.url == page.url %} - {{recipe.title}} - {% elsif recipe.ha_external_link %} - {{recipe.title}} - {% else %} - {{recipe.title}} - {% endif %} -
  • +
      + {% for recipe in cookbook %} {% if recipe.ha_category == page.ha_category + %} +
    • + {% if recipe.url == page.url %} {{recipe.title}} {% elsif + recipe.ha_external_link %} + {{recipe.title}} + {% else %} + {{recipe.title}} {% endif %} - {% endfor %} +
    • + {% endif %} {% endfor %}
diff --git a/source/_includes/asides/getting_started_navigation.html b/source/_includes/asides/getting_started_navigation.html index 771a222c91b..32653342fad 100644 --- a/source/_includes/asides/getting_started_navigation.html +++ b/source/_includes/asides/getting_started_navigation.html @@ -1,15 +1,21 @@
- {% include edit_github.html %} - -
+

Getting Started

-
diff --git a/source/_includes/asides/help_navigation.html b/source/_includes/asides/help_navigation.html index 519b3b989c6..532719243d0 100644 --- a/source/_includes/asides/help_navigation.html +++ b/source/_includes/asides/help_navigation.html @@ -1,21 +1,20 @@
- {% include edit_github.html %} -