Skip to content

Commit

Permalink
fix meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
sknep committed Dec 3, 2024
1 parent 98153f9 commit b0a0c41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion _data/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >- # this means to ignore newlines
Aenean et sapien a leo auctor scelerisque quis nec magna. Sed dictum ante a risus vehicula facilisis.
# Twitter handle. Only the handle, not the URL.
twitter: 18F
# twitter: agency_name

# Used to construct absolute URLs throughout the site
url: "https://agency-production-url.gov"
Expand Down
22 changes: 14 additions & 8 deletions _includes/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Title and meta description
================================================== -->
<title>{{page.title}}</title>
<meta property="og:title" content="{{page.title}}" />
<meta name="description" content="{{page.description}}" />
<meta property="og:description" content="{{page.description}}" />
{% assign pageTitle = title | append: " | " | append: site.title -%}
{%- assign pageDesc = page.description | default: site.description -%}
{%- assign pageUrl = site.url | append: page.url -%}

<title>{{pageTitle}}</title>
<meta property="og:title" content="{{ pageTitle }}" />
<meta name="description" content="{{ pageDesc }}" />
<meta property="og:description" content="{{ pageDesc }}" />

<meta name="twitter:card" content="summary" />
{% if site.twitter -%}
<meta name="twitter:site" content="@{{site.twitter}}" />
<meta name="twitter:title" content="{{page.title}}" />
<meta name="twitter:description" content="{{page.description}}" />
{%- endif %}
<meta name="twitter:title" content="{{ pageTitle }}" />
<meta name="twitter:description" content="{{pageDesc}}" />

<meta property="og:type" content="article" />
<link rel="canonical" href="{{ page.url }}" />
<meta property="og:url" content="{{ page.url }}" />
<link rel="canonical" href="{{ pageUrl }}" />
<meta property="og:url" content="{{ pageUrl }}" />

<script src="{{ assetPaths['uswds-init.js'] }}"></script>
<!-- CSS
Expand Down

0 comments on commit b0a0c41

Please sign in to comment.