extends vibelog.blocks

block vibelog.title
	- title = info.post.header;

block vibelog-content
	- import std.datetime;
	- import vibe.inet.message;

	#vibelogContent
		- if (info.settings.enableBackButton)
			a.backButton(href="../?page=#{info.postPage}") Back

		.blogSinglePost
			.blogPost
				header
					.blogPostHeaderContent
						- if (info.post.headerImage.length && info.settings.placePostHeaderImageFirst)
							img.headerImage(alt="Header image", src="#{info.post.headerImage}")
						h1= info.post.header
						- if (info.post.headerImage.length && !info.settings.placePostHeaderImageFirst)
							img.headerImage(alt="Header image", src="#{info.post.headerImage}")
						.blogPostHeaderText(class='#{info.post.headerImage.length ? "with-image" : "without-image"}')
							span.blogPostDate= toRFC822DateString(info.post.date)
							| #{info.post.subHeader}
				section.blogPostContent(class='#{info.post.headerImage.length ? "with-image" : "without-image"}')
					!= info.post.renderContentAsHtml(info.settings, info.refPath, 1)

				footer
					p Posted at #{toRFC822TimeString(info.post.date)} by #{info.post.author in info.users ? info.users[info.post.author].name : info.post.author}

			section.comments
				- if (!info.post.commentsAllowed)
					p Comments for the post are currently disabled.

				include diskuto.inc.comments
				- includeDiskuto(info.diskuto, "vibelog-"~info.post.id.toString());

block vibelog-recent-list
	include vibelog.inc.postlist
	- insertVibelogPostList();
