mirror of
https://github.com/hacks-guide/minimal-mistakes.git
synced 2024-11-26 18:30:28 +00:00
Merge branch 'master' of GitHub:mmistakes/minimal-mistakes
This commit is contained in:
commit
d240efaa7c
@ -1,26 +1,27 @@
|
||||
{% assign navigation = site.data.navigation[include.nav] %}
|
||||
|
||||
<nav class="nav__list">
|
||||
{% if page.sidebar.title %}<h3 class="nav__title" style="padding-left: 0;">{{ page.sidebar.title }}</h3>{% endif %}
|
||||
<input id="ac-toc" name="accordion-toc" type="checkbox" />
|
||||
<label for="ac-toc">{{ site.data.ui-text[site.locale].menu_label | default: "Toggle Menu" }}</label>
|
||||
<ul class="nav__items">
|
||||
{% for nav in navigation %}
|
||||
<li>
|
||||
{% if nav.url %}
|
||||
<a href="{{ nav.url | relative_url }}"><span class="nav__sub-title">{{ nav.title }}</span></a>
|
||||
{% else %}
|
||||
<span class="nav__sub-title">{{ nav.title }}</span>
|
||||
{% endif %}
|
||||
{% for navname in include.nav %}
|
||||
{% assign navigation = site.data.navigation[navname] %}
|
||||
{% for nav in navigation %}
|
||||
<li>
|
||||
{% if nav.url %}
|
||||
<a href="{{ nav.url | relative_url }}"><span class="nav__sub-title">{{ nav.title }}</span></a>
|
||||
{% else %}
|
||||
<span class="nav__sub-title">{{ nav.title }}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if nav.children != null %}
|
||||
<ul>
|
||||
{% for child in nav.children %}
|
||||
<li><a href="{{ child.url | relative_url }}"{% if child.url == page.url %} class="active"{% endif %}>{{ child.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% if nav.children != null %}
|
||||
<ul>
|
||||
{% for child in nav.children %}
|
||||
<li><a href="{{ child.url | relative_url }}"{% if child.url == page.url %} class="active"{% endif %}>{{ child.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
@ -747,6 +747,15 @@ defaults:
|
||||
nav: "docs"
|
||||
```
|
||||
|
||||
If you have multiple sidebar navs defined and want to include more than one on a page, the sidebar nav can also be a list.
|
||||
|
||||
```yaml
|
||||
sidebar:
|
||||
nav:
|
||||
- main
|
||||
- docs
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Social sharing links
|
||||
@ -776,23 +785,23 @@ The important parts to change are:
|
||||
|
||||
To change the color of the button use one of the built in [utility classes]({{ "/docs/utility-classes/#buttons" | relative_url }}). Or you can create a new button class to match whatever color you want.
|
||||
|
||||
Under the `$social` color map in `assets/_scss/_buttons.scss` simply add a name (this will be appened to `btn--`) that matches the new button class. In our case `reddit` ~> `.btn--reddit`.
|
||||
Under the `$buttoncolors:` color map in `_sass/minimal-mistakes/_buttons.scss` simply add a name (this will be appended to `btn--`) that matches the new button class. In our case `reddit` ~> `.btn--reddit`.
|
||||
|
||||
```scss
|
||||
$social:
|
||||
$buttoncolors:
|
||||
(facebook, $facebook-color),
|
||||
(twitter, $twitter-color),
|
||||
(linkedin, $linkedin-color),
|
||||
(reddit, #ff4500);
|
||||
(reddit, $reddit-color);
|
||||
```
|
||||
|
||||
**ProTip:** For bonus points you can add it as a Sass `$variable` that you set in `_variables.scss` like the other ["brand" colors](http://brandcolors.net/).
|
||||
**ProTip:** For bonus points you can modify the Sass variable `$reddit-color` that is set in `_variables.scss` [or use a different "brand" color](http://brandcolors.net/).
|
||||
{: .notice--info}
|
||||
|
||||
Add the new `.btn--reddit` class to the `<a>` element from earlier, [compile `main.css`]({{ "/docs/stylesheets/" | relative_url }}) and away you go.
|
||||
|
||||
```html
|
||||
{% raw %}<a href="https://www.reddit.com/submit?url={{ page.url | relative_url }}&title={{ page.title }}" class="btn btn--reddit" title="{{ site.data.ui-text[site.locale].share_on_label }} Reddit"><i class="fab fa-fw fa-reddit" aria-hidden="true"></i><span> Reddit</span></a>{% endraw %}
|
||||
{% raw %}<a href="https://www.reddit.com/submit?url={{ page.url | absolute_url | url_encode }}&title={{ page.title }}" class="btn btn--reddit" title="{{ site.data.ui-text[site.locale].share_on_label }} Reddit"><i class="fab fa-fw fa-reddit" aria-hidden="true"></i><span> Reddit</span></a>{% endraw %}
|
||||
```
|
||||
|
||||
![Reddit social share link button]({{ "/assets/images/mm-social-share-links-reddit-color.png" | relative_url }})
|
||||
|
Loading…
Reference in New Issue
Block a user