feat: Optimized sitemap lastmod generation and fixed page title

This commit is contained in:
imtodor 2018-10-22 16:48:35 +03:00
Родитель a8c8b3e432
Коммит 1279b3e07c
2 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="turbolinks-root" content="{{site.baseurl}}/">
<title>{{ page.page_title | page.title }} - {{ site.product }}</title>
<title>{{ page.page_title | default: page.title }} - {{ site.product }}</title>
<meta name="description" content="{{ page.description }}" />
{% if page.res_type %}<meta name="restype" content="{{ page.res_type }}">{% else %}<meta name="restype" content="documentation">{% endif %}
<link rel="shortcut icon" href="{{site.baseurl}}/favicon.ico"/>

Просмотреть файл

@ -1,6 +1,7 @@
class TimeStampTag < Liquid::Block
def initialize(tag_name, markup, tokens)
@text = markup
@@today_date = Date.today.to_s
super
end
@ -8,7 +9,8 @@ class TimeStampTag < Liquid::Block
contents = super
content = Liquid::Template.parse(contents).render context
# aim for YYYY-MM-DD format https://www.google.com/sitemaps/protocol.html#lastmoddef
`git log -1 --format=%cd --date=short #{content}`.strip
#`git log -1 --format=%cd --date=short #{content}`.strip
@@today_date
end
end