Skip to content

Commit

Permalink
Merge pull request 18F#76 from 18F/individ-questions-page
Browse files Browse the repository at this point in the history
Put question into own page in service of search.gov
  • Loading branch information
Laura Gerhardt authored Mar 18, 2020
2 parents 40409d5 + 804251d commit fe43c2f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ collections:
output: true
permalink: /:name
content:
output: false
output: true
permalink: /:categories/:name

defaults:
-
Expand All @@ -124,7 +125,6 @@ defaults:
values:
lang: en

permalink: /:lang/:categories:output_ext#:title
permalink_custom_vars:
- lang

Expand Down
4 changes: 3 additions & 1 deletion _includes/accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
USWDS Accordion for a given category and posts
{% endcomment %}

{% assign question = include.accordion_content %}
<h2 class="usa-accordion__heading">
<button id="{{ question.title | slugify }}"
class="usa-accordion__button"
Expand All @@ -14,6 +15,7 @@ <h2 class="usa-accordion__heading">
<p>{{ question.content | markdownify }}</p>

<p class="question-meta">Last updated {{ question.date | date: "%B %d, %Y" }}.
{% if question.source %} | <a href="{{ question.source }}/" class="usa-link usa-link--external">Source</a>{% endif %}
{% if question.source %} | <cite>Source: <a href="{{question.source_link}}" class="usa-link usa-link--external">{{ question.source }}</a></cite>
{% endif %}
</p>
</div>
4 changes: 2 additions & 2 deletions _includes/breadcrumb.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<a href="{{ site.baseurl }}/">FAQ</a>
{% for crumb in crumbs offset: 1 %}
{% if forloop.last %}
<span class="text-base padding-x-1">></span> {{ page.title }}
<span class="text-base padding-x-1">></span> {{ page.title | upcase }}
{% else %}
<span class="text-base padding-x-1">></span> <a href="{% assign crumb_limit = forloop.index | plus: 1 %}{% for crumb in crumbs limit: crumb_limit %}{{ crumb | append: '/' | replace:'without-plugin/','without-plugins/' }}{% endfor %}">{{ crumb | replace:'-',' ' | remove:'.html' | capitalize }}</a>
<span class="text-base padding-x-1">></span> <a href="{% assign crumb_limit = forloop.index | plus: 1 %}{% for crumb in crumbs limit: crumb_limit %}{{ crumb | append: '/' | replace:'without-plugin/','without-plugins/' }}{% endfor %}">{{ crumb | upcase | replace:'-',' ' | remove:'.html' }}</a>
{% endif %}
{% endfor %}
</div>
Expand Down
5 changes: 4 additions & 1 deletion _layouts/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
{% assign this_category = categories | where:"name", page.name | first %}
{% assign category_questions = this_category.items %}

{% if page.banner.display == true %}
{% include alert-banner.html banner=page.banner %}
{% endif %}
<div class="usa-layout-docs usa-section" id="top">
<div class="grid-container">
<div class="grid-row grid-gap">
Expand All @@ -22,7 +25,7 @@ <h1>{{ page.title }}</h1>
<div class="usa-accordion usa-accordion--bordered" aria-multiselectable=true>
{% for question in category_questions %}
{% if page.lang == question.lang %}
{% include accordion.html %}
{% include accordion.html accordion_content=question %}
{% endif %}
{% endfor %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{% include menu.html primary_navigation=site.primary_navigation secondary_navigation=site.secondary_navigation %}

{% if page.layout == 'category' %}
{% if page.layout == 'category' or page.layout == 'post' %}
{% include breadcrumb.html %}
{% endif %}
<main id="main-content">
Expand Down
10 changes: 3 additions & 7 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
<div class="grid-container">
<div class="grid-row grid-gap">
<div class="usa-layout-docs__main desktop:grid-col-9 usa-prose">
<h1 class="title">{{page.title}}</h1>
<div class="text-base margin-bottom-2">
<div class="margin-top-neg-105">
By <span class="text-bold">{{ page.author }}</span> · {{ page.date | date: '%B %d, %Y' }}
</div>
</div>
{{ content }}
<div class="usa-accordion usa-accordion--bordered" aria-multiselectable=true>
{% include accordion.html accordion_content=page %}
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit fe43c2f

Please sign in to comment.