Skip to content

Commit

Permalink
update date functions for updated docpad
Browse files Browse the repository at this point in the history
  • Loading branch information
lethee committed May 21, 2013
1 parent 756a49d commit e3d8336
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/documents/atom.xml.coffee
Expand Up @@ -15,7 +15,7 @@ anEntry = (document) ->
tag 'entry', ->
title '<![CDATA[ ' + document.get('title') + ' ]]>'
tag 'link', href: "#{@site.url}#{document.get('url')}"
tag 'updated', document.get('date').toISODateString()
tag 'updated', document.get('date').toISOString()
tag 'id', "#{@site.url}#{document.get('url')}"
tag 'content', type: 'html', -> renderContent document, @site.url

Expand All @@ -24,7 +24,7 @@ tag 'feed', xmlns: 'http://www.w3.org/2005/Atom', ->
title '<![CDATA[ ' + @site.title + ' ]]>'
tag 'link', href: "#{@site.url}/atom.xml", rel: 'self'
tag 'link', href: @site.url
tag 'updated', @site.date.toISODateString()
tag 'updated', @site.date.toISOString()
tag 'id', @site.url
for name of @authors
author = @authors[ name ]
Expand Down
6 changes: 3 additions & 3 deletions src/documents/sitemap.xml.coffee
Expand Up @@ -6,10 +6,10 @@ anEntry = (url, lastmod, freq) ->

text '<?xml version="1.0" encoding="utf-8"?>\n'
tag 'urlset', xmlns: 'http://www.sitemaps.org/schemas/sitemap/0.9', 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation':'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd', ->
anEntry '', @site.date.toISODateString(), 'weekly'
anEntry '', @site.date.toISOString(), 'weekly'
siteDate = @site.date
@getCollection('documents').forEach (document)->
if document.get('encoding') != 'binary' and 0 is document.get('url').indexOf '/articles'
anEntry document.get('url'), document.get('date').toISODateString(), 'never'
anEntry document.get('url'), document.get('date').toISOString(), 'never'
else
anEntry document.get('url'), siteDate.toISODateString(), 'weekly'
anEntry document.get('url'), siteDate.toISOString(), 'weekly'
4 changes: 2 additions & 2 deletions src/layouts/article.html.coffee
Expand Up @@ -81,7 +81,7 @@ if @document.relatedDocuments.length > 0
ul ->
@document.relatedDocuments.forEach (document)->
li ->
span "#{document.date.toShortDateString()}"
span @helper.formatDate(@document.date)
text '&raquo;'
a href: "#{document.url}", "#{document.title}"

Expand All @@ -108,4 +108,4 @@ section '#comments', ->
<div class="fb-like" data-href="#{@site.url}#{@document.url}" data-send="true" data-width="450" data-show-faces="true"></div>
<div class="fb-comments" data-href="#{@site.url}#{@document.url}" data-num-posts="1"></div>
</div>
"""
"""

0 comments on commit e3d8336

Please sign in to comment.