mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-25 08:58:58 -05:00
Removed page content reading meta description. It was pointless. Set a description in your site or page yaml to add a meta description
This commit is contained in:
parent
6caab53ab9
commit
b785a87869
@ -7,8 +7,8 @@
|
|||||||
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title>
|
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title>
|
||||||
<meta name="author" content="{{ site.author }}">
|
<meta name="author" content="{{ site.author }}">
|
||||||
|
|
||||||
{% capture description %}{% if page.description %}{{ page.description }}{% elsif site.description %}{{ site.description }}{% else %}{{ content | raw_content }}{% endif %}{% endcapture %}
|
{% capture description %}{% if page.description %}{{ page.description }}{% elsif site.description %}{{ site.description }}{% endif %}{% endcapture %}{% if description.length %}
|
||||||
<meta name="description" content="{{ description | strip_html | condense_spaces | truncate:150 }}">
|
<meta name="description" content="{{ description }}">{% endif %}
|
||||||
{% if page.keywords %}<meta name="keywords" content="{{ page.keywords }}">{% endif %}
|
{% if page.keywords %}<meta name="keywords" content="{{ page.keywords }}">{% endif %}
|
||||||
|
|
||||||
<!-- http://t.co/dKP3o1e -->
|
<!-- http://t.co/dKP3o1e -->
|
||||||
|
@ -63,13 +63,6 @@ module OctopressLiquidFilters
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Extracts raw content DIV from template, used for page description as {{ content }}
|
|
||||||
# contains complete sub-template code on main page level
|
|
||||||
def raw_content(input)
|
|
||||||
/<div class="entry-content">(?<content>[\s\S]*?)<\/div>\s*<(footer|\/article)>/ =~ input
|
|
||||||
return (content.nil?) ? input : content
|
|
||||||
end
|
|
||||||
|
|
||||||
# Escapes CDATA sections in post content
|
# Escapes CDATA sections in post content
|
||||||
def cdata_escape(input)
|
def cdata_escape(input)
|
||||||
input.gsub(/<!\[CDATA\[/, '<![CDATA[').gsub(/\]\]>/, ']]>')
|
input.gsub(/<!\[CDATA\[/, '<![CDATA[').gsub(/\]\]>/, ']]>')
|
||||||
@ -116,11 +109,6 @@ module OctopressLiquidFilters
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Condenses multiple spaces and tabs into a single space
|
|
||||||
def condense_spaces(input)
|
|
||||||
input.gsub(/\s{2,}/, ' ')
|
|
||||||
end
|
|
||||||
|
|
||||||
# Removes trailing forward slash from a string for easily appending url segments
|
# Removes trailing forward slash from a string for easily appending url segments
|
||||||
def strip_slash(input)
|
def strip_slash(input)
|
||||||
if input =~ /(.+)\/$|^\/$/
|
if input =~ /(.+)\/$|^\/$/
|
||||||
|
Loading…
Reference in New Issue
Block a user