-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This upstreams layouts and style overrides from `qunitjs/qunit.git:/doc` (api.qunitjs.com). * Move padding-top in `.main` to padding-bottom on `.hero` so that pages without hero don't have odd spacing. Also: * Move theme config documentation to a separate Markdown file for easier reference. * Introduce `site.amethyst.home_href` option so that qunitjs.com and api.qunitjs.com can both have the logo link to the same central home page. This will also help with the blog later. Ref #1. * Omit page.title from wrapper `<title>` in HTML head when on the index page. When using the "home" layout, this isn't an issue, but if a site uses a different layout as its home page, then one should be able to set "title" in the front matter and still have it be excluded from the document title to avoid confusion/redundancy. Closes #3.
- Loading branch information
Showing
25 changed files
with
560 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
- group: foo | ||
expand: true | ||
|
||
- group: lorem | ||
|
||
- type: list | ||
title: Other | ||
expand: true | ||
list: | ||
- url: /api/deprecated/ | ||
title: Deprecated | ||
- url: /api/removed/ | ||
title: Removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{%- comment -%} | ||
|
||
Parameters: | ||
|
||
* blocks: | ||
Key in `site.data` corresponding to a `_data/*.yml` file. | ||
|
||
Block data: | ||
|
||
* type: [Default: "group"] | ||
What type of block to add to the sidebar. | ||
- "group" to query a list of pages from a page group. | ||
- "list" to specify your own custom list. | ||
|
||
* title: [Default: group_page.title or ""] | ||
For a "group" block this defaults to the title of the group index page. | ||
For a custom "list" block, this is required. | ||
|
||
* url: [Default: group_page.url or null] | ||
For a "group" block this defaults to the URL of the group index page. | ||
If null, the block title will not be linked. | ||
|
||
* group: | ||
When using a "group" block, the ID of the group to query for. | ||
|
||
* list: | ||
When using a "list" block, an array of objects with "title" | ||
and "url" properties. | ||
|
||
* expand: [Default: active] | ||
Whether a block should be expanded. | ||
- true: Always expanded. | ||
- false: Never expanded. | ||
- active: Expand when the current page is in the list. | ||
|
||
{%- endcomment -%} | ||
<section class="sidebar"> | ||
{% for block in site.data[include.blocks] -%} | ||
{%- assign block_type = block.type | default: "group" -%} | ||
{%- assign block_title = block.title -%} | ||
{%- assign block_url = block.url -%} | ||
{%- assign block_contents = block.list -%} | ||
{%- assign block_expand = block.expand -%} | ||
{%- if block_expand != true and block_expand != false -%} | ||
{%- assign block_expand = "active" -%} | ||
{%- endif -%} | ||
|
||
{%- if block_type == "group" -%} | ||
{%- assign group_page = site.pages | where: "layout", "group" | where: "group", block.group | first -%} | ||
{%- assign block_title = block.title | default: group_page.title | default: block.group -%} | ||
{%- assign block_url = block.url | default: group_page.url -%} | ||
{%- assign block_contents = site.pages | where: 'groups', block.group | sort_natural: 'title' -%} | ||
{%- elsif block_type == "recent" -%} | ||
{%- assign block_contents = site.posts | slice: 0, 5 -%} | ||
{%- endif -%} | ||
|
||
{%- if block_expand == "active" -%} | ||
{%- assign self_in_contents = block_contents | where: 'url', page.url | size -%} | ||
{%- if page.url == block_url or self_in_contents > 0 -%} | ||
{%- assign block_expand = true -%} | ||
{%- else -%} | ||
{%- assign block_expand = false -%} | ||
{%- endif -%} | ||
{%- endif %} | ||
|
||
<h4{% if block_expand %} class="sidebar-title-open"{% endif %}>{% if block_url %}<a href="{{ block_url | relative_url }}">{{ block_title }}</a>{% else %}{{ block_title }}{% endif %}</h4> | ||
{%- if block_expand -%} | ||
<ul class="sidebar-list"> | ||
{%- for entry in block_contents %} | ||
<li class="sidebar-item{% if page.url == entry.url %} sidebar-item-active{% endif %}"> | ||
<a href="{{ entry.url | relative_url }}">{{ entry.title }}</a> | ||
</li> | ||
{%- endfor -%} | ||
</ul> | ||
{%- endif -%} | ||
{% endfor %} | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{%- comment -%} | ||
|
||
Parameters: | ||
|
||
* version: | ||
Like "1.0", "2.2", or "unreleased". | ||
|
||
* label: | ||
Like "version added". | ||
|
||
{%- endcomment -%} | ||
|
||
{%- comment -%} | ||
These releases have original release notes published under a v-prefixed tag. | ||
{%- endcomment -%} | ||
{%- assign _old_releases = " v1.9.0 v1.10.0 v1.11.0 v1.12.0 " -%} | ||
|
||
{%- assign _full_version = include.version -%} | ||
{%- assign _old_version = _full_version | prepend: "v" -%} | ||
{%- if _old_releases contains _old_version -%} | ||
{%- assign _full_version = _old_version -%} | ||
{%- endif -%} | ||
|
||
{%- if include.version == "unreleased" -%} | ||
not yet released | ||
{%- else -%} | ||
{{ include.label }}: {% if site.amethyst.release_base %}<a href="{{ site.amethyst.release_base }}{{ _full_version | escape }}">{{ include.version | escape }}</a>{% else %}{{ include.version | escape }}{% endif %} | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
layout: page-api | ||
--- | ||
{{ content }} | ||
|
||
{%- assign pages = site.pages | where: 'groups', page.group | sort_natural: 'title' -%} | ||
{% for page in pages %} | ||
<h2 id="{{ page.title | slugify }}"><a href="{{ page.url | relative_url }}">{{ page.title }}</a></h2> | ||
<p> | ||
{%- if page.version_removed %}<strong>REMOVED</strong> {% endif -%} | ||
{%- if page.version_removed == nil and page.version_deprecated %}<strong>DEPRECATED</strong> {% endif -%} | ||
{{ page.excerpt -}} | ||
</p> | ||
{% endfor -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
layout: wrapper | ||
--- | ||
|
||
<div class="main main--columns wrapper"> | ||
{% include sidebar.html blocks="sidebar_api" %} | ||
<div class="content" role="main"> | ||
<h1>{{ page.title }}</h1> | ||
{%- if page.version_added or page.version_deprecated -%} | ||
{%- assign warning = false -%} | ||
{%- if page.version_added == "unreleased" or page.version_deprecated or page.version_removed -%} | ||
{%- assign warning = true -%} | ||
{%- endif -%} | ||
|
||
<p class="version-details{% if warning %} note--warning{% endif %}"> | ||
{%- capture lines -%} | ||
{%- if page.version_added %} | ||
{% include version.html version=page.version_added label="version added" %} | ||
{%- endif -%} | ||
{%- if page.version_deprecated %} | ||
{% include version.html version=page.version_deprecated label="deprecated" %} | ||
{%- endif -%} | ||
{%- if page.version_removed %} | ||
{% include version.html version=page.version_removed label="removed" %} | ||
{%- endif -%} | ||
{%- endcapture -%} | ||
{{ lines | strip | newline_to_br }} | ||
</p> | ||
{%- endif %} | ||
{{- content }} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.