Mandaris Moore


I think I'm ready to mark my second pelican theme 1.0 as "Feature Complete" today! I started off with -what I thought- a simple premise of having a site site took a lot longer than I expected but I'm pretty happy with the site for now. But before I tag it and start working on 2.0, I want to go over what I've done so far.

Visualization of what I've accomplished with the blog.
Visualization of what I've accomplished with the blog.

Parsable

The first thing I started researching was how to make the site parsable by webcrawlers. Although it's a personal blog, I wanted people to be able to find the content easily.

OpenGraph

OpenGraph was the first thing that I came across and appealed to me the most because it's the preferred way of parsing data for Twitter1.

I found it especially rewarding that the tags are also parsed by facebook and my new favorite social network slack.

One of the technical difficulties that I ran into when adding OpenGraph tags was adding the images. The specification for OpenGraph states that images to be used need to be added as meta data in the head of the html. This can be a pain as the other data like title and date can be pulled from the article itself and I didn't want to go through all my old posts to add image meta data.

Luckily, the github user WhiskyEchoBravo had a project that searched the content of the post for images and added the first to the list of tags. I'm a little proud that I helped with issues with pages.

Afterwards, I did run into some frustration when the images that I added to posts wouldn't be as big as I expected.

Post in slack with a small image.
Post in slack with a small image.

Ultimately, I think it's because of the mixing and matching of having OpenGraph and twitter specific tags and was solved it by making sure I used the following for my twitter card.

<meta name="twitter:card" content="summary_large_image" />

And now I get the post to unfurl nicely.

Post in slack with a large image.
Post in slack with a large image.

Schema.org

This is the styling used by both Bing and Google. I put this in as a challenge to myself to make it work in both instances. I leaned a lot from the example on OrbitingWeb and refined what I was working with using another example that I found on github.

Valid Semantic Tags

For this, I just wanted to use some of those really cool semantic tags that html5 has given to us. When I look at the code for some pages on the internet I see a lot of <div> tags with classes that could be replaced with <main>, <nav>, or <section> tags.

I'm willing to just attribute it to my desire to have my own style or maybe just inexperience, but I'm happy to report that the site passes html validation except for the OpenGraph definitions found in the header.

figure it out

One technical hurdle I ran into was that I wanted my images to be wrapped in the <figure> tag and also have a <figcaption> tag that would have the alternative text.

I searched for a plugin for pelican2, but the closest thing I could find was liquid tags at the time3.

I did find jdittrich figureAltCaption project on github which was a extension for the python-markdown that pelican uses. I even submitted a pull request to allow it to do reference links!

There was a little confusion on getting it to work because pelican has been changing since some of these plugins were created.

Long story short, I had to add the following to my pelicanconfig.py to get it to work.

   # Markdown Plugins
MARKDOWN = {
    'extension_configs': {
        'markdown.extensions.codehilite': {'css_class': 'highlight'},
        'markdown.extensions.extra': {},
        'markdown.extensions.meta': {},
        'figureAltCaption':{},
    },
    'output_format': 'html5',
}

Easy to share

I wrote down that I wanted the site to be easy to share and it is when you look at the amount of tags and metadata that is in every page.

At one point, I wanted to add share buttons, but -with the rise in concerns about privacy- I wanted the users of the site to be the ones who would share it.

Also, I'm still working on color schemes so the buttons might clash with whatever I end up with.

Clash of the social buttons!
Clash of the social buttons!

Accessible

One of the underlining principles of this site design is that I wanted it to be accessible to as many people as possible. It's part of the reason that I've worked so hard on making sure that I included so many semantic tags. I didn't think that this was particularly hard to do when you understand what needs to happen before you begin.

The theme doesn't have any errors at this point, but does loose some points because of the way that markdown headers are handled and the fact that I picked a low contrast color for my links. I'll fix it soon.

Conclusion and where I'm going next

Overall, I'm happy with this version of the site and blogging about it has helped me think about what places I want to refine going forward.

List of things to improve

  • Create a decent readme with all the packages and properties that the theme uses
  • Improve color contrast for reading
  • Add Cristian Prieto's mdx_downheader
  • Make the top navigation a little less clunky
  • Look into how to integrate micro.blog posts

If you want to contribute you can find the theme on github here.


  1. Twitter is still my social network of choice and -despite it's flaws- is not as creepy as facebook. 

  2. Seriously didn't see Chris MacMackin's figure-ref until I was writing this article. I'll have to look into it for my next version. 

  3. I used this to make my previous theme Tufte and did not want to go down that road twice. It is very specific to pelican and I didn't want to dive into more regular expressions when I knew there had to be a solution already created. 


I've had a little idea going on in the back of my head for the last couple of months about a simple application that would pop up after a given keyboard shortcut. It's a simple idea and never got around to doing it because I didn't sit down and do it. Even on the days, where I thought "Hey,If I had an easy way to keep track of all the good things that I've done, I'd feel better about myself". Normally, I just look at the todo item that I had in OmniFocus and just push it back a couple days or weeks because of priorities.

But today, I sat down and decided that if I wanted to really follow my own words about controlling my life I've got to make good on the commitments that I make to myself big or small.

So I sat down behind my laptop opened up my AppleScript 1-2-31 and started searching the internet after not seeing a solution to my problems on the first page.

set theSumm to text returned of (display dialog "Latest Accomplishment" buttons "OK" default answer "A step forward" default button "OK")

tell application "Calendar"
    make todo at end of todos of calendar "Accomplishments" with properties {summary:theSumm, completion date:current date}
end tell

At first, I was just going to put this in a script file and then run it from a service, but I decided that the easiest way of doing this was to use Keyboard Maestro. It was really cool that I got to move the entire script into the application so I didn't have to move between the different applications.

A copy of my first keyboard maestro attempt to make a short cut to log my accomplishments

This is what I had originally envisioned, but I started to think about the limitations of keeping all of this in reminders. All the applications that use the system built task management tools have a focus on what needs to be done and if I want to have way to look at this stuff quickly and I wasn't sure how to look at accomplishments that were marked as completed a month ago.

I took a look at what I was doing on a daily basis and saw that I've been doing more and more journaling using Day One2.

I didn't want to make the Day One application open up every time that I finished something new so I looked at the command line interface and came up with this.

Screenshot of my keyboard maestro macro to log accomplishments quickly using the command line interface for Day One

So far, the only downside is that I have to go into Day One to make all the hashtags turn into tags and I have to do a search for that tag if I want to see all my accomplishments in a given time.

I think for the next iteration, I might set up GeekTool to show my latest accomplishment on my desktop, but I'm just happy that I finished this initial task.


  1. I bought this book almost a year ago so that I could start teaching myself to do more automation on my computer. Turns out, I just needed to take the time and focus on something that I really wanted to create. It felt good and I think I'll actually get through it... when I get the time. 

  2. I'd already had a specific keyboard shortcut for opening up the menubar pop up for quick writing of thoughts and feelings, but I didn't want to add a textexpander snippet to add an accomplishment tag.