Fix variables component, Fix doc tabs

This commit is contained in:
Jeremy Thomas
2018-10-28 08:57:38 +00:00
parent 291c437ab5
commit 9f89f7252c
4 changed files with 99 additions and 118 deletions

View File

@@ -1,5 +1,4 @@
{% capture content %}
{% assign anchor_name = include.anchor_name | default: 'Variables' %}
{% assign tab = include.tab | default: page.doc-tab %}
{% assign subtab = include.subtab | default: page.doc-subtab %}
@@ -25,49 +24,53 @@
You can use {{ variables_link | strip }} to <strong>customize</strong> this {{ type }}. Simply set one or multiple of these variables <em>before</em> importing Bulma. <a href="{{ site.url }}/documentation/overview/customize/">Learn how</a>.
{% endif %}
{% endcapture %}
{% unless include.hide_anchor %}
{% include elements/anchor.html name=anchor_name %}
{% endunless %}
{% capture variables_size %}{{ variables | size }}{% endcapture %}
{% capture variables_keys_size %}{{ include.variables_keys | size }}{% endcapture %}
{% unless include.hide_content %}
<div class="content">
<p>{{ content | strip }}</p>
{% if variables_size != '0' or variables_keys_size != '0' %}
{% unless include.hide_anchor %}
{% include elements/anchor.html name=anchor_name %}
{% endunless %}
{% unless include.hide_content %}
<div class="content">
<p>{{ content | strip }}</p>
</div>
{% endunless %}
<div class="table-container">
<table class="table {{ table_class }}">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default value</th>
<th>Computed value</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default value</th>
<th>Computed value</th>
</tr>
</tfoot>
<tbody>
{% if include.variables_keys %}
{% for key in include.variables_keys %}
{% assign variable = site.data.variables[include.folder][include.file].by_name[key] %}
{% include elements/variable-row.html variable=variable %}
{% endfor %}
{% else %}
{% for variable_name in variables %}
{% assign variable = data.by_name[variable_name] %}
{% include elements/variable-row.html variable=variable %}
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
{% endunless %}
<div class="table-container">
<table class="table {{ table_class }}">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default value</th>
<th>Computed value</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default value</th>
<th>Computed value</th>
</tr>
</tfoot>
<tbody>
{% if include.variables_keys %}
{% for key in include.variables_keys %}
{% assign variable = site.data.variables[include.folder][include.file].by_name[key] %}
{% include elements/variable-row.html variable=variable %}
{% endfor %}
{% else %}
{% for variable_name in variables %}
{% assign variable = data.by_name[variable_name] %}
{% include elements/variable-row.html variable=variable %}
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
{% endif %}