From 44fed9602ad2fd8c9af248a1f8bda01aeb839cb4 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Tue, 22 Sep 2015 15:43:59 -0700 Subject: [PATCH] adjusted accordion feature by removing setting for this You now have to manually adjust a few things in the sidebar.html if you do not want the accordion feature. --- _includes/sidebar.html | 14 +++-- configs/config_designers.yml | 1 - css/customstyles.css | 1 + doc_configuration_settings.md | 1 - doc_sidebar_navigation.md | 31 ++++++---- title-checker2.html | 105 ++++++++++++++++++++++++++++++++++ 6 files changed, 135 insertions(+), 18 deletions(-) create mode 100644 title-checker2.html diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 3f6fe54..82183f3 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -9,7 +9,7 @@ // Initialize navgoco with default options $("#mysidebar").navgoco({ caretHtml: '', - accordion: {% if site.sidebar_accordion %}{{site.sidebar_accordion}}{% else %}true{% endif %}, + accordion: true, openClass: 'active', // open save: false, // leave false or nav highlighting doesn't work right cookie: { @@ -49,7 +49,7 @@ {% for subcategory in entry.subcategories %} {% if subcategory.audience contains audience and subcategory.product contains product and subcategory.platform contains platform and subcategory.version contains version and subcategory.web != false %}
  • {{ subcategory.title }} - {% if subcategory.class == "series" %} - {% if site.sidebar_accordion == false %} + + + diff --git a/configs/config_designers.yml b/configs/config_designers.yml index ba9956c..e4b0b73 100644 --- a/configs/config_designers.yml +++ b/configs/config_designers.yml @@ -30,7 +30,6 @@ exclude: # same for all host: 127.0.0.1 feedback_email: tomjohnson1492@gmail.com -sidebar_accordion: true markdown: redcarpet print: false theme_file: theme-blue.css diff --git a/css/customstyles.css b/css/customstyles.css index 8ae83e5..f48a3b3 100644 --- a/css/customstyles.css +++ b/css/customstyles.css @@ -194,6 +194,7 @@ p.external a { font-size:12px; font-color: #0088cc; display:inline; + margin-top:7px; } #definition-box-container div a.active { diff --git a/doc_configuration_settings.md b/doc_configuration_settings.md index fd1b179..af40d89 100644 --- a/doc_configuration_settings.md +++ b/doc_configuration_settings.md @@ -39,7 +39,6 @@ Note that you can define arbitrary key-value pairs in the configuration file, an | **site_title**| Appears in the webpage title area (on the browser tab, not in the page viewing area). In the sample theme files, the site title is the "page name | homepage title." | | **port** | Required | The port used in the preview mode. This is only for the live preview and doesn't affect the published output. If you serve multiple outputs simultaneously, the port must be unique. | | **feedback_email** | Gets configured as the email address in the Send Feedback button in the top navigation bar.| -| **sidebar_accordion** | Optional | Boolean. The default value is true. Whether you want the navigation sidebar to use the accordion effect or not. The accordion effect means when you expand a section, the other sections automatically collapse. If you put `false`, then you can expand multiple sections at once. At the bottom of the navigation sidebar, two links will appear: Collapse All and Expand All. | | **disqus_shortname** | Optional | The disqus site shortname, which is used for comments. If you don't want comment forms via disqus, leave this blank or omit it altogether and Disqus won't appear. | | **markdown** | Required | The processor to use for Markdown. This is a Jekyll-specific setting. Use `redcarpet`. Another option is `kramdown`. However, my examples will follow redcarpet. | | **redcarpet** | Required | Extensions used with redcarpet. You can read more about them by searching for redcarpet extensions online. | diff --git a/doc_sidebar_navigation.md b/doc_sidebar_navigation.md index 4632727..216c8be 100644 --- a/doc_sidebar_navigation.md +++ b/doc_sidebar_navigation.md @@ -55,26 +55,24 @@ Each of the items in the sidebar needs to have the attributes shown here: version: all ``` -The audience, platform, product, and version are specified in the includes/custom/conditions.html file: +The project, audience, platform, product, and version are specified in the includes/custom/conditions.html file: ```liquid {% raw %} {% if site.project == "doc_designers" %} {% assign audience = "designers" %} -{% assign sidebar = site.data.sidebar_doc.entries %} -{% assign topnav = site.data.topnav_doc.topnav %} -{% assign topnav_dropdowns = site.data.topnav_doc.topnav_dropdowns %} +{% assign sidebar = site.data.sidebar.entries %} +{% assign topnav = site.data.topnav.topnav %} +{% assign topnav_dropdowns = site.data.topnav.topnav_dropdowns %} {% assign version = "all" %} {% assign product = "all" %} {% assign platform = "all" %} -{% assign link = "custom/doc/links_doc.html" %} {% assign projectTags = site.data.tags_doc.allowed-tags %} -{% assign searchGroup = "doc" %} {% endif %} {% endraw %} ``` -Additionally, note how some assignments are set here as well. The conditions.html file set things like `sidebar = site.data.sidebar_doc.entries`. +Additionally, note how some assignments are set here as well. The conditions.html file set things like `sidebar = site.data.sidebar.entries`. You could use this logic to extend the single sourcing possibilities of the theme. When the sidebar.html file runs the logic, it includes these statements: @@ -94,14 +92,27 @@ The assignment of the `sidebar` value through the conditions.html file means thi {% raw %} {% include custom/conditions.html %} -{% for entry in site.data.sidebar_doc.entries %} +{% for entry in site.data.sidebar.entries %} {% endraw %} ``` -Since different projects will use different data files, I had to make the logic run using the standard `sidebar` variable, but change the meaning of that variable based on the project. +Since different projects might use different data files, I had to made the logic run using the standard `sidebar` variable but change the meaning of that variable based on the project. # Sidebar accordion -The configuration file (configs/config_writers.yml) file includes a value (`sidebar_accordion`) that lets you choose whether to use the accordion feature in the sidebar or not. The accordion feature collapses other sections when a section is opened, which conserves space on the screen. Put `true` or `false` for the value. +If you don't want the accordion feature in the sidebar, open the \_includes/sidebar.html file and change the value for `accordion` in the `.navgoco` options from `true` to `false` (don't surround the value with quotes). + +Additionally, to show "Collapse All" and "Expand All" buttons, uncomment this section near bottom on the same sidebar.html page: + +``` + +``` + +Note that if you Expand all sections in your sidebar and you have a lot of items, the sidebar will likely extend past the viewing frame. In this case, you should disable the fixed sidebar setting by removing the JavaScript code explained in the next section ("Sidebar fixed or moving"). ## Sidebar fixed or moving diff --git a/title-checker2.html b/title-checker2.html new file mode 100644 index 0000000..5c822cf --- /dev/null +++ b/title-checker2.html @@ -0,0 +1,105 @@ +--- +layout: none +search: exclude +--- + + +Page checker + + +

    Page Checker Report

    +{% include custom/conditions.html %} + +{% for entry in sidebar %} + {% for subcategory in entry.subcategories %} + {% for item in subcategory.items %} + {% assign count = '0' %} + {% unless item.frontmatter == true %} + {% assign itemTitle = item.title | replace: '"', '' %} + {% assign itemUrl = item.url %} + {% for page in site.pages %} + {% if page.url == item.url %} + {% assign pageTitle = page.title | replace: '"', '' %} + {% assign pageUrl = page.url %} + {% if pageTitle != itemTitle %} +
    +

    Problem: The sidebar item title "{{itemTitle}}" does not match the page title "{{pageTitle}}".

    + {% endif %} + {% endif %} + {% if pageUrl != itemUrl %} + {% capture count %}{{ count | plus: '1' }}{% endcapture %} + {% if forloop.last %} + {% assign totalPages = site.pages.size %} + {% if count != totalPages %} +

    something is missing

    + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endunless %} + +{% for thirdlevel in item.thirdlevel %} +{% for deeplevel in thirdlevel.thirdlevelitems %} +{% unless deeplevel.frontmatter == true %} + + {% assign deeplevelTitle = deeplevel.title | replace: '"', '' %} + {% assign deeplevelUrl = deeplevel.url %} + {% for page in site.pages %} + {% if page.url == deeplevel.url %} + {% assign pageTitle = page.title | replace: '"', '' %} + {% assign pageUrl = page.url %} + {% if pageTitle != deeplevelTitle %} +
    +

    Problem: The sidebar deeplevel title "{{deeplevelTitle}}" does not match the page title "{{pageTitle}}".

    + {% endif %} + {% endif %} + {% endfor %} + {% endunless %} +{% endfor %} +{% endfor %} +{% endfor %} +{% endfor %} +{% endfor %} + + +{% for entry in topnav %} +{% for subcategory in entry.subcategories %} +{% unless subcategory.external_url or subcategory.frontmatter %} +
    + {% assign subcategoryTitle = subcategory.title | replace: '"', '' %} + {% assign subcategoryUrl = subcategory.url %} + {% for page in site.pages %} + {% if page.url == subcategory.url %} + {% assign pageTitle = page.title | replace: '"', '' %} + {% assign pageUrl = page.url %} + {% if pageTitle != subcategoryTitle %} +

    Problem: The top navigation item title "{{subcategoryTitle}}" does not match the page title "{{pageTitle}}".

    + {% endif %} + {% endif %} + {% endfor %} + {% endunless %} +{% endfor %} +{% endfor %} + +{% for entry in topnav_dropdowns %} +{% for subcategory in entry.subcategories %} +{% for subitem in subcategory.items %} +{% unless subitem.external_url or subitem.frontmatter %} + + {% assign subitemTitle = subitem.title | replace: '"', '' %} + {% assign subitemUrl = subitem.url %} + {% for page in site.pages %} + {% if page.url == subitem.url %} + {% assign pageTitle = page.title | replace: '"', '' %} + {% assign pageUrl = page.url %} + {% if pageTitle != subitemTitle %} + Problem: The top drop-down navigation item title "{{subitemTitle}}" does not match the page title "{{pageTitle}}". + {% endif %} + {% endif %} + {% endfor %} + {% endunless %} +{% endfor %} +{% endfor %} +{% endfor %} + + \ No newline at end of file