From 5db0fa5c1eb572d8745745181870ea1f3a6f295a Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Wed, 1 Nov 2023 21:58:17 +0000 Subject: [PATCH 1/3] refactor(resources): update article link logic to support hosted HTML --- src/_includes/article.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/_includes/article.html b/src/_includes/article.html index cb3129c6..73d1e1dd 100644 --- a/src/_includes/article.html +++ b/src/_includes/article.html @@ -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 %} From 4fee5859341a972976ea21341af4f18cc8da5a17 Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Wed, 1 Nov 2023 22:01:54 +0000 Subject: [PATCH 2/3] feat(resources): add layout for Resources, based on Press layout --- src/_layouts/resource.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/_layouts/resource.html diff --git a/src/_layouts/resource.html b/src/_layouts/resource.html new file mode 100644 index 00000000..ba33c3d6 --- /dev/null +++ b/src/_layouts/resource.html @@ -0,0 +1,17 @@ +--- +layout: default +--- + +{% capture date %} {% include date.html date=page.date format = "%B %e, %Y" %} {% endcapture %} + +
+
+
+ Resource +

{{ page.title }}

+
+

{{ date }}

+ {{ page.content }} +
+
+
From 785e31e23281122060a83fb82929a4608b737548 Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Wed, 1 Nov 2023 22:02:34 +0000 Subject: [PATCH 3/3] feat(resources): update Jekyll config to use resource layout asset-based Resources still go directly to the asset --- _config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 709dc9ff..c474df77 100644 --- a/_config.yml +++ b/_config.yml @@ -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"