Skip to content

Commit

Permalink
Add sitemap + SEO plugin (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
machikoyasuda authored Sep 3, 2024
2 parents 776ce30 + 53d0780 commit e229690
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ source "https://rubygems.org"
gem "jekyll", "~> 4.3.3"
gem "rubyzip", "~> 2.3"
gem "jekyll-sass-converter", "2.2.0"
gem "jekyll-seo-tag", "~> 2.8.0"
gem "jekyll-sitemap", "~> 1.4.0"
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ GEM
webrick (~> 1.7)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
Expand Down Expand Up @@ -70,6 +74,8 @@ PLATFORMS
DEPENDENCIES
jekyll (~> 4.3.3)
jekyll-sass-converter (= 2.2.0)
jekyll-seo-tag (~> 2.8.0)
jekyll-sitemap (~> 1.4.0)
rubyzip (~> 2.3)

BUNDLED WITH
Expand Down
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ source: ./src
timezone: America/Los_Angeles
title: "Cal-ITP: California Integrated Travel Project"
url: "https://www.calitp.org"
plugins:
- jekyll-seo-tag
- jekyll-sitemap
26 changes: 8 additions & 18 deletions src/_includes/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,25 @@
{%- endif -%}
{%- assign description = description | normalize_whitespace -%}
{%- assign is_article = page.date and page.tags -%}

<meta charset="utf-8" />
<title>{{ title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="{{ description }}" />

{% seo title=title description=description %}

{%- if is_article -%}
{%- for tag in page.tags -%}
<meta property="article:tag" content="{{ tag }}" />
{%- endfor -%}
<meta property="article:published_time" content="{{ page.date | date: "%FT%T%z" }}" />
{%- endif -%}
<meta property="og:description" content="{{ description }}">

{% comment %} OpenGraph fields that won't be rendered by the jekyll-seo plugin {% endcomment %}
<meta property="og:image" content="{{ site.url | absolute_url }}/images/og-image.png" />
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="{{ site.title }}">
<meta property="og:title" content="{{ page_title }}" />
{%- if is_article -%}
<meta property="og:type" content="article">
{%- else -%}
<meta property="og:type" content="website">
{%- endif -%}
<meta property="og:url" content="{{ page.url | absolute_url }}" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@California_ITP">
<meta name="twitter:creator" content="@California_ITP">
<meta name="twitter:description" content="{{ description }}" />
<meta name="twitter:domain" content="{{ site.domain }}" />
<meta name="twitter:image" content="{{ site.url | absolute_url }}/images/og-image.png" />
<meta name="twitter:site" content="@California_ITP">
<meta name="twitter:title" content="{{ page_title }}" />
<meta name="twitter:url" content="{{ page.url | absolute_url }}" />

<link rel="canonical" href="{{ page.url | absolute_url }}" />
3 changes: 3 additions & 0 deletions src/press.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
layout: default
permalink: /press

title: Press
description: >
News about Cal-ITP and our initiatives, including press releases and media coverage about new launches and project milestones.
---

{% include clipped-header.html %}
Expand Down
3 changes: 3 additions & 0 deletions src/resources.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
layout: default
permalink: /resources

title: Resources
description: >
Information about Cal-ITP and our initiatives, including fact sheets, case studies, and more.
---

{% include clipped-header.html %}
Expand Down

0 comments on commit e229690

Please sign in to comment.