mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 07:17:14 +00:00
Add feedback block to all pages (#16474)
This commit is contained in:
parent
b7f76b05a0
commit
ba6d8174ec
@ -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
|
||||
|
@ -47,6 +47,10 @@ $primary-color: #049cdb;
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.feedback {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.hero {
|
||||
|
@ -1,27 +1,26 @@
|
||||
<section class="aside-module grid__item one-whole lap-one-half">
|
||||
{% include edit_github.html %}
|
||||
{% assign cookbook = site.cookbook | sort_natural: 'title' %}
|
||||
|
||||
<div class='section'>
|
||||
<a href='/cookbook'>Back to the cookbook</a>
|
||||
<div class="section">
|
||||
<a href="/cookbook">Back to the cookbook</a>
|
||||
</div>
|
||||
|
||||
<div class='section'>
|
||||
<div class="section">
|
||||
<h1 class="title delta">{{page.ha_category}}</h1>
|
||||
<ul class='divided'>
|
||||
{% for recipe in cookbook %}
|
||||
{% if recipe.ha_category == page.ha_category %}
|
||||
<ul class="divided">
|
||||
{% for recipe in cookbook %} {% if recipe.ha_category == page.ha_category
|
||||
%}
|
||||
<li>
|
||||
{% if recipe.url == page.url %}
|
||||
{{recipe.title}}
|
||||
{% elsif recipe.ha_external_link %}
|
||||
<a href='{{recipe.ha_external_link}}'>{{recipe.title}} <i class="icon-external-link"></i></a>
|
||||
{% if recipe.url == page.url %} {{recipe.title}} {% elsif
|
||||
recipe.ha_external_link %}
|
||||
<a href="{{recipe.ha_external_link}}"
|
||||
>{{recipe.title}} <i class="icon-external-link"></i
|
||||
></a>
|
||||
{% else %}
|
||||
<a href='{{recipe.url}}'>{{recipe.title}}</a>
|
||||
<a href="{{recipe.url}}">{{recipe.title}}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %} {% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -1,15 +1,21 @@
|
||||
<section class="aside-module grid__item one-whole lap-one-half">
|
||||
{% include edit_github.html %}
|
||||
|
||||
<div class='section'>
|
||||
<div class="section">
|
||||
<h1 class="title delta">Getting Started</h1>
|
||||
<ul class='divided sidebar-menu'>
|
||||
<li>{% active_link /getting-started/ Installation %}
|
||||
<ul class="divided sidebar-menu">
|
||||
<li>{% active_link /getting-started/ Installation %}</li>
|
||||
<li>{% active_link /getting-started/onboarding/ Onboarding %}</li>
|
||||
<li>{% active_link /getting-started/automation/ Automation %}</li>
|
||||
<li>{% active_link /getting-started/presence-detection/ Presence detection %}</li>
|
||||
<li>{% active_link /getting-started/join-the-community/ Join the community %}</li>
|
||||
<li>{% active_link /getting-started/configuration/ Advanced Configuration %}</li>
|
||||
<li>
|
||||
{% active_link /getting-started/presence-detection/ Presence detection
|
||||
%}
|
||||
</li>
|
||||
<li>
|
||||
{% active_link /getting-started/join-the-community/ Join the community
|
||||
%}
|
||||
</li>
|
||||
<li>
|
||||
{% active_link /getting-started/configuration/ Advanced Configuration %}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -1,21 +1,20 @@
|
||||
<section class="aside-module grid__item one-whole lap-one-half">
|
||||
{% include edit_github.html %}
|
||||
|
||||
<div class="section">
|
||||
<h1 class="title delta"> </h1>
|
||||
<ul class="divided sidebar-menu">
|
||||
<li>{% active_link /help/ Help %}</li>
|
||||
<li>
|
||||
{% active_link /help/ Help %}
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://developers.home-assistant.io">Developer documentation
|
||||
<a href="https://developers.home-assistant.io"
|
||||
>Developer documentation
|
||||
<i class="icon-external-link"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
Governance
|
||||
<ul>
|
||||
<li>{% active_link /developers/cla/ Contributor License Agreement %}</li>
|
||||
<li>
|
||||
{% active_link /developers/cla/ Contributor License Agreement %}
|
||||
</li>
|
||||
<li>{% active_link /privacy/ Privacy Policy %}</li>
|
||||
<li>{% active_link /tos/ Terms of Service %}</li>
|
||||
<li>{% active_link /code_of_conduct/ Code of Conduct %}</li>
|
||||
|
@ -1,5 +1,4 @@
|
||||
<section class="aside-module grid__item one-whole lap-one-half">
|
||||
<!-- {% include edit_github.html %} -->
|
||||
{% assign cards = site.lovelace | sort_natural: 'title' %}
|
||||
|
||||
<div class="section">
|
||||
@ -19,7 +18,9 @@
|
||||
<li>{% active_link /lovelace/badges/ Badges %}</li>
|
||||
<li>{% active_link /lovelace/actions/ Actions %}</li>
|
||||
<li>
|
||||
<a href="https://developers.home-assistant.io/docs/frontend/custom-ui/lovelace-custom-card.html">Developing Custom Cards
|
||||
<a
|
||||
href="https://developers.home-assistant.io/docs/frontend/custom-ui/lovelace-custom-card.html"
|
||||
>Developing Custom Cards
|
||||
<i class="icon-external-link"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
@ -1,4 +1,21 @@
|
||||
{% assign url_parts = page.url | split: '/' %}
|
||||
{% if page.hide_github_edit != true %}
|
||||
<div class='edit-github'><a target="_blank" rel="noopener noreferrer" href='{{ site.NLY_REPOSITORY_URL }}/tree/{{ site.NLY_HEAD }}/source/{{ page.path }}'>Edit this page on GitHub</a></div>
|
||||
<div class="material-card text feedback">
|
||||
<b>Help us to improve our documentation</b><br />
|
||||
Suggest an edit to this page, or provide/view feedback for this page.
|
||||
<div class="links">
|
||||
<a
|
||||
href="{{ site.netlify.repository_url }}/tree/{{ site.netlify.head }}/source/{{ page.path }}"
|
||||
><i class="icon-edit" /> Edit</a
|
||||
>
|
||||
<a
|
||||
href="{{ site.netlify.repository_url }}/issues/new?template=feedback.yml&url={{ site.netlify.url | url_encode }}{{ page.url | url_encode }}&version={{ site.current_major_version }}.{{
|
||||
site.current_minor_version }}.{{ site.current_patch_version }}&labels={{ site.netlify.branch }}"
|
||||
><i class="icon-comment" /> Provide feedback</a
|
||||
>
|
||||
<a
|
||||
href="{{ site.netlify.repository_url }}/issues?utf8=%E2%9C%93&q=%22{{ site.netlify.url | url_encode }}{{ page.url | url_encode }}%22&in=body"
|
||||
><i class="icon-comments" /> View pending feedback</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -3,24 +3,16 @@ layout: default
|
||||
---
|
||||
|
||||
<article class="page">
|
||||
{% assign url_parts = page.url | split: '/' %}
|
||||
{% if url_parts[1] != 'components' and
|
||||
url_parts[1] != 'cookbook' and
|
||||
url_parts[1] != 'developers' and
|
||||
url_parts[1] != 'help' and
|
||||
url_parts[1] != 'getting-started' %}
|
||||
{% include edit_github.html %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.title and page.show_title != false %}
|
||||
<header>
|
||||
<h1 class="title indent">
|
||||
{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}
|
||||
{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title
|
||||
}}{% endif %}
|
||||
</h1>
|
||||
</header>
|
||||
<hr class="divider">
|
||||
<hr class="divider" />
|
||||
{% endif %}
|
||||
|
||||
{{ content }}
|
||||
|
||||
{% include edit_github.html %}
|
||||
</article>
|
||||
|
Loading…
x
Reference in New Issue
Block a user