Skip to content

Commit

Permalink
Performance optimization: progressive images, inlining critical CSS, …
Browse files Browse the repository at this point in the history
…async CSS, changed logo to SVG, minify HTML
  • Loading branch information
Jan Czizikow authored and Jan Czizikow committed Dec 2, 2017
1 parent 186b3e7 commit 735b08e
Show file tree
Hide file tree
Showing 81 changed files with 525 additions and 100 deletions.
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
.bundle
.sass-cache
_site
_img
Gemfile.lock


# OS Generated files #
######################
*.DS_Store
Expand Down Expand Up @@ -48,13 +50,6 @@ build/
build-iPhoneOS/
build-iPhoneSimulator/


## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
Expand Down
3 changes: 1 addition & 2 deletions 404.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
layout: page
title: 404 Error
permalink: /404/
title: Page not found
---

Try got get back to the Home Page and start over!
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Gem Version](https://badge.fury.io/rb/jekyll-sleek.svg)](https://badge.fury.io/rb/jekyll-sleek)

# Sleek

Sleek is a modern Jekyll theme focused on speed performance & SEO best practices. In this directory, you'll find the files you need to be able to package up your theme into a gem. Put your layouts in `_layouts`, your includes in `_includes`, your sass files in `_sass` and any other assets in `assets`.
Expand Down
14 changes: 7 additions & 7 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ description: > # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "/" # the subpath of your site, e.g. /blog
url: "https://janczizikow.github.io/sleek" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll
instagram_username: shanlongjj
Expand All @@ -18,11 +20,6 @@ social:
- https://github.com/benbalter
- https://keybase.io/benbalter

# If you want to link only specific pages in your header, uncomment
# this and add the path to the pages in order as they should show up
#header_pages:
# - about.html

disqus:
shortname: janczizikow

Expand All @@ -37,11 +34,14 @@ exclude:
- Gemfile
- Gemfile.lock
- vendor
- npm-debug.log

include: ['_pages']
permalink: /:title/

compress_html:
clippings: all

plugins:
- jekyll-sitemap
- jekyll-seo-tag
# compress_html:
# clippings: all
31 changes: 31 additions & 0 deletions _includes/card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<a class="post-card" href="{{ post.url | relative_url }}" itemprop="blogPosts" itemscope="" itemtype="http://schema.org/BlogPosting">
{% if post.featured-img %}
<div class="post-card__thumb">
<img
src="/assets/img/posts/{{post.featured-img}}_placehold.jpg",
data-srcset="/assets/img/posts/{{post.featured-img}}_thumb.jpg, /assets/img/posts/{{post.featured-img}}[email protected] 2x"
class="lazyload blur-up"
alt="{{post.title}}"
/>
<noscript><img src="/assets/img/posts/{{post.featured-img}}_thumb.jpg" alt="{{ post.title }}"></noscript>
</div>
{% else %}
<figure class="post-card__thumb">
<!-- <img src="./assets/img/shane-rounce-205187.jpg" alt="{{post.title}}"/> -->
</figure>
{% endif %}
<div class="post-card__inner">
<div class="post-card__header">
<h2>{{ post.title | strip_html | truncate: 50 }}</h2>
{% assign date_format = site.sleek.date_format | default: "%b %-d, %Y" %}
<span class="post-card__meta">
<time>{{ post.date | date: date_format }}</time>
</span>
</div>
{% if post.summary %}
<p>{{ post.summary | strip_html | truncatewords:20 }}</p>
{% else %}
<p>{{ post.content | strip_html | truncatewords: 20 }}</p>
{% endif %}
</div>
</a>
1 change: 1 addition & 0 deletions _includes/critical.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _includes/ga.html → _includes/gtm.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_tag_manager }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ site.google_analytics }}');
gtag('config', '{{ site.google_tag_manager }}');
</script>
38 changes: 36 additions & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,40 @@

{% seo %}

