New format for FAQ, allowing for deep links to answers and making it easier to browse. (#1013)

This commit is contained in:
Martin Taillefer 2018-02-19 05:31:16 -08:00 committed by GitHub
parent fd5d4a2cb2
commit e42f7ed9ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 111 additions and 116 deletions

View File

@ -1,22 +0,0 @@
---
title: Frequently Asked Questions
overview: Frequently Asked Questions about Istio.
order: 20
layout: help
type: markdown
redirect_from:
- "/faq"
- "/docs/welcome/faq.html"
toc: false
---
{% include home.html %}
Here are some frequently asked questions about Istio.
{% include faq.html
faq_pages = site.faq
faq_category_dirs = 'general,setup,security,mixer,traffic-management'
faq_category_names = 'General,Setup,Security,Mixer,Traffic Management'
%}

9
_help/faq/general.html Normal file
View File

@ -0,0 +1,9 @@
---
title: General
overview: General Q&A
order: 10
layout: help
---
{% include faq.html category='general' %}

50
_help/faq/index.md Normal file
View File

@ -0,0 +1,50 @@
---
title: FAQ
overview: Frequently Asked Questions about Istio.
order: 20
layout: help
type: markdown
toc: false
redirect_from:
- "/faq"
- "/docs/welcome/faq.html"
---
{% include home.html %}
You've got questions? We've got answers!
<div class="faq">
<div class="row">
{% assign category_dirs = 'general,setup,security,mixer,traffic-management' %}
{% assign category_names = 'General,Setup,Security,Mixer,Traffic Management' %}
{% assign category_dirs = category_dirs | split: ',' %}
{% assign category_names = category_names | split: ',' %}
{% assign faqs = site.faq | sort: "order" %}
{% for cat in category_dirs %}
<div class="col-sm-6">
<div class="card">
<div class="card-header">
{{category_names[forloop.index0]}}
</div>
<div class="card-body">
{% for q in faqs %}
{% assign comp = q.path | split: '/' %}
{% assign qcat = comp[1] %}
{% if cat == qcat %}
{% assign name = q.path | downcase | split: '/' | last | remove: ".md" %}
<a href="{{qcat}}#{{name}}">{{q.title}}</a><br/>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>

9
_help/faq/mixer.html Normal file
View File

@ -0,0 +1,9 @@
---
title: Mixer
overview: Mixer Q&amp;A
order: 40
layout: help
---
{% include faq.html category='mixer' %}

9
_help/faq/security.html Normal file
View File

@ -0,0 +1,9 @@
---
title: Security
overview: Security Q&amp;A
order: 30
layout: help
---
{% include faq.html category='security' %}

9
_help/faq/setup.html Normal file
View File

@ -0,0 +1,9 @@
---
title: Setup
overview: Setup Q&amp;A
order: 20
layout: help
---
{% include faq.html category='setup' %}

View File

@ -0,0 +1,9 @@
---
title: Traffic Management
overview: Traffic Management Q&amp;A
order: 50
layout: help
---
{% include faq.html category='traffic-management' %}

View File

@ -229,7 +229,7 @@ or [manual]({{home}}/docs/setup/kubernetes/sidecar-injection.html#manual-sidecar
Look for errors related to your configuration or your service in the Look for errors related to your configuration or your service in the
returned logs. returned logs.
More on viewing Mixer configuration can be found [here]({{home}}/help/faq.html#mixer-self-monitoring) More on viewing Mixer configuration can be found [here]({{home}}/help/faq/mixer.html#mixer-self-monitoring)
### Verify Mixer is sending metric instances to the Prometheus adapter ### Verify Mixer is sending metric instances to the Prometheus adapter

View File

@ -1,68 +1,12 @@
{% include home.html %}
<div class="container-fluid faq"> {% assign faqs = site.faq | sort: "order" %}
<div class="row"> {% for q in faqs %}
{% assign comp = q.path | split: '/' %}
{% assign qcat = comp[1] %}
{% if qcat == include.category %}
{% assign name = q.path | downcase | split: '/' | last | remove: ".md" %}
{% assign category_dirs = include.faq_category_dirs | split: ',' %} <h4 id="{{name}}">Q: {{q.title}}</h4>
{% assign category_names = include.faq_category_names | split: ',' %} {{q.content}}
{% endif %}
<div class="col-12 col-md-3 col-xl-2"> {% endfor %}
<div class="list-group" role="tablist">
{% assign cats = category_dirs %}
{% for cat in cats %}
{% assign active = "" %}
{% if forloop.index == 1 %}
{% assign active = "active" %}
{% endif %}
<a class="list-group-item list-group-item-action {{active}}" data-toggle="list" role="tab" href="#tab{{forloop.index}}">
{{category_names[forloop.index0]}}
</a>
{% endfor %}
</div>
</div>
<div class="col-12 col-md-9 col-xl-10">
<div class="tab-content">
{% assign cats = category_dirs %}
{% for cat in cats %}
{% assign catIndex = forloop.index %}
{% assign active = "" %}
{% if catIndex == 1 %}
{% assign active = "active" %}
{% endif %}
<div class="tab-pane {{active}}" id="tab{{catIndex}}" role="tabpanel">
{% assign faqs = include.faq_pages | sort: "order" %}
{% for q in faqs %}
{% assign comp = q.path | split: '/' %}
{% assign qcat = comp[1] %}
{% if cat == qcat %}
{% assign name = q.path | downcase | split: '/' | last | remove: ".md" %}
<div class="card">
<div class="card-header">
<a data-toggle="collapse" href="#{{name}}">
<div>
{{q.title}}
</div>
</a>
</div>
<div id="{{name}}" class="collapse" data-parent="#tab{{catIndex}}">
<div class="card-body">
{{q.content}}
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
{% endfor %}
</div>
</div>
</div>
</div>

View File

@ -18,7 +18,7 @@
<nav class="col-12 col-sm-3" role="navigation"> <nav class="col-12 col-sm-3" role="navigation">
<ul> <ul>
<li><a class="header" href="{{home}}/help">Help</a></li> <li><a class="header" href="{{home}}/help">Help</a></li>
<li><a href="{{home}}/help/faq.html">FAQ</a></li> <li><a href="{{home}}/help/faq/index.html">FAQ</a></li>
<li><a href="{{home}}/help/glossary.html">Glossary</a></li> <li><a href="{{home}}/help/glossary.html">Glossary</a></li>
<li><a href="{{home}}/help/troubleshooting.html">Troubleshooting</a></li> <li><a href="{{home}}/help/troubleshooting.html">Troubleshooting</a></li>
<li><a href="{{home}}/help/bugs.html">Report Bugs</a></li> <li><a href="{{home}}/help/bugs.html">Report Bugs</a></li>

View File

@ -1,5 +1,4 @@
--- ---
layout: compress
--- ---
{% include home.html %} {% include home.html %}

View File

@ -1,33 +1,12 @@
.faq { .faq {
.card { .card {
margin-bottom: .2em; border-color: $boxBorderColor;
margin-bottom: 2em;
border-radius: 4px;
} }
.card-body {
padding-top: 0;
padding-bottom: 0;
}
.card-header { .card-header {
padding: 0;
div {
padding: .75em 1.25em;
}
}
.list-group {
padding-bottom: 3em;
}
.list-group-item {
background-color: $backgroundColor;
color: $textColor;
border-color: $dividerBarColor;
}
.list-group-item.active {
background-color: $mainBrandColor;
color: $textBrandColor; color: $textBrandColor;
background-color: $boxBorderColor;
} }
} }