Skip to content

Commit

Permalink
Update display of doc site sidebar and title
Browse files Browse the repository at this point in the history
  • Loading branch information
nateconley committed Feb 2, 2023
1 parent 072e598 commit a8a83f8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 27 deletions.
13 changes: 10 additions & 3 deletions .github/hookdoc-tmpl/layout.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title><?js= title ?> - 10up Distributor Hook Docs</title>
<title><?js= title ?> - 10up Distributor Developer Documentation</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
Expand Down Expand Up @@ -32,11 +32,18 @@
<a href="https://10up.com/careers">Careers at 10up</a>
</footer>


</div>

<nav>
<?js= this.nav ?>
<?js
// Re-order tutorials to the top of the nav. The nav is hard-coded in wp-hooksdoc.
const indexOfFirstSubHeading = this.nav.indexOf('<h3');
const indexOfTutorial = this.nav.indexOf('<h3>Tutorials');
const headingLink = this.nav.substr(0, indexOfFirstSubHeading);
const hooksSection = this.nav.substr(indexOfFirstSubHeading, indexOfTutorial - indexOfFirstSubHeading);
const tutorialSection = this.nav.substr(indexOfTutorial);
?>
<?js= headingLink + tutorialSection+ hooksSection ?>
</nav>

<br class="clear">
Expand Down
51 changes: 27 additions & 24 deletions hookdoc-conf.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
{
"opts": {
"destination": "docs-built",
"template": "node_modules/wp-hookdoc/template",
"recurse": true,
"readme": "./.github/hookdoc-tmpl/README.md",
"tutorials": "./docs"
},
"source": {
"includePattern": ".+\\.(php|inc)?$"
},
"plugins": [
"node_modules/wp-hookdoc/plugin",
"plugins/markdown"
],
"templates": {
"default": {
"layoutFile": ".github/hookdoc-tmpl/layout.tmpl",
"staticFiles": {
"include": [
"./.github/hookdoc-tmpl/static"
]
}
}
}
"opts": {
"destination": "docs-built",
"template": "node_modules/wp-hookdoc/template",
"recurse": true,
"readme": "./.github/hookdoc-tmpl/README.md",
"tutorials": "./docs"
},
"source": {
"includePattern": ".+\\.(php|inc)?$"
},
"plugins": [
"node_modules/wp-hookdoc/plugin",
"plugins/markdown"
],
"markdown": {
"idInHeadings": true
},
"templates": {
"default": {
"layoutFile": ".github/hookdoc-tmpl/layout.tmpl",
"staticFiles": {
"include": [
"./.github/hookdoc-tmpl/static"
]
}
}
}
}

0 comments on commit a8a83f8

Please sign in to comment.