The page you were looking for doesn't seem to exist. Try one of the items in the main menu above.
Looks like you got off track a little.
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2ca2e9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile ~/.gitignore_global + +# Ignore bundler config +/.bundle + +# Ignore the build directory +/build + +# Ignore Sass' cache +/.sass-cache \ No newline at end of file diff --git a/404.html b/404.html deleted file mode 100644 index d5db153..0000000 --- a/404.html +++ /dev/null @@ -1,16 +0,0 @@ -
Page not found
Looks like you got off track a little.
The page you were looking for doesn't seem to exist. Try one of the items in the main menu above.
Front End Developer from Melbourne, Australia
Oh, hi there. I'm Tom.
I love building websites and am so grateful to been doing so for a living. My love affair began dabbling in building sites for a variety of no-name bands I had the fun of playing in and has manifested itself into a keen interest in responsive design and front-end performance.
This site was started to document my findings and challenges in projects and tinkerings as I come across them. It's more of a technical journal than a blog. Some posts will be a long analysis on an idea and some will be quick, little thoughts. Either way I hope you get something out of them.
If you'd like to get in contact please send me an email. Otherwise, we can communicate over twitter.
So here it is; my very own blog site. This debut post is dedicated to discussing a few new techniques I tried during the development process.
I’ve been an advocate for responsive web design in the last few projects I’ve worked on and one thing I really have trouble with is typography. I agree with Harry Roberts and find it helpful to preset your font sizes, testing them out in a digital styleguide or standard content page. As well as this I wanted to take it a step further and try out something that I read on Trent Walton’s blog where the font size for the entire site is scaled based on a variety of breakpoints.
I was able to achieve this by applying a percentage (%) based value to the body element within a bunch of predetermined breakpoints (these are written using Sass using variables and mixins, so I’ve just included the outputted css below).
body {
- font-size: 100%;
- line-height: 1.4;
-}
-@media screen and (min-width: 600px) {
- body {
- font-size: 112.5%;
- line-height: 1.6;
- }
-}
-@media screen and (min-width: 800px) {
- body {
- font-size: 125%;
- line-height: 1.6;
- }
-}
-@media screen and (min-width: 1200px) {
- body {
- font-size: 150%;
- }
-}
- The other major thing I wanted to try was breaking out of the 960 grid and make things more fluid. I’ve tinkered with a variety of grid frameworks such as; Foundation, Bootstrap and inuit, with my most preferred being Susy. When starting development on this blog, I began using Susy but found that I was too constricted to it’s rules and soon ran into issues when it came to fluid breakpoints.
Realising the design only really calls for a single column with the exception of the little profile image in the footer, I threw it all out and simply set varying container widths at each breakpoint (If I find that I need to split the content into more than one column, I’ll create those styles as I need them).
.container {
- @extend %cf;
- position: relative;
- width: 90%;
- margin: 0 auto;
-
- @include respond-to($desk) { // 800px / 16px
- width: 86%;
- }
-}
-
-.article {
- @include respond-to($desk) {
- width: 70%;
- margin-left: auto;
- margin-right: auto;
- }
-}
- And voila! A nice little fluid blog that scales quite nicely.
T
TOPICS: responsive setup
The last few months have been pretty full on at work. Along with late nights working on a few pet projects, it wasn't long before I started to feel the burn (out).
I was in a terrible spot, burning the candle at both ends. I got migrains for the first time ever, my mood was the lowest it had ever been and I began to notice I was quite unpleasant to be around. I was snapping at people all the time, simple tasks were getting the better of me, I was having trouble focusing and was always tired.
Now, I’m quite a tall guy and have lived majority of my life feeling lethargic and run down but a recent trip to the doctor showed that I was fine. No illnesses, no diseases, nothing wrong with any of my organs. Just healthy. So clearly, I needed to change something.
My wife and I got a bit of money back from the taxman (what a guy!) and decided to invest it into our wellbeing. We signed up to our local gym which has a pool and variety of classes like boxing, yoga, cycling, etc. I also started to attend the free yoga classes my work offers every Tuesday.
I gotta say. Two weeks into the new regime and I’m feeling much better. I’ve swapped late night coding sessions with an early morning workout.
The results:
I originally wrote this post back in October and it’s now almost 2014. Unfortunately for me the new regime fell flat as soon as the taxman money dried up (actually I got a little sick of 6:30am starts and easily convinced myself that the sleep in was just as good for me). But I’m not giving up!
I have the grand plan of riding to work each day for the entire year (no pressure haha).
I’ve already given up coffee for tea (I was addicted)
I’ve given my wife permission to rip the laptop from my hands and hit me over the head with a book for me to read once it hits 10pm
Lunch time walks around the park near work will also feature heavily as it’s a great excuse to get away from my desk and not just hunch in the kitchen over my tuna wrap.
Bascially, I want to be more focused, more energetic and most importantly, more pleasant to be around. I know this has deviated from my plan to blog about my site’s setup but we can always get to that… To me this is super important!
If you’ve identified with anything I’ve mentioned here I urge you to make the switch and look after yourself. You’ll feel better for doing so.
T
TOPICS: opinion
Middleman's blog engine is pretty powerful. Check out the following article from a fellow blogger that helped me get this site up and running.
The Middleman docs on blogging have a lot of great info to get you started with building your own blog using middleman but if you want more of a step by step how-to, Design by Joel has a really great article on building a blog in middleman.
Enjoy!
T
Setting up pagination for my blog was easy enough however, trying to get it to work was a little less straight forward. So I'd like to share how I got pagnination setup on this here site.
Inside the activate:blog do |blog| block of my config.rb file, I added the following pagination settings;
blog.paginate = true
-blog.page_link = "page:num"
-blog.per_page = 5
- Although they’re pretty straight forward, demos and explainations of the above settings can be found in the Middleman docs.
This is where I had a little difficulty.
In order for pagnination to work after setting up pagination in config.rb, I needed to add in a little frontmatter tag to the top of the template I wanted to paginate. This is very important. Forget to include this and the rest of the code is useless.
---
-pageable: true
----
- Add this to the top of any template you want to use pagination on. The homepage of my site is the only place I require any pagination for the time being so I added this to top of the index.html.erb file in the root of my site.
This essentially tells middleman that we want to split up the contents of this site into manageable pages. Middleman then uses the settings in your config.rb file to figure out how many items per page.
So after configuring and enabling pagination on my site I needed to output the markup. I opted for a fairly simple pagination pattern that shows “Articles X to Y of Z” with next (newer) and previous (older) navigation. To do this I needed to use some of Middleman’s built-in pagination variables;
The final code snippet looks like this;
<div class="article pagination">
- <p class="pagination__summary">Articles <%= page_start %> to <%= page_end %> of <%= articles.length %></p>
- <ul class="list--clean list--pagination">
- <% if prev_page %>
- <li class="prev">
- <a href="<%= prev_page.url %>">Older articles</a>
- </li>
- <% end %>
- <% if next_page %>
- <li class="next">
- <a href="<%= next_page.url %>">Newer articles</a>
- </li>
- <% end %>
- </ul>
-</div>
- So there you have it, pagination on a static site thanks to Middleman. Hopefully that helps clear things up for some people looking to achieve the same or a similar result.
T
Middleman can generate dynamic pages with a data file, a template and a little configuration. Let me show you how.
I first stumbled across Middleman’s dynamic pages feature on a freelance project I was working on for a friend of mine. The site was for a local event manager who wanted to showcase several (I think it was about 10) of their most recent events.
Now I’m not a huge fan of manual coding and always look for ways to automate or reuse code so I really didn’t want to have to manually create all those pages.
Unfortunately the Middleman demo is a little basic for what I needed but luckily for me with a bit of digging and some communication back and forth with one of Middleman’s contributors, Ben Hollis, I discovered the true power of dynamic pages.
Like I mentioned in the intro, all you need is 3 key ingredients; a data file, a template and a couple of lines in your config.rb file.
Here’s how I have implemented it.
On the same level as my source (and eventually build) directories I created a data directory. Within my newly created data directory I created a new YAML file called projects.yml (Middleman also supports JSON data).
This YAML file contained all the data properties of a project and was to be used for looping through and outputting each project’s details into a template.
Let’s say each project has a client, title, description and list of event manager’s responsibilities.
Our projects.yml file looks something like this;
- client: client1
- title: "First project"
- description: "This is a description of the 1st project."
- responsibilities:
- "<li>catering</li>
- <li>venue management</li>
- <li>event staffing</li>"
-
- - client: client2
- title: "Second project"
- description: "This is a description of the 2nd project."
- responsibilities:
- "<li>catering</li>"
- In my project (within the source directory) I created a new directory called projects (as this is what I was going to be displaying). Inside the projects directory I created template.html.erb. This file is to be referenced in config.rb as the template to use for generating the individual project pages.
The template looks like this;
<% p = locals[:project] %>
-<div class="l-wrapper">
- <div class="l-content">
- <h2><%= p[:title] %></h2>
- <%= p[:description] %>
- <p class="highlight">Key responsibilities:</p>
- <ul class="itemised-list">
- <%= p[:responsibilities] %>
- </ul>
- </div>
-</div>
- Don’t worry about the <% p = locals[:project] %> at the top of the file, locals[:project] is defined in config.rb and will be explained in the next section.
‘p’ stores the project data object and is then used to access each property of the project such as title, description and the list of responsibilities.
The final piece of the puzzle lies in the config.rb file with this block;
data.projects.each do |pd|
- proxy "/projects/#{pd[:client]}.html", "/projects/template.html", :layout => :popup, :locals => { :project => pd }, :ignore => true
-end
- What this block is doing is as follows;
data.projects.each do |pd| is looping through each project item in projects.yml
proxy is creating a dummy url using the client property of the project item within projects.yml and is being passed the template file in the projects directory. eg: “www.site.com/projects/client1.html”
layout is pointing to a custom layout which resides in the layouts directory and is different from the standard site layout.
You can also set layout to false if your template has all the html in it (rather than using partial includes)
locals is what passes the data in project.yml to the template (remember p = locals[:projects])
ignore tells middleman not to create a html file for template.html.erb as we only want html files for each of the projects.
So once that’s all setup all you need to do is fire up middleman server and test it out by going to; http://localhost:4567/projects/client1.html
This really is a handy feature and you can get pretty creative with what you store in your data files and how you render that data in the template. Also, remember if you’re not too keen on YAML, Middleman also supports JSON.
So go nuts and start adding dynamic pages to your not-so-static Middleman site!
T
Today's the first day of 2014 and I'd like to set the theme for the new year
It’s really quite simple: do more.
I feel the need to participate and put myself out there more than I have in the past.
To quote weezer:
I don’t wanna be an old man anymore / It’s been a year or two since I was out on the floor / Shakin’ booty, makin’ sweet love all the night / It’s time I got back to the Good Life / It’s time I got back, it’s time I got back / And I don’t even know how I got off the track / I wanna go back…Yeah!
So that means more;
Hopefully this blog will help achieve a lot of the above.
Happy new year!
T
TOPICS: opinion
Make the most of people sharing your products, posts, pages or more simply by adding a few meta tags to the <HEAD> of your site.
With so many people using social media these days, it seems only logical to include the snippets below on all of our sites.
These are probably the most commonly known and you’ve probably used these once or twice before.
<!-- Facebook Open Graph tags -->
-<meta property="og:image" content="" />
-<meta property="og:site_name" content="" />
-<meta property="og:type" content="" />
-<meta property="og:url" content="" />
-<meta property="og:title" content="" />
- More details of Facebook’s OpenGraph tags/options can be found on David Walsh’s Blog
These are a little newer and there is a LOT you can include (links to mobile apps, product details, etc) so make sure you check out the docs via the link below.
<!-- Twitter Card -->
-<meta name="twitter:card" content="summary" />
-<meta name="twitter:creator" content="">
-<meta name="twitter:url" content="" />
-<meta name="twitter:title" content="" />
-<meta name="twitter:description" content="" />
-<meta name="twitter:image:src" content="" />
- More details of Twitter’s Card tags/options can be found in their development docs
Possibly the newest kid on the block launching in 2013, these can also include alot of content when somebody pins something from your site. They type property determines what additional meta data you can share so check out the link to the docs below.
<!-- Pintrest Rich Pins -->
-<meta property="og:title" content="" />
-<meta property="og:description" content="" />
-<meta property="og:type" content="" />
-<meta property="og:url" content="" />
-<meta property="og:image" content="" />
-<meta property="og:site_name" content="" />
- More details of Pinterest’s Rich Pins tags/options can be found in their development docs
An example site for a business selling shoes, with the page template based on a watered down version of the HTML5 boilerplate, could look something like this;
<!DOCTYPE html>
-<html class="no-js">
- <head>
- <meta charset="utf-8" />
- <title>Social Meta Tag Example</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="css/style.css">
- <script src="js/vendor/modernizr-2.7.1.min.js"></script>
-
- <!-- Facebook Open Graph tags -->
- <meta property="og:image" content="http://shop.example.com/images/store/SA-001.jpg" />
- <meta property="og:site_name" content="Example Store" />
- <meta property="og:type" content="product" />
- <meta property="og:url" content="http://shop.example.com/product/SA-001" />
- <meta property="og:title" content="Reebok Shaq Attaq" />
-
- <!-- Twitter Card -->
- <meta name="twitter:card" content="product" />
- <meta name="twitter:creator" content="@exampleStore">
- <meta name="twitter:url" content="http://shop.example.com/product/SA-001" />
- <meta name="twitter:title" content="Reebok Shaq Attaq" />
- <meta name="twitter:description" content="Limited edition Shaquille O'neil basketball shoes." />
- <meta name="twitter:image:src" content="http://shop.example.com/images/store/SA-001.jpg" />
-
- <!-- Pintrest Rich Pin -->
- <meta property="og:title" content="Reebok Shaq Attaq" />
- <meta property="og:description" content="Limited edition Shaquille O'neil basketball shoes." />
- <meta property="og:url" content="http://shop.example.com/product/SA-001" />
- <meta property="og:image" content="http://shop.example.com/images/store/SA-001.jpg" />
- <meta property="og:site_name" content="Example Store" />
- <meta property="og:price:amount" content="119.00" />
- <meta property="og:price:standard_amount" content="159.00" />
- <meta property="og:price:currency" content="USD" />
- <meta property="og:availability" content="instock" />
- <meta property="og:see_also" content="http://shop.example.com/product/SA-001" />
- <meta property="og:rating" content="4.5" />
- <meta property="og:rating_scale" content="5" />
- <meta property="og:rating_count" content="33" />
- <meta property="product:gender" content="Men" />
- <meta property="product:color" content="White and Blue" />
- </head>
- <body>
-
- <p>Hello world! This is HTML5 Boilerplate with social sharing meta tags.</p>
-
- </body>
-</html>
- You can also download or copy the bare bones Gist
So get adding and start sharing!
T
TOPICS: Snippets
Ruby Sass can be a little slow when compiling your Sass project but Libsass claims to compile up to 5x faster. Let's see shall we with a good ol' fashioned Sass off!
Libsass is a C port of the original Sass engine to offer the power of Sass without being tied to Ruby.
Now I work in Windows and Ruby can be a bit of a pain so I’m more than keen to give the new kid on the block a go.
What I’m going to do is create two test projects using the inuit css framework with their own gruntfile but each gruntfile will be different.
Project 1 will have the ruby Sass grunt task while Project 2 will use the newer, faster Libsass with Node-sass and Grunt-Sass.
Ben Frain has a great article on getting up and running with libsass, node-sass and grunt-sass.
Let’s take a look at each project’s package.json file to compare.
Project 1
-{
- "name": "project-1",
- "version": "0.5.0",
- "dependencies": {},
- "devDependencies": {
- "grunt": "~0.4.1",
- "load-grunt-tasks": "~0.2.0",
- "time-grunt": "~0.1.1",
- "grunt-contrib-watch": "~0.4.3",
- "grunt-contrib-sass": "latest"
- },
- "engines": {
- "node": ">=0.8.0"
- }
-}
-
- Project 2
-{
- "name": "project-1",
- "version": "0.5.0",
- "dependencies": {},
- "devDependencies": {
- "grunt": "~0.4.1",
- "load-grunt-tasks": "~0.2.0",
- "time-grunt": "~0.1.1",
- "grunt-contrib-watch": "~0.4.3",
- "grunt-sass": "0.6.1"
- },
- "engines": {
- "node": ">=0.8.0"
- }
-}
-
- There’s only one main difference between the two projects and that is the grunt package for Sass.
After running npm install so as to install all our grunt packages from our package.json file, we’ll run the grunt command which looks like this in gruntfile.js.
grunt.registerTask('default', ['sass', 'watch']);
- This simply compiles our Sass partial files from inuit into style.css and then watches said Sass files for any changes.
Making a quick little change to one of our Sass files (like changing the background colour on the body) and saving that change triggers the grunt watch task to kick in and…
As we can see from the image below, the Node Sass task, which uses libsass, is indeed much faster than the native Ruby based Sass task.
I know this is a pretty light on example but imagine you’re working on a large scale site with multiple Sass modules and even styles for various plugins, not to mention running multiple grunt tasks - you’re gonna love the extra time savings.
Plus, with support for sourcemaps being added to Libsass in the last month, there’s not much of a reason to continue waiting around for the native Ruby Sass grunt task to drag it’s knuckles into CSS pre-compilation.
We’re all far too busy for that right?
T
NOTE: If you use Compass, which Libsass still does not support, checkout the autoprefixer grunt task that uses the Can I Use database.
TOPICS: workflow experiments
Browse related articles
Browse all articles
Browse related articles
Middleman can generate dynamic pages with a data file, a template and a little configuration. Let me show you how.
Posted
Setting up pagination for my blog was easy enough however, trying to get it to work was a little less straight forward. So I'd like to share how I got pagnination setup on this here site.
Posted
Middleman's blog engine is pretty powerful. Check out the following article from a fellow blogger that helped me get this site up and running.
Posted
Articles 1 to 3 of 3
Browse related articles
Today's the first day of 2014 and I'd like to set the theme for the new year
Posted
The last few months have been pretty full on at work. Along with late nights working on a few pet projects, it wasn't long before I started to feel the burn (out).
Posted
Articles 1 to 2 of 2
Browse related articles
Browse related articles
Setting up pagination for my blog was easy enough however, trying to get it to work was a little less straight forward. So I'd like to share how I got pagnination setup on this here site.
Posted
Middleman's blog engine is pretty powerful. Check out the following article from a fellow blogger that helped me get this site up and running.
Posted
So here it is; my very own blog site. This debut post is dedicated to discussing a few new techniques I tried during the development process.
Posted
Articles 1 to 3 of 3
Browse related articles
Browse related articles
Browse related articles
Thoughts and findings of a front end developer
Ruby Sass can be a little slow when compiling your Sass project but Libsass claims to compile up to 5x faster. Let's see shall we with a good ol' fashioned Sass off!
Posted
Make the most of people sharing your products, posts, pages or more simply by adding a few meta tags to the <HEAD> of your site.
Posted
Today's the first day of 2014 and I'd like to set the theme for the new year
Posted
Middleman can generate dynamic pages with a data file, a template and a little configuration. Let me show you how.
Posted
Setting up pagination for my blog was easy enough however, trying to get it to work was a little less straight forward. So I'd like to share how I got pagnination setup on this here site.
Posted
Articles 1 to 5 of 8
| t |
Thoughts and findings of a front end developer
Middleman's blog engine is pretty powerful. Check out the following article from a fellow blogger that helped me get this site up and running.
Posted
The last few months have been pretty full on at work. Along with late nights working on a few pet projects, it wasn't long before I started to feel the burn (out).
Posted
So here it is; my very own blog site. This debut post is dedicated to discussing a few new techniques I tried during the development process.
Posted
Articles 6 to 8 of 8
Sharing is caring
In my 2 or so years in this industry I have found a number of things super useful which I would like to pass on and share with any aspiring developer.
Books
Online Tools
Tweet me if there is something that you've found super useful for making killer web sites.
Looks like you got off track a little.
+ +The page you were looking for doesn't seem to exist. Try one of the items in the main menu above.
+ +I'm Tom, a front end developer from Melbourne Australia.
+The thoughts and opinions on this site are all mine.
+<%= @pageTagline %>
+ +Topics:
+
Like the article?
+leave your comments below
+ + + + +