Skip to content

Commit

Permalink
bugfix. fix sitemap time format
Browse files Browse the repository at this point in the history
  • Loading branch information
muxueqz committed Aug 14, 2019
1 parent d8c93b0 commit 8db5643
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build.nim
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,21 @@ proc write_atom(posts: seq[JsonNode]) =
proc write_sitemap(posts: seq[JsonNode]) =
var
seq_post : seq[string]
p: string
p, post_dt: string
dt: DateTime

# <lastmod>$2</lastmod>
for key, post in posts:
dt = parse(post["Date"].getStr, "yyyy-MM-dd HH:mm")
post_dt = format(dt, "yyyy-MM-dd\'T\'HH:mm:sszzz")
p = """
<url>
<loc>$3/$1.html</loc>
<lastmod>2019-08-09T22:48:11+00:00</lastmod>
<lastmod>$2</lastmod>
<priority>1.00</priority>
</url>
""" % [
post["Slug"].getStr,
post["Date"].getStr,
post_dt,
site_root,
]
seq_post.add p
Expand Down

0 comments on commit 8db5643

Please sign in to comment.