Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
clean up formatting of html
Browse files Browse the repository at this point in the history
  • Loading branch information
eddietejeda committed Jun 2, 2019
1 parent a7c8316 commit ce680dd
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 76 deletions.
4 changes: 1 addition & 3 deletions _includes/highlights.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
{% endcomment %}


{% include tagline.html %}

<section class="usa-graphic-list usa-section usa-section--dark">
<div class="grid-container">
<div class="usa-graphic-list__row grid-row grid-gap">
Expand Down Expand Up @@ -40,4 +38,4 @@ <h3 class="usa-graphic-list__heading">Could also have 2 or 6.</h3>
</div>
</div>
</div>
</section>
</section>
82 changes: 41 additions & 41 deletions _includes/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,48 @@
{% endcomment %}

<header class="usa-header usa-header--extended" role="banner">
<div class="usa-navbar">
<div class="usa-logo" id="extended-logo">
<em class="usa-logo__text"><a href="{{site.baseurl}}" title="Home" aria-label="Home">{{site.title}}</a></em>
</div>
<button class="usa-menu-btn">Menu</button>
</div>
<nav role="navigation" class="usa-nav">
<div class="usa-nav__inner">
<button class="usa-nav__close"><img src="{{ site.baseurl }}/assets/uswds/img/close.svg" alt="close"></button>
<ul class="usa-nav__primary usa-accordion">
{% for nav_item in include.primary_navigation %}
{% unless nav_item.children %}
{% assign basedir = page.url | remove_first: '/' | split: '/' | first | lstrip %}
{% assign linkdir = nav_item.url | replace: "/", "" | lstrip %}
<li class="usa-nav__primary-item">
<a class="usa-nav__link{% if basedir == linkdir %} usa-current{% endif %}" href="{{ nav_item.url | prepend: site.baseurl}}"><span>{{ nav_item.name | escape }}</span></a>
</li>
{% else %}
{% assign nav_id = 'primary-nav-' | append: forloop.index %}
<li class="usa-nav__primary-item">
<button class="usa-accordion__button usa-nav__link" aria-expanded="false" aria-controls="{{ nav_id }}"><span>{{ nav_item.name | escape }}</span></button>
<ul id="{{ nav_id }}" class="usa-nav__submenu">
{% for subnav_item in nav_item.children %}
<li class="usa-nav__submenu-item">
<a href="{{ subnav_item.url | prepend: site.baseurl }}">{{ subnav_item.name | escape }}</a>
</li>
{% endfor %}
</ul>
</li>
{% endunless %}
<div class="usa-navbar">
<div class="usa-logo" id="extended-logo">
<em class="usa-logo__text"><a href="{{site.baseurl}}" title="Home" aria-label="Home">{{site.title}}</a></em>
</div>
<button class="usa-menu-btn">Menu</button>
</div>
<nav role="navigation" class="usa-nav">
<div class="usa-nav__inner">
<button class="usa-nav__close"><img src="{{ site.baseurl }}/assets/uswds/img/close.svg" alt="close"></button>
<ul class="usa-nav__primary usa-accordion">
{% for nav_item in include.primary_navigation %}
{% unless nav_item.children %}
{% assign basedir = page.url | remove_first: '/' | split: '/' | first | lstrip %}
{% assign linkdir = nav_item.url | replace: "/", "" | lstrip %}
<li class="usa-nav__primary-item">
<a class="usa-nav__link{% if basedir == linkdir %} usa-current{% endif %}" href="{{ nav_item.url | prepend: site.baseurl}}"><span>{{ nav_item.name | escape }}</span></a>
</li>
{% else %}
{% assign nav_id = 'primary-nav-' | append: forloop.index %}
<li class="usa-nav__primary-item">
<button class="usa-accordion__button usa-nav__link" aria-expanded="false" aria-controls="{{ nav_id }}"><span>{{ nav_item.name | escape }}</span></button>
<ul id="{{ nav_id }}" class="usa-nav__submenu">
{% for subnav_item in nav_item.children %}
<li class="usa-nav__submenu-item">
<a href="{{ subnav_item.url | prepend: site.baseurl }}">{{ subnav_item.name | escape }}</a>
</li>
{% endfor %}
</ul>
<div class="usa-nav__secondary">
<ul class="usa-nav__secondary-links">
{% for nav_item in include.secondary_navigation %}
<li class="usa-nav__secondary-item">
<a href="{{ nav_item.url | prepend: site.baseurl }}">{{ nav_item.name | escape }}</a>
</li>
{% endfor %}
</ul>
{% include searchgov/form.html affiliate=site.searchgov.affiliate %}
</div>
</li>
{% endunless %}
{% endfor %}
</ul>
<div class="usa-nav__secondary">
<ul class="usa-nav__secondary-links">
{% for nav_item in include.secondary_navigation %}
<li class="usa-nav__secondary-item">
<a href="{{ nav_item.url | prepend: site.baseurl }}">{{ nav_item.name | escape }}</a>
</li>
{% endfor %}
</ul>
{% include searchgov/form.html affiliate=site.searchgov.affiliate %}
</div>
</nav>
</div>
</nav>
</header>
69 changes: 40 additions & 29 deletions _includes/sidenav.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,45 @@
<nav>
<ul class="usa-sidenav">
<li class="usa-sidenav__item">
<a href="">Parent link</a>
</li><li class="usa-sidenav__item">
<a href="" class="usa-current">Current page</a><ul class="usa-sidenav__sublist">
<li class="usa-sidenav__item">
<a href="">Child link</a>
</li><li class="usa-sidenav__item">
<a href="" class="usa-current">Child link</a><ul class="usa-sidenav__sublist">
<li class="usa-sidenav__item">
<a href="">Grandchild link</a>
</li><li class="usa-sidenav__item">
<a href="">Grandchild link</a>
</li><li class="usa-sidenav__item">
<a href="" class="usa-current">Grandchild link</a>
</li><li class="usa-sidenav__item">
<a href="">Grandchild link</a>
</li>
</ul>
</li><li class="usa-sidenav__item">
<a href="">Child link</a>
</li><li class="usa-sidenav__item">
<a href="">Child link</a>
</li><li class="usa-sidenav__item">
<a href="">Child link</a>
</li>
</ul>
</li><li class="usa-sidenav__item">
<a href="">Parent link</a>
</li>
<a href="">Parent link</a>
</li>
<li class="usa-sidenav__item">
<a href="" class="usa-current">Current page</a>
<ul class="usa-sidenav__sublist">
<li class="usa-sidenav__item">
<a href="">Child link</a>
</li>
<li class="usa-sidenav__item">
<a href="" class="usa-current">Child link</a>
<ul class="usa-sidenav__sublist">
<li class="usa-sidenav__item">
<a href="">Grandchild link</a>
</li>
<li class="usa-sidenav__item">
<a href="">Grandchild link</a>
</li>
<li class="usa-sidenav__item">
<a href="" class="usa-current">Grandchild link</a>
</li>
<li class="usa-sidenav__item">
<a href="">Grandchild link</a>
</li>
</ul>
</li>
<li class="usa-sidenav__item">
<a href="">Child link</a>
</li>
<li class="usa-sidenav__item">
<a href="">Child link</a>
</li>
<li class="usa-sidenav__item">
<a href="">Child link</a>
</li>
</ul>
</li>
<li class="usa-sidenav__item">
<a href="">Parent link</a>
</li>
</ul>
</nav>
</aside>
</aside>
3 changes: 2 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% comment %}
This is used for just about every page, except the home page
This is used for just about every page. It provides the border around the content.
The home page uses wide.html layout, since it extends full width of page
{% endcomment %}


Expand Down
8 changes: 6 additions & 2 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
layout: default
---

<div class="grid-row grid-gap">
{% comment %}
This template is for a single page that does not have a date associated with it. For example, an about page.
{% endcomment %}


<div class="grid-row grid-gap">
{% if page.sidenav == true %}
{% include sidenav.html %}
{% endif %}

<div class="usa-layout-docs__main desktop:grid-col-9 usa-prose">
{{ content }}
</div>
</div>
</div>
5 changes: 5 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
layout: default
---

{% comment %}
This is used in blog posts. The index page can be found at blog/index.html
{% endcomment %}


<div class="grid-row grid-gap">
<div class="usa-layout-docs__main desktop:grid-col-9 usa-prose">
<h1 class="title">{{page.title}}</h1>
Expand Down

0 comments on commit ce680dd

Please sign in to comment.