Skip to content

Commit a04f98d

Browse files
Add breadcrumbs to command pages
1 parent cca8f0d commit a04f98d

File tree

307 files changed

+593
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+593
-31
lines changed

Phakefile.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
4646
$binding = $cmd;
4747
$binding['synopsis'] = implode( ' ', $parent );
4848
$binding['path'] = implode( '/', $parent );
49+
$path = '/commands/';
50+
$binding['breadcrumbs'] = '[Commands](' . $path . ')';
51+
foreach( $parent as $i => $p ) {
52+
$path .= $p . '/';
53+
if ( $i < ( count( $parent ) - 1 ) ) {
54+
$binding['breadcrumbs'] .= " &raquo; [{$p}]({$path})";
55+
} else {
56+
$binding['breadcrumbs'] .= " &raquo; {$p}";
57+
}
58+
}
4959
$binding['has-subcommands'] = isset( $cmd['subcommands'] ) ? array(true) : false;
5060

5161
if ( $cmd['longdesc'] ) {

_layouts/doc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<span style="float:right;"><a href="https://github.com/wp-cli/wp-cli.github.com/edit/master/{{page.path}}">Edit</a></span>
66

77
{% if page_url != '/docs/' %}
8-
<a href="/docs/">Docs</a> &raquo; {{ page.category }}
8+
<small><a href="/docs/">Docs</a> &raquo; {{ page.category }}</small>
99
{% endif %}
1010

1111
<h1>{{ page.title }}</h1>

_templates/internal-api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: {{full_name}}()
44
description: "{{phpdoc.short_description}}"
55
---
66

7-
<a href="/docs/">Docs</a> &raquo; <a href="/docs/internal-api/">Internal API</a> &raquo; {{category}}
7+
<small><a href="/docs/">Docs</a> &raquo; <a href="/docs/internal-api/">Internal API</a> &raquo; {{category}}</small>
88

99
## {{full_name}}()
1010

_templates/subcmd-list.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: 'wp {{synopsis}}'
44
display_global_parameters: true
55
---
66

7+
<small>{{{breadcrumbs}}}</small>
8+
79
`wp {{synopsis}}` - {{description}}
810

911
<small>Quick links: <a href="{{github_issues_link}}">Github issues</a></small>

commands/cache/add/index.md

Lines changed: 2 additions & 0 deletions

commands/cache/decr/index.md

Lines changed: 2 additions & 0 deletions

commands/cache/delete/index.md

Lines changed: 2 additions & 0 deletions

commands/cache/flush/index.md

Lines changed: 2 additions & 0 deletions

commands/cache/get/index.md

Lines changed: 2 additions & 0 deletions

commands/cache/incr/index.md

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)