Skip to content

Commit

Permalink
Bring back /private and turn it into a redirect
Browse files Browse the repository at this point in the history
- Streamline/cleanup some article redirecting code
  • Loading branch information
zachmargolis committed May 3, 2024
1 parent 7bc04f7 commit db07f0d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
7 changes: 7 additions & 0 deletions _categories/private.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Private Articles
permalink: /private/
layout: article
icon: lock
redirect_to: https://lg-public.pages.production.gitlab.login.gov/identity-internal-handbook/
---
12 changes: 8 additions & 4 deletions _includes/article_url.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{% comment %}
Includes:
- article: page to link to (or directly to its .redirect_to)
{% endcomment %}
{%- if include.article.redirect_to -%}
{%- if include.redirect_to contains '://' -%}
{{ article.redirect_to }}
{%- if include.article.redirect_to contains '://' -%}
{{ include.article.redirect_to }}
{%- else -%}
{{ article.redirect_to | prepend: site.baseurl }}
{{ include.article.redirect_to | prepend: site.baseurl }}
{%- endif -%}
{%- else -%}
{{ article.url | prepend: site.baseurl }}
{{ include.article.url | prepend: site.baseurl }}
{%- endif -%}
6 changes: 3 additions & 3 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ to [avoid contributing sensitive information][sensitive-information].
{% if category.icon %}
{% include uswds-icon.html icon=category.icon %}
{% endif %}
<strong>
<a href="{{ category.url | prepend: site.baseurl }}" class="usa-link">{{ category.title }}</a>
<strong markdown="1">
[{{category.title}}]({% include article_url.txt article=category %})
</strong>
</span>
</div>
Expand All @@ -45,7 +45,7 @@ to [avoid contributing sensitive information][sensitive-information].

{% for category in site.categories %}

### [{{ category.title }}]({{ category.url | prepend: site.baseurl }})
### [{{category.title}}]({% include article_url.txt article=category %})

{{ category.description}}

Expand Down

0 comments on commit db07f0d

Please sign in to comment.