1
0
mirror of https://github.com/thangisme/notes.git synced 2024-10-01 12:25:53 -04:00

Merge branch 'v0.2.0' of github.com:pmarsceill/just-the-docs into dark-mode

This commit is contained in:
Patrick Marsceill 2018-11-17 16:25:58 -05:00
commit 100b7277b3
No known key found for this signature in database
GPG Key ID: 286B93882D828F40
8 changed files with 45 additions and 10 deletions

View File

@ -1,7 +1,8 @@
<nav> <nav>
<ul class="navigation-list"> <ul class="navigation-list">
{% assign pages_list = site.html_pages | sort:"nav_order" %} {% assign pages_list = site.html_pages | sort:"nav_order" %}
{% for node in pages_list %} {% for node in pages_list %}
{% unless node.nav_exclude %}
<li class="navigation-list-item{% if page.url == node.url %} active{% endif %} js-side-nav-item"> <li class="navigation-list-item{% if page.url == node.url %} active{% endif %} js-side-nav-item">
{% if node.parent == nil or node.has_children == true %} {% if node.parent == nil or node.has_children == true %}
<a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url or (page.parent != nil and page.parent == node.parent) %} active{% endif %}">{{ node.title }}</a> <a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url or (page.parent != nil and page.parent == node.parent) %} active{% endif %}">{{ node.title }}</a>
@ -19,6 +20,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
</li> </li>
{% endfor %} {% endunless %}
{% endfor %}
</ul> </ul>
</nav> </nav>

View File

