-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from GSA/4723_org-link-preview
4723 org link preview
- Loading branch information
Showing
2 changed files
with
31 additions
and
34 deletions.
There are no files selected for viewing
63 changes: 30 additions & 33 deletions
63
ckanext/datagovtheme/templates/snippets/link_preview.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,39 @@ | ||
|
||
{% block open_graph_previews %} | ||
{% set pkg = c.pkg_dict %} | ||
<!-- Set defaults --> | ||
{% set dataset = "Data.gov Dataset" %} | ||
{% set organization = "Data.gov" %} | ||
{% set notes = "The Home of the U.S. Government's Open Data" %} | ||
{% set img = "https://s3-us-gov-west-1.amazonaws.com/cg-0817d6e3-93c4-4de8-8b32-da6919464e61/hero-image-bg.png" %} | ||
|
||
<!-- Set if pkg --> | ||
{% set pkg = c.pkg_dict %} | ||
{% if pkg %} | ||
{% set dataset = pkg.title or pkg.name or "Data.gov Dataset" %} | ||
{% set organization = pkg.organization.title or pkg.organization.name or "Data.gov" %} | ||
{% set notes = h.markdown_extract(pkg.notes, 180) or "The Home of the U.S. Government's Open Data" %} | ||
|
||
<!-- Facebook Meta Tags --> | ||
<meta property="og:url" content="https://data.gov"> | ||
<meta property="og:type" content="website"> | ||
<meta property="og:title" content="{{ organization | forceescape }} - {{ dataset | forceescape }}"> | ||
<meta property="og:description" content="{{ notes | forceescape }}"> | ||
<meta property="og:image" content="{{ img }}"> | ||
{% set dataset = pkg.title or pkg.name %} | ||
{% set organization = pkg.organization.title or pkg.organization.name %} | ||
{% set notes = h.markdown_extract(pkg.notes, 180) %} | ||
{% endif %} | ||
|
||
<!-- Twitter Meta Tags --> | ||
<meta name="twitter:card" content="summary_large_image"> | ||
<meta property="twitter:domain" content="data.gov"> | ||
<meta property="twitter:url" content="https://data.gov"> | ||
<meta name="twitter:title" content="{{ organization | forceescape }} - {{ dataset | forceescape }}"> | ||
<meta name="twitter:description" content="{{ notes | forceescape }}"> | ||
<meta name="twitter:image" content="{{ img }}"> | ||
{% else %} | ||
<!-- Facebook Meta Tags --> | ||
<meta property="og:url" content="https://data.gov"> | ||
<meta property="og:type" content="website"> | ||
<meta property="og:title" content="Data.gov Home - Data.gov"> | ||
<meta property="og:description" content="The Home of the U.S. Government's Open Data"> | ||
<meta property="og:image" content="{{ img }}"> | ||
<!-- Set if org --> | ||
{% set org = c.group_dict %} | ||
{% if org %} | ||
{% set dataset = "Data.gov Organization" %} | ||
{% set organization = org.title or org.name %} | ||
{% set notes = h.markdown_extract(org.description, 180) %} | ||
{% endif %} | ||
|
||
<!-- Twitter Meta Tags --> | ||
<meta name="twitter:card" content="summary_large_image"> | ||
<meta property="twitter:domain" content="data.gov"> | ||
<meta property="twitter:url" content="https://data.gov"> | ||
<meta name="twitter:title" content="Data.gov Home - Data.gov"> | ||
<meta name="twitter:description" content="The Home of the U.S. Government's Open Data"> | ||
<meta name="twitter:image" content="{{ img }}"> | ||
<!-- Facebook Meta Tags --> | ||
<meta property="og:url" content="https://data.gov"> | ||
<meta property="og:type" content="website"> | ||
<meta property="og:title" content="{{ organization | forceescape }} - {{ dataset | forceescape }}"> | ||
<meta property="og:description" content="{{ notes | forceescape }}"> | ||
<meta property="og:image" content="{{ img }}"> | ||
|
||
{% endif %} | ||
<!-- Twitter Meta Tags --> | ||
<meta name="twitter:card" content="summary_large_image"> | ||
<meta property="twitter:domain" content="data.gov"> | ||
<meta property="twitter:url" content="https://data.gov"> | ||
<meta name="twitter:title" content="{{ organization | forceescape }} - {{ dataset | forceescape }}"> | ||
<meta name="twitter:description" content="{{ notes | forceescape }}"> | ||
<meta name="twitter:image" content="{{ img }}"> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters