Finn Who?
My name is Finn (pirateFinn on IRC and many other things)! You may have seen this ginger haired British/German self if you were at London Perl Workshop 2016, FlossUK 2016, YAPC/TPC 2017 or FreenodeLive 2017. As you can see, while new to the office, I have been definitely keeping myself busy within it too. There is already an article on me present here, so I won't go too far into detail about myself and rather focus on the thing that is much more important.
Old Website, new skin grafting
But wait, the website seems all different now! That's because it is. In an error of actually listening to what Mark Keating says, three weeks ago I was tasked with the redesign of the existing website, while retaining the Perl mechanics that generate many pages and code underneath. I had already known that this would be an arduous task, as the website was over 10 years old and littered with the code of its age to match, with the occasional redesign over the years, but never implementing a framework. After some use of Bootstrap 4 alpha & beta in community projects as of late to simplify our design process, it was decided we implement the rather brand spanking new Bootstrap 4 beta framework. The main goal was to remove as much legacy HTML and CSS code as possible and replace it with Bootstrap elements and design. Plus it would actually be sane to view on a mobile device, which it really was not.
Files, files and more files
One of the first things I did was investigate the file structure of the website that I was working with and implementing Bootstrap into it sensibly. This, as you may expect, had me puzzled for a while. So much so, I put many relevant CSS and various other files into a more sensible file structure for consistency. As an example, many CSS files were old unused ones, so they were placed into a folder called "old" in my spark of intense creativity. Bootstrap had also its own folder for the minified CSS file and the javascript dependencies in the JS folder. Thus, once Bootstrap was imported into the layout page where everything fits into, the import was done for the CSS and javscript files into the layout.html page. This is because the Shadowcat website uses similar replace tactics that jQuery made widespread in replacing the middle contents of a page while retaining the same layout HTML and so forth. Except rather than digging the hole further in the same way, we used a shovel known as Perl and the use of HTML::Zoom, which our very own Matt Trout (mst) made.
Time for some wörk!
But what wörk do I have to do?!
#!/bin/bash
MYPATH=$1
find "$MYPATH" -name *.jpg > /tmp/patterns
find "$MYPATH" -name *.png >> /tmp/patterns
find "$MYPATH" -name *.gif >> /tmp/patterns
for p in $(cat /tmp/patterns); do
f=$(basename $p);
grep -R $f "$MYPATH" > /dev/null || echo $p;
done
Replacing custom CSS with Bootstrap
What it looks like to replace content with Bootstrap. Finn tested. MST approved.
The flow of what was removed and replaced went roughly like this:
- Removing near all the CSS regarding headers.
- Many boxes or "sectioned off" elements replaced with Bootstrap cards.
- The navbar completely rewritten (with dropdowns!) to use native Bootstrap code, while also using a lot of the links generated previously in the footer.
- Converted the in-site google search to be integrated in the navbar with a bootstrap search bar, rather than an awkward floating box. Mobile friendly!
- Revamping the footer use the blog and social media links, along with endorsements and company information.
- Replaced old archaic mailform with a new bootstrap card form, still using the same working angularJS.
- Removed a number of image classes and inline styling, replaced with premade HTML::Zoom wizardry that makes image classes.
- Rewrote style for blog post lists to use cards, move styling and repeated code to templates and gutted all blog page specific CSS.
- Finally agreed on a good format (which began from the start with the navbar) for the top banner image.
- Actually creating my own blog section, which was now made trivially easy.
Gosh, that's quite a list! So many changes. But how many? well according to git, "683 files changed, 5123 insertions(+), 10806 deletions(-)". Yep, that's a lot. Which is why the grit of these details will be further covered in the next several blog posts, such as this one covering the new navbar and footer, and then the next post which covers the Bootstrap cards used. However if all you wanted to know was that there is a new site, then you've got all the hot info right here!
Don't forget that you can join in this conversation by using the comments form below! Feedback is valuable!
Notes
[1] The excellent Polandball comic featuring Germanyball can be found here.
[2] The chainsaw web photoshop was something I tracked down to being on this page, so thank you Jophiel Silverstone for having just the image I needed.