@ -11,7 +11,7 @@ code {
border-radius: $border-radius; border-radius: $border-radius;
} }
.highlight { pre.highlight {
padding: $sp-3; padding: $sp-3;
margin-bottom: 0; margin-bottom: 0;
background-color: $code-background-color; background-color: $code-background-color;

View File

@ -4,6 +4,12 @@
// stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type // stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type
.page-content { .page-content {
a {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
ul, ul,
ol { ol {
padding-left: 1.5em; padding-left: 1.5em;

View File

@ -6,7 +6,7 @@ nav_order: 2
# Configuration # Configuration
Just the Docs has some specific configuration parameters that can be definied in your Jekyll site's `config.yml` file. Just the Docs has some specific configuration parameters that can be definied in your Jekyll site's `_config.yml` file.
## Search enabled ## Search enabled

View File

@ -27,6 +27,8 @@ By default, all pages will appear as top level pages in the main nav.
To specify a page order, use the `nav_order` variable in your pages' YAML front matter. To specify a page order, use the `nav_order` variable in your pages' YAML front matter.
#### Example
{: .no_toc }
```yaml ```yaml
--- ---
layout: default layout: default
@ -35,6 +37,20 @@ nav_order: 4
--- ---
``` ```
### Excluding pages
For specific pages that you do not wish to include in the main navigation, e.g. a 404 page. Use the `nav_exclude: true` parameter in the YAML front matter for that page.
#### Example
{: .no_toc }
```yaml
---
layout: default
title: 404
nav_exclude: true
---
```
### Pages with children ### Pages with children
Sometimes you will want to create a page with many children (a section). To accomplish this you need to a few things. First, it is recommended that you keep pages that are related in a directory together... For example, in these docs, we keep all of the written documentation in the `./docs` directory and each of the sections in subdirectories like `./docs/ui-components` and `./docs/utilities`. This gives is an organization like: Sometimes you will want to create a page with many children (a section). To accomplish this you need to a few things. First, it is recommended that you keep pages that are related in a directory together... For example, in these docs, we keep all of the written documentation in the `./docs` directory and each of the sections in subdirectories like `./docs/ui-components` and `./docs/utilities`. This gives is an organization like:
@ -75,12 +91,14 @@ On the parent pages, add 3 YAML front matter variables:
{: .no_toc } {: .no_toc }
```yaml ```yaml
---
layout: default layout: default
title: UI Components title: UI Components
nav_order: 2 nav_order: 2
has_children: true has_children: true
parent: UI Components parent: UI Components
permalink: /ui-components permalink: /ui-components
---
``` ```
Here we're setting up the UI Components landing page that is available at `/ui-components`, has children and is ordered second in the main nav. Here we're setting up the UI Components landing page that is available at `/ui-components`, has children and is ordered second in the main nav.
@ -92,10 +110,12 @@ On child pages, simply set the `parent:` YAML front matter to whatever the paren
#### Example #### Example
{: .no_toc } {: .no_toc }
```yaml ```yaml
---
layout: default layout: default
title: Buttons title: Buttons
parent: UI Components parent: UI Components
nav_order: 2 nav_order: 2
---
``` ```
The Buttons page appears a child of UI Components and appears second in the UI Components section. The Buttons page appears a child of UI Components and appears second in the UI Components section.

View File

@ -21,7 +21,6 @@ nav_order: 2
### Links that look like buttons ### Links that look like buttons
<div class="code-example" markdown="1"> <div class="code-example" markdown="1">
[Link button](http://example.com/){: .btn } [Link button](http://example.com/){: .btn }
[Link button](http://example.com/){: .btn .btn-purple } [Link button](http://example.com/){: .btn .btn-purple }
@ -32,7 +31,6 @@ nav_order: 2
</div> </div>
```markdown ```markdown
[Link button](http://example.com/){: .btn } [Link button](http://example.com/){: .btn }
[Link button](http://example.com/){: .btn .btn-purple } [Link button](http://example.com/){: .btn .btn-purple }

View File

@ -31,7 +31,6 @@ Deprecated
</div> </div>
```markdown ```markdown
Default label Default label
{: .label } {: .label }
@ -49,5 +48,4 @@ Coming soon
Deprecated Deprecated
{: .label .label-red} {: .label .label-red}
``` ```

View File

@ -20,7 +20,14 @@ Just the Docs gives your documentation a jumpstart with a responsive Jekyll them
### Dependencies ### Dependencies
Just the Docs is built for [Jekyll](https://jekyllrb.com), a static site generator. View the [quick start guide](https://jekyllrb.com/docs/quickstart/) for more information. Just the Docs requires no special Jekyll plugins and can run on GitHub Pages standard Jekyll compiler. Just the Docs is built for [Jekyll](https://jekyllrb.com), a static site generator. View the [quick start guide](https://jekyllrb.com/docs/quickstart/) for more information. Just the Docs requires no special Jekyll plugins and can run on GitHub Pages standard Jekyll compiler.
### Installation ### Quick start: Use as a GitHub Pages remote theme
1. Add Just the Docs to your Jekyll site's `_config.yml` as a [remote theme](https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/)
```yaml
remote_theme: pmarsceill/just-the-docs
```
<small>You must have GitHub pages enabled on your repo, one or more markdown files, and a `_config.yml` file. [See an example repository](https://github.com/pmarsceill/jtd-remote)</small>
### Local installation: Use the gem-based theme
1. Install the Ruby Gem 1. Install the Ruby Gem
```bash ```bash
$ gem install just-the-docs $ gem install just-the-docs
@ -29,7 +36,7 @@ $ gem install just-the-docs
# .. or add it to your your Jekyll sites Gemfile # .. or add it to your your Jekyll sites Gemfile
gem "just-the-docs" gem "just-the-docs"
``` ```
2. Add Just the Docs to your Jekyll sites `config.yml` 2. Add Just the Docs to your Jekyll sites `_config.yml`
```yaml ```yaml
theme: "just-the-docs" theme: "just-the-docs"
``` ```
@ -47,6 +54,10 @@ $ bundle exec jekyll serve
``` ```
4. Point your web browser to [http://localhost:4000](http://localhost:4000) 4. Point your web browser to [http://localhost:4000](http://localhost:4000)
### Configure Just the Docs
- [See configuration options]({{ site.baseurl }}{% link docs/configuration.md %})
--- ---
## About the project ## About the project