Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Resources as HTML #271

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ collections:
output: true
permalink: /:collection/:name
resources:
output: false
output: true
permalink: /:collection/:name
defaults:
- scope:
path: ""
type: press
values:
layout: press
- scope:
path: ""
type: resources
values:
layout: resource
description: A state government initiative, Cal-ITP is making riding by rail and bus simpler and more cost-effective—for California transit providers and riders.
domain: www.calitp.org
google_fonts: "https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&family=Raleway:wght@700&display=swap"
Expand Down
12 changes: 8 additions & 4 deletions src/_includes/article.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{% if item.category %}
{% assign url = item.asset %}
{% unless url contains "https://" %}
{% assign url = "/assets/" | append: url %}
{% endunless %}
{% if item.asset %}
{% assign url = item.asset %}
{% unless url contains "https://" %}
{% assign url = "/assets/" | append: url %}
{% endunless %}
{% else %}
{% assign url = item.url %}
{% endif %}
{% else %}
{% assign url = item.url %}
{% if item.external %}
Expand Down
17 changes: 17 additions & 0 deletions src/_layouts/resource.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
layout: default
---

{% capture date %} {% include date.html date=page.date format = "%B %e, %Y" %} {% endcapture %}

<div class="row justify-content-center">
<div class="col-lg-8 col-md-8">
<article class="press-release pb-5 mb-5">
<a class="d-block text-decoration-none mb-2 pt-3 mt-5 text-primary-blue" href="/resources">Resource</a>
<h1 class="h2">{{ page.title }}</h1>
<hr />
<p>{{ date }}</p>
{{ page.content }}
</article>
</div>
</div>