Skip to content

Commit

Permalink
Merge pull request #852 from okfn/852-meta-information
Browse files Browse the repository at this point in the history
Improve description when using social sharing links
  • Loading branch information
nigelbabu committed Jun 20, 2013
2 parents f715644 + 561e05d commit 8708d24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ckan/templates/package/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
<link rel="alternate" type="application/rdf+xml" href="{{ h.url_for(controller='package', action='read', id=pkg.id, format='rdf', qualified=True) }}"/>
{% endblock -%}

{% block head_extras -%}
{{ super() }}
{% set description = h.markdown_extract(pkg.notes, extract_length=200)|forceescape %}
<meta property="og:title" content="{{ h.dataset_display_name(pkg) }} - {{ g.site_title }}">
<meta property="og:description" content="{{ description|forceescape }}">
{% endblock -%}

{% block actions_content %}
{# NOTE: Not implemented in stage 1 #}
{# <li>{% link_for _('History'), controller='package', action='history', id=pkg.name, class_='btn', icon='undo' %}</li> #}
Expand Down
7 changes: 7 additions & 0 deletions ckan/templates/package/resource_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

{% set res = c.resource %}

{% block head_extras -%}
{{ super() }}
{% set description = h.markdown_extract(res.description, extract_length=200) if res.description else h.markdown_extract(c.package.notes, extract_length=200) %}
<meta property="og:title" content="{{ h.dataset_display_name(c.package) }} - {{ h.resource_display_name(res) }} - {{ g.site_title }}">
<meta property="og:description" content="{{ description|forceescape }}">
{% endblock -%}

{% block subtitle %}{{ h.dataset_display_name(c.package) }} - {{ h.resource_display_name(res) }}{% endblock %}

{% block breadcrumb_content_selected %}{% endblock %}
Expand Down

0 comments on commit 8708d24

Please sign in to comment.