Remove the period when double spacing on the Mac

In one of the recentish Mac updates they added the feature from iOS where if you hit the spacebar twice in a row it will automatically add a period. On iOS I really like this feature, but on my Mac with a real keyboard it drives me crazy. I decided to do what all developers do and rant about it on Twitter and someone told me it’s in the settings. Doh!

To remove this open system preferences -> keyboard and just uncheck the option.

Love a nice and easy fix like this.

How to save an SVG from HTML

If you’ve worked with SVG’s before you may know that you can grab the file by inspecting the DOM through your browsers developers tools, and then copy and pasting the <svg… code into a new file and saving as file.svg. This works fine a lot of times, but what if the SVG has css styles applied? This is where it can get tricky and something I’ve been running into more and more.

SVG Export Plugin

Luckily there is a free Chrome/Firefox plugin called SVG Export that will do all this for you automatically and easily let you export into almost any format you desire. As well as letting you copy it to the clipboard and opening in popular apps like Sketch, Figma, and more.

Statamic SEO Pro with Laravel Controllers

Statamic has a great first party plugin called SEO Pro that includes a lot of settings every site probably needs for search engine optimization including things like og tags, dynamic titles, descriptions, and even canonical urls.

It has been working perfectly for me but today I hit a small snag with how it tries to dynamically set the canonical url and it wasn’t working when loading Statamic Antlers views through a Laravel controller. For example, here is the code I use to show an about page:

return (new \Statamic\View\View)
    ->template('about')
    ->layout('layout')
    ->with([
        'content' => 'my content here',
    ]);

When this page is loaded the SEO Pro plugin was using the home page as the canonical url.

<link href="https://mysite.com" rel="canonical" />

To set your own canonical URL you just need to pass it manually like this:

return (new \Statamic\View\View)
    ->template('about')
    ->layout('layout')
    ->with([
        'content' => 'my content here',
        'seo' => ['canonical_url' => 'https://mysite.com/about']
    ]);

With that in place the plugin will pull the setting you pass and use it in the parsed html source. I’m sure you can also change other settings this way as well, so if you ever need to dynamically customize what data it uses look at adding to an “seo” array when passing your data to the view.