<style class="inlineCSS">{% include critical.css %}</style>
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/img/icons/apple-touch-icon.png?v=qA3OXqyw77">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/img/icons/favicon-32x32.png?v=qA3OXqyw77">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/img/icons/favicon-16x16.png?v=qA3OXqyw77">
<link rel="manifest" href="/assets/img/icons/manifest.json?v=qA3OXqyw77">
<link rel="mask-icon" href="/assets/img/icons/safari-pinned-tab.svg?v=qA3OXqyw77" color="#5bbad5">
<!--[if IE]><link rel="shortcut icon" href="/assets/img/icons/favicon.ico?v=qA3OXqyw77"><![endif]-->
<link rel="shortcut icon" href="/assets/img/icons/favicon.ico?v=qA3OXqyw77">
<meta name="apple-mobile-web-app-title" content="Sleek">
<meta name="application-name" content="Sleek">
<meta name="msapplication-config" content="/assets/img/icons/browserconfig.xml?v=qA3OXqyw77">
<meta name="theme-color" content="#ffffff">

{% if site.google_tag_manager %}

{% include gtm.html %}

{% endif %}

<style class="inlineCSS">

{% include critical.css %}

</style>
<link rel="preload" href="{{ '/assets/css/main.css' | relative_url }}" as="style" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}"></noscript>
<script type="text/javascript">
/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */
(function(w){"use strict";if(!w.loadCSS){w.loadCSS=function(){}}
var rp=loadCSS.relpreload={};rp.support=(function(){var ret;try{ret=w.document.createElement("link").relList.supports("preload")}catch(e){ret=!1}
return function(){return ret}})();rp.bindMediaToggle=function(link){var finalMedia=link.media||"all";function enableStylesheet(){link.media=finalMedia}
if(link.addEventListener){link.addEventListener("load",enableStylesheet)}else if(link.attachEvent){link.attachEvent("onload",enableStylesheet)}
setTimeout(function(){link.rel="stylesheet";link.media="only x"});setTimeout(enableStylesheet,3000)};rp.poly=function(){if(rp.support()){return}
var links=w.document.getElementsByTagName("link");for(var i=0;i<links.length;i++){var link=links[i];if(link.rel==="preload"&&link.getAttribute("as")==="style"&&!link.getAttribute("data-loadcss")){link.setAttribute("data-loadcss",!0);rp.bindMediaToggle(link)}}};if(!rp.support()){rp.poly();var run=w.setInterval(rp.poly,500);if(w.addEventListener){w.addEventListener("load",function(){rp.poly();w.clearInterval(run)})}else if(w.attachEvent){w.attachEvent("onload",function(){rp.poly();w.clearInterval(run)})}}
if(typeof exports!=="undefined"){exports.loadCSS=loadCSS}
else{w.loadCSS=loadCSS}}(typeof global!=="undefined"?global:this))
</script>
</head>
26 changes: 12 additions & 14 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<header class="header" itemscope itemtype="http://schema.org/SiteNavigationElement" aria-label="Main navigation">
<div class="container">
<div class="header__inner">
<a class="header__logo" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
<a class="header__logo" href="{{ '/' | relative_url }}">
<div class="header__logo--container">
{% include logo.svg %}
</div>
</a>
<nav class="header__links">
<a href="/about" itemprop="url"><span itemprop="name">About</span></a>
<a href="/contact" itemprop="url"><span itemprop="name">Contact</span></a>
{% if page_paths %}
{% for path in page_paths %}
{% assign my_page = site.pages | where: "path", path | first %}
{% if my_page.title %}
{% if my_page.title contains "404" %}
{% else %}
<a href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
<a href="{{ '/about' | relative_url }}" itemprop="url"><span itemprop="name">About</span></a>
<a href="{{ '/contact' | relative_url }}" itemprop="url"><span itemprop="name">Contact</span></a>
</nav>
<div class="header__toggle">
<span></span>
<span></span>
<span></span>
</div>
</div>
</div>
</header>
5 changes: 5 additions & 0 deletions _includes/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions _includes/pagination.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<nav class="pagination">
<a href="#" class="pagination__item">1</a>
</nav>
4 changes: 0 additions & 4 deletions _js/jquery-3.2.1.min.js

This file was deleted.

Loading

0 comments on commit 735b08e

Please sign in to comment.