The home on the web of Colin Walker.
Find out more on /about, say /EHLO, or tune in to the daily RSS feed.
More on post titles
After adding the per-post title toggle I got to wondering how I could make things even simpler. Or, at least, provide more choice.
Inspired by the likes of Drafts and Ulysses, I thought it might be nice to use the first line of a post as the title if it was marked up as a Markdown H1 tag.

If a post is written in this way, the blog and drafts pages (along with the RSS feed generators) check the content and separate out the title before reconstructing the remaining text as the content:
$post_array = explode("\n", $content);
$size = sizeof($post_array);
if (substr($post_array[0], 0, 2) == "# ") {
$length = strlen($post_array[0]);
$required = $length - 2;
$post_title = substr($post_array[0], 2, $required);
$title_in_body = true;
$content = '';
for ($i = 2; $i < $size; $i++) {
$content .= $post_array[$i];
}
}
It's always good to have a choice.
Leave a reply
2021/08/18#p2
The Live Feed picked up the new title format correctly so I'll just check that the Daily Feed works correctly tomorrow and commit the changes as long as I can work out some kinks.
No comments yet
Leave a reply
2021/08/18#p3
Liked: Take Note – CJ Chilvers...
No comments yet
Leave a reply
I made a couple of changes to (b)log-In last night which have now been synched to the repository: updated the search page so that results are correctl…