Major Change To Serenity


So I finnally reworked the date scheme of how Serenity works and I've moved away from using file modified time to a fixed text time.

All you need to do is add YYYY/MM/DD HH:MM as a first line in your post and Serenity will do the rest.

However, as I had already converted everything fromWordpress to the old method, I was in a bit of a fix with how to cleanly convert the times and put them into posts (without me doing it manually).

So I made a really quick and dirty script to do just that -- in case any one (for some crazy reason) decided to use Serenity before this.



for file in ${_base_}var/*; do
	filename=(${file//// })
	filepath=$((${#filename[@]} - 1))
	date=$(stat --format=%Y ${file})
	date=$(date -d@${date} +"%Y/%m/%d %H:%M")
	echo "${date}" | cat - ${file} > ${_base_}${filename}

You'll need to set _base_ to your respective web root, and you'll need to make the directory. If you trust the script enough, you can also add a line with "mv ${_base_}${filename} ${_base_}var/${filename}" or similar.

As usual, I'm not responsible for this script breaking anything.


This new date system isn't perfect by any stretch, but it's working towards a much more robust system that can survive a copy (which is what I did to break things the other day).