fixing sidebar title issue, also added more links and refinement to getting started page in doc

This commit is contained in:
tomjohnson1492
2016-03-23 10:21:15 -07:00
parent f5c8872d2f
commit 8c4de1ce49
6 changed files with 252 additions and 246 deletions

View File

@ -34,7 +34,7 @@ You can install a fully functional trial version. The only difference is that th
The PDF configuration file will build on the settings in the regular configuration file but will some additional fields. Here's the configuration file for the mydoc product within this theme. This configuration file is located in the pdfconfigs folder.
```
```yaml
destination: _site/
url: "http://127.0.0.1:4010"
baseurl: "/mydoc-pdf"
@ -72,7 +72,7 @@ There are two template pages in the root directory that are critical to the PDF:
These pages should appear in your sidebar YML file (in this product, mydoc_sidebar.yml):
```json
```yaml
- title:
output: pdf
type: frontmatter
@ -145,7 +145,7 @@ To set a specific style property for a particular page, you have to name the pag
First you add frontmatter to the page that specifies the type. For the titlepage.html, here's the frontmatter:
```
```yaml
---
type: title
---
@ -153,7 +153,7 @@ type: title
For the tocpage, here's the frontmatter:
```
```yaml
---
type: frontmatter
---
@ -161,7 +161,7 @@ type: frontmatter
For the index.html page, we have this type tag (among others):
```
```yaml
---
type: first_page
---

View File

@ -1,53 +0,0 @@
---
title: Top navigation
tags:
- navigation
keywords: "custom menu, custom_menu, pop-out, frameescape, frame escape, top nav bar, topnav"
last_updated: "November 30, 2016"
summary: "The top navigation provides some additional features involving a custom menu and pop-out link that you can customize."
sidebar: mydoc_sidebar
permalink: /mydoc_top_navigation_deep_dive/
---
{{site.data.alerts.note}} For basic information about configuring the top navigation, see {{site.data.mydoc_urls.mydoc_top_navigation.link}}. This section gets into the top navigation in more depth. {{site.data.alerts.end}}
## Custom Menu
It's common to publish multiple sites. If you want to link the multiple together, you could simply list links to the other doc sites in a drop-down menu configured in the topnav_dropdowns section in the topnav_doc.yml file. However, suppose you want to do something more fancy.
Included in the topnav.html file is an include to /doc/custom_menu.html. The code in custom_menu.html is as follows:
{% raw %}
```html
<li class="dropdown">
<a href="#" class="dropdown-toggle otherProgLangs" data-toggle="dropdown">Custom Menu<b class="caret"></b></a>
<ul class="dropdown-menu">
<li {% if site.audience == "writers" %}class="dropdownActive"{% endif %}><a href="{% if page.homepage == true or page.switch == false %}../mydoc_writers/">Writer docs</a> {% else %} ../mydoc_writers{{page.url}}">Writer docs</a>{% endif %}</li>
<li {% if site.audience == "designers" %}class="dropdownActive"{% endif %}><a href="{% if page.homepage == true or page.switch == false %}../mydoc_designers/">Designer docs</a> {% else %} ../mydoc_designers{{page.url}}">Designer docs</a>{% endif %}</li>
</ul>
</li>
```
{% endraw %}
{{site.data.alerts.note}} In the theme, the link to the custom_menu.html include in the \_includes/topnav.html file is currently commented out. This is because this feature only works when you have multiple outputs hosted on the same server.
Github Pages, where I'm publishing this theme, allows only one output per Github Pages directory. So rather than removing this custom_menu feature from the theme, I've just commented it out so that it won't appear broken in the demo.{{site.data.alerts.end}}
The current doc site is highlighted. If you select another doc site, the site switches to that doc site and goes to the same page on that doc site. This way, if you have a task such as "Configuring the license" in several different programming languages, users can switch to other programming languages to see the same page.
You need to have both the designers and writers sites deployed on a web server to see this in action. Once deployed, browse to any page in the navigation. Then go to the **Custom Menu** and select the **Writers** site. You'll go to the exact same page but on the Writers site.
If your current page doesn't have an equivalent in your other outputs, then put this in the frontmatter of the page:
```
switch: false
```
This Custom Menu may not be something you want, and if so, just remove the include from the sidebar.html file. But if you're outputting multiple sites, it may be something valuable. You will need to customize the previous code sample to be specific to your project names.
## Pop-out link
The topnav.html file also has an include to frameescape.html (which is also commented out). What does this file do? If the site is embedded inside a frame, a link on the top navigation bar appears that says Pop-out, and it will open the site in a new window.
In most cases, you'll want to simply remove this include. I added this because some of my doc sites are delivered through a Salesforce Community and are embedded inside another page in a small area. This pop-out link is a way of liberating the site from these embedded page scenarios. If your site isn't embedded in an iframe, the Pop-out link doesn't appear. (Also, because it is commented out, it won't appear.) You can remove this part of the theme.