diff --git a/404.html b/404.html index d77ad7865..ce6d50700 100644 --- a/404.html +++ b/404.html @@ -11,6 +11,10 @@ {{ site.name }} | Page not found + {% if site.local_fonts %} + {% stylesheet fonts %} + {% endif %} + {% if site.blog_theme == "light" %} {% stylesheet notfound-light %} {% else %} @@ -26,5 +30,16 @@

{{ site.name }}<

+ + {% unless site.local_fonts %} + + + {% endunless %} diff --git a/Gemfile.lock b/Gemfile.lock index a19280515..829c5ace6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,26 +1,24 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.2.7.1) + activesupport (4.2.8) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.5.0) public_suffix (~> 2.0, >= 2.0.2) - autoprefixer-rails (6.7.2) + autoprefixer-rails (6.7.6) execjs colorator (1.1.0) colored (1.2) - concurrent-ruby (1.0.4) + concurrent-ruby (1.0.5) ethon (0.10.1) ffi (>= 1.3.0) execjs (2.7.0) extras (0.1.0) forwardable-extended (~> 2.5) - fastimage (2.0.1) - addressable (~> 2) + fastimage (2.1.0) ffi (1.9.17) forwardable-extended (2.6.0) gemoji (3.0.0) @@ -36,7 +34,7 @@ GEM parallel (~> 1.3) typhoeus (~> 0.7) yell (~> 2.0) - i18n (0.8.0) + i18n (0.8.1) jekyll (3.4.0) addressable (~> 2.4) colorator (~> 1.0) @@ -67,7 +65,6 @@ GEM gemoji (~> 3.0) html-pipeline (~> 2.2) jekyll (>= 3.0) - json (1.8.6) kramdown (1.13.2) liquid (3.0.6) listen (3.0.8) @@ -93,12 +90,12 @@ GEM sprockets (3.6.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) - thread_safe (0.3.5) + thread_safe (0.3.6) typhoeus (0.8.0) ethon (>= 0.8.0) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (3.0.4) + uglifier (3.1.2) execjs (>= 0.3.0, < 3) yell (2.0.7) @@ -118,4 +115,4 @@ DEPENDENCIES uglifier BUNDLED WITH - 1.13.7 + 1.14.5 diff --git a/README.md b/README.md index 72fc96afb..d680ca50e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Features: - Cross browser support (supports all modern browsers). - Media embed for videos. - Enlarge images on click (like Medium). + - Support for local fonts Integrations - [Google Analytics](https://analytics.google.com/analytics/web/) @@ -63,12 +64,14 @@ Run Jekyll: bundle exec jekyll serve -### Deploy to GitHub Pages +## Deploy to GitHub Pages -Run this in the root project folder in your console: +Before you deploy, commit your changes to any working branch except the `gh-pages` one then run the following command: bin/deploy +**Important note**: Chalk does not support the standard way of Jekyll hosting on GitHub Pages. You need to deploy your working branch with the `bin/deploy` script. This is because Chalk uses Jekyll plugins that aren't supported by GitHub pages. + You can find more info on how to use the gh-pages branch and a custom domain [here](https://help.github.com/articles/quick-start-setting-up-a-custom-domain/). [View this](https://github.com/nielsenramon/kickster#automated-deployment-with-circle-ci) for more info about automated deployment with Circle CI. diff --git a/_assets/fonts/Cormorant-Garamond-500.eot b/_assets/fonts/Cormorant-Garamond-500.eot deleted file mode 100755 index 429683461..000000000 Binary files a/_assets/fonts/Cormorant-Garamond-500.eot and /dev/null differ diff --git a/_assets/fonts/Cormorant-Garamond-500.svg b/_assets/fonts/Cormorant-Garamond-500.svg deleted file mode 100755 index cba7daae2..000000000 --- a/_assets/fonts/Cormorant-Garamond-500.svg +++ /dev/null @@ -1,496 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/_assets/fonts/Cormorant-Garamond-500.ttf b/_assets/fonts/Cormorant-Garamond-500.ttf deleted file mode 100755 index 257c858e5..000000000 Binary files a/_assets/fonts/Cormorant-Garamond-500.ttf and /dev/null differ diff --git a/_assets/fonts/Cormorant-Garamond-500.woff b/_assets/fonts/Cormorant-Garamond-500.woff deleted file mode 100755 index 79882ab00..000000000 Binary files a/_assets/fonts/Cormorant-Garamond-500.woff and /dev/null differ diff --git a/_assets/fonts/Cormorant-Garamond-500.woff2 b/_assets/fonts/Cormorant-Garamond-500.woff2 deleted file mode 100755 index f85205a94..000000000 Binary files a/_assets/fonts/Cormorant-Garamond-500.woff2 and /dev/null differ diff --git a/_assets/fonts/Lato-300.svg b/_assets/fonts/Lato-300.svg deleted file mode 100755 index 11b626f87..000000000 --- a/_assets/fonts/Lato-300.svg +++ /dev/null @@ -1,435 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/_assets/fonts/Lato-700.svg b/_assets/fonts/Lato-700.svg deleted file mode 100755 index 077653d20..000000000 --- a/_assets/fonts/Lato-700.svg +++ /dev/null @@ -1,438 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/_assets/fonts/Lato-regular.svg b/_assets/fonts/Lato-regular.svg deleted file mode 100755 index 55b43fb86..000000000 --- a/_assets/fonts/Lato-regular.svg +++ /dev/null @@ -1,435 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.eot b/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.eot new file mode 100755 index 000000000..a92c21258 Binary files /dev/null and b/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.eot differ diff --git a/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.ttf b/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.ttf new file mode 100755 index 000000000..9fc06ad6c Binary files /dev/null and b/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.ttf differ diff --git a/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff b/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff new file mode 100755 index 000000000..533293dda Binary files /dev/null and b/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff differ diff --git a/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff2 b/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff2 new file mode 100755 index 000000000..90cf89b4b Binary files /dev/null and b/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff2 differ diff --git a/_assets/fonts/ionicons.eot b/_assets/fonts/ionicons/ionicons.eot similarity index 100% rename from _assets/fonts/ionicons.eot rename to _assets/fonts/ionicons/ionicons.eot diff --git a/_assets/fonts/ionicons.svg b/_assets/fonts/ionicons/ionicons.svg similarity index 100% rename from _assets/fonts/ionicons.svg rename to _assets/fonts/ionicons/ionicons.svg diff --git a/_assets/fonts/ionicons.ttf b/_assets/fonts/ionicons/ionicons.ttf similarity index 100% rename from _assets/fonts/ionicons.ttf rename to _assets/fonts/ionicons/ionicons.ttf diff --git a/_assets/fonts/ionicons.woff b/_assets/fonts/ionicons/ionicons.woff similarity index 100% rename from _assets/fonts/ionicons.woff rename to _assets/fonts/ionicons/ionicons.woff diff --git a/_assets/fonts/Lato-300.eot b/_assets/fonts/lato/Lato-300.eot similarity index 100% rename from _assets/fonts/Lato-300.eot rename to _assets/fonts/lato/Lato-300.eot diff --git a/_assets/fonts/Lato-300.ttf b/_assets/fonts/lato/Lato-300.ttf similarity index 100% rename from _assets/fonts/Lato-300.ttf rename to _assets/fonts/lato/Lato-300.ttf diff --git a/_assets/fonts/Lato-300.woff b/_assets/fonts/lato/Lato-300.woff similarity index 100% rename from _assets/fonts/Lato-300.woff rename to _assets/fonts/lato/Lato-300.woff diff --git a/_assets/fonts/Lato-300.woff2 b/_assets/fonts/lato/Lato-300.woff2 similarity index 100% rename from _assets/fonts/Lato-300.woff2 rename to _assets/fonts/lato/Lato-300.woff2 diff --git a/_assets/fonts/Lato-700.eot b/_assets/fonts/lato/Lato-700.eot similarity index 100% rename from _assets/fonts/Lato-700.eot rename to _assets/fonts/lato/Lato-700.eot diff --git a/_assets/fonts/Lato-700.ttf b/_assets/fonts/lato/Lato-700.ttf similarity index 100% rename from _assets/fonts/Lato-700.ttf rename to _assets/fonts/lato/Lato-700.ttf diff --git a/_assets/fonts/Lato-700.woff b/_assets/fonts/lato/Lato-700.woff similarity index 100% rename from _assets/fonts/Lato-700.woff rename to _assets/fonts/lato/Lato-700.woff diff --git a/_assets/fonts/Lato-700.woff2 b/_assets/fonts/lato/Lato-700.woff2 similarity index 100% rename from _assets/fonts/Lato-700.woff2 rename to _assets/fonts/lato/Lato-700.woff2 diff --git a/_assets/fonts/Lato-regular.eot b/_assets/fonts/lato/Lato-regular.eot similarity index 100% rename from _assets/fonts/Lato-regular.eot rename to _assets/fonts/lato/Lato-regular.eot diff --git a/_assets/fonts/Lato-regular.ttf b/_assets/fonts/lato/Lato-regular.ttf similarity index 100% rename from _assets/fonts/Lato-regular.ttf rename to _assets/fonts/lato/Lato-regular.ttf diff --git a/_assets/fonts/Lato-regular.woff b/_assets/fonts/lato/Lato-regular.woff similarity index 100% rename from _assets/fonts/Lato-regular.woff rename to _assets/fonts/lato/Lato-regular.woff diff --git a/_assets/fonts/Lato-regular.woff2 b/_assets/fonts/lato/Lato-regular.woff2 similarity index 100% rename from _assets/fonts/Lato-regular.woff2 rename to _assets/fonts/lato/Lato-regular.woff2 diff --git a/_assets/stylesheets/dark.scss b/_assets/stylesheets/dark.scss index b2f233803..cc89eb8e3 100755 --- a/_assets/stylesheets/dark.scss +++ b/_assets/stylesheets/dark.scss @@ -68,4 +68,3 @@ $article-paginator-color-hover: $gray-lightest; @import "modules/header"; @import "modules/highlights-dark"; @import "modules/icons"; -@import "modules/fonts"; diff --git a/_assets/stylesheets/fonts.scss b/_assets/stylesheets/fonts.scss new file mode 100755 index 000000000..12ec0399a --- /dev/null +++ b/_assets/stylesheets/fonts.scss @@ -0,0 +1,63 @@ +// ============================================================================= +// Fonts +// ============================================================================= + +@charset "UTF-8"; + +// Cormorant Garamond +// ============================================================================= + +@font-face { + font-family: 'Cormorant Garamond'; + font-style: normal; + font-weight: 700; + src: url(asset_path('cormorant-garamond/Cormorant-Garamond-700.eot')); + src: url(asset_path('cormorant-garamond/Cormorant-Garamond-700.eot?#iefix')) format('embedded-opentype'), + local('Cormorant Garamond Medium'), + local('Cormorant-Garamond-600'), + url(asset_path('cormorant-garamond/Cormorant-Garamond-700.woff2')) format('woff2'), + url(asset_path('cormorant-garamond/Cormorant-Garamond-700.woff')) format('woff'), + url(asset_path('cormorant-garamond/Cormorant-Garamond-700.ttf')) format('truetype'), +} + +// Lato +// ============================================================================= + +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 300; + src: url(asset_path('lato/Lato-300.eot')); + src: url(asset_path('lato/Lato-300.eot?#iefix')) format('embedded-opentype'), + local('Lato Light'), + local('Lato-300'), + url(asset_path('lato/Lato-300.woff2')) format('woff2'), + url(asset_path('lato/Lato-300.woff')) format('woff'), + url(asset_path('lato/Lato-300.ttf')) format('truetype'), +} + +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + src: url(asset_path('lato/Lato-regular.eot')); + src: url(asset_path('lato/Lato-regular.eot?#iefix')) format('embedded-opentype'), + local('Lato Regular'), + local('Lato-regular'), + url(asset_path('lato/Lato-regular.woff2')) format('woff2'), + url(asset_path('lato/Lato-regular.woff')) format('woff'), + url(asset_path('lato/Lato-regular.ttf')) format('truetype'), +} + +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 700; + src: url(asset_path('lato/Lato-700.eot')); + src: url(asset_path('lato/Lato-700.eot?#iefix')) format('embedded-opentype'), + local('Lato Bold'), + local('Lato-700'), + url(asset_path('lato/Lato-700.woff2')) format('woff2'), + url(asset_path('lato/Lato-700.woff')) format('woff'), + url(asset_path('lato/Lato-700.ttf')) format('truetype'), +} diff --git a/_assets/stylesheets/light.scss b/_assets/stylesheets/light.scss index 9a778e2e0..e09941ca3 100755 --- a/_assets/stylesheets/light.scss +++ b/_assets/stylesheets/light.scss @@ -68,4 +68,3 @@ $article-paginator-color-hover: $gray-darkest; @import "modules/header"; @import "modules/highlights-light"; @import "modules/icons"; -@import "modules/fonts"; diff --git a/_assets/stylesheets/modules/_embed.scss b/_assets/stylesheets/modules/_embed.scss index 139a00a2f..bf1bf1195 100644 --- a/_assets/stylesheets/modules/_embed.scss +++ b/_assets/stylesheets/modules/_embed.scss @@ -25,6 +25,7 @@ } // Modifier class for 16:9 aspect ratio + .embed-responsive-16by9 { padding-bottom: 56.25%; } diff --git a/_assets/stylesheets/modules/_fonts.scss b/_assets/stylesheets/modules/_fonts.scss deleted file mode 100755 index 98821888b..000000000 --- a/_assets/stylesheets/modules/_fonts.scss +++ /dev/null @@ -1,59 +0,0 @@ -@charset "UTF-8"; - -/* Cormorant Garamond */ -@font-face { -font-family: 'Cormorant Garamond'; -font-weight: 500; -font-style: normal; -src: url(asset_path('Cormorant-Garamond-500.eot')); -src: url(asset_path('Cormorant-Garamond-500.eot?#iefix')) format('embedded-opentype'), -local('Cormorant Garamond Medium'), -local('Cormorant-Garamond-500'), -url(asset_path('Cormorant-Garamond-500.woff2')) format('woff2'), -url(asset_path('Cormorant-Garamond-500.woff')) format('woff'), -url(asset_path('Cormorant-Garamond-500.ttf')) format('truetype'), -url(asset_path('Cormorant-Garamond-500.svg#CormorantGaramond')) format('svg'); -} - -/*Lato*/ -@font-face { -font-family: 'Lato'; -font-weight: 300; -font-style: normal; -src: url(asset_path('Lato-300.eot')); -src: url(asset_path('Lato-300.eot?#iefix')) format('embedded-opentype'), -local('Lato Light'), -local('Lato-300'), -url(asset_path('Lato-300.woff2')) format('woff2'), -url(asset_path('Lato-300.woff')) format('woff'), -url(asset_path('Lato-300.ttf')) format('truetype'), -url(asset_path('Lato-300.svg#Lato')) format('svg'); -} - -@font-face { -font-family: 'Lato'; -font-weight: 400; -font-style: normal; -src: url(asset_path('Lato-regular.eot')); -src: url(asset_path('Lato-regular.eot?#iefix')) format('embedded-opentype'), -local('Lato Regular'), -local('Lato-regular'), -url(asset_path('Lato-regular.woff2')) format('woff2'), -url(asset_path('Lato-regular.woff')) format('woff'), -url(asset_path('Lato-regular.ttf')) format('truetype'), -url(asset_path('Lato-regular.svg#Lato')) format('svg'); -} - -@font-face { -font-family: 'Lato'; -font-weight: 700; -font-style: normal; -src: url(asset_path('Lato-700.eot')); -src: url(asset_path('Lato-700.eot?#iefix')) format('embedded-opentype'), -local('Lato Bold'), -local('Lato-700'), -url(asset_path('Lato-700.woff2')) format('woff2'), -url(asset_path('Lato-700.woff')) format('woff'), -url(asset_path('Lato-700.ttf')) format('truetype'), -url(asset_path('Lato-700.svg#Lato')) format('svg'); -} diff --git a/_assets/stylesheets/modules/_header.scss b/_assets/stylesheets/modules/_header.scss index 28fe9cd64..12f850561 100644 --- a/_assets/stylesheets/modules/_header.scss +++ b/_assets/stylesheets/modules/_header.scss @@ -12,7 +12,7 @@ display: inline-block; font-family: $serif; font-size: 36px; - font-weight: 900; + font-weight: 700; color: $header-logo-color; text-decoration: none; } diff --git a/_assets/stylesheets/modules/_icons.scss b/_assets/stylesheets/modules/_icons.scss index 7b070be21..27e1e3bc5 100644 --- a/_assets/stylesheets/modules/_icons.scss +++ b/_assets/stylesheets/modules/_icons.scss @@ -9,9 +9,9 @@ @font-face { font-family: ionicons; - src: url(asset_path("ionicons.eot?#iefix")) format("embedded-opentype"), - url(asset_path("ionicons.woff")) format("woff"), - url(asset_path("ionicons.ttf")) format("truetype"); + src: url(asset_path("ionicons/ionicons.eot?#iefix")) format("embedded-opentype"), + url(asset_path("ionicons/ionicons.woff")) format("woff"), + url(asset_path("ionicons/ionicons.ttf")) format("truetype"); } // Component diff --git a/_config.yml b/_config.yml index 04e5a142a..6af054c9b 100755 --- a/_config.yml +++ b/_config.yml @@ -2,16 +2,16 @@ name: Chalk paginate: 25 -paginate_path: "/posts/page/:num/" -url: # add site url http://example.com/ +url: # add your site url (format: http://example.com/) blog_theme: light # Or use dark # Optional settings +about_enabled: false # Change to true if you wish to show an icon in the navigation that redirects to the about page discus_identifier: # Add your Disqus identifier ga_analytics: # Add your GA Tracking Id +local_fonts: false # Change to true if you wish to use local fonts rss_enabled: true # Change to false if not -about_enabled: false # Change to true if you wish to show an icon in the navigation that redirects to the about page social: dribbble: # Add your Dribbble handle facebook: # Add your Facebook handle @@ -25,9 +25,6 @@ social: # Important settings (change at own risk) assets: - compress: - css: true - js: true features: automatic_img_size: false sources: @@ -63,4 +60,5 @@ gems: - jekyll-paginate - jekyll-sitemap - jemoji +paginate_path: "/posts/page/:num/" permalink: posts/:slug diff --git a/_includes/head.html b/_includes/head.html index 17fdabc6d..cbfe1ff02 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -21,6 +21,10 @@ + {% if site.local_fonts %} + {% stylesheet fonts %} + {% endif %} + {% if site.blog_theme == "light" %} {% stylesheet light %} {% else %} diff --git a/_includes/javascripts.html b/_includes/javascripts.html index 67c088603..145a4552b 100644 --- a/_includes/javascripts.html +++ b/_includes/javascripts.html @@ -1,3 +1,14 @@ +{% unless site.local_fonts %} + + +{% endunless %} + {% if site.ga_analytics %} @@ -139,6 +142,8 @@ Chalk uses Google Fonts by default. You can change the font in `_includes/javasc {% endhighlight %} +Don't forget Chalk also support local fonts if enabled in `config.yml`! + #### Footer Changing the text in the footer is easy. It can be found in `_includes/footer.html`. diff --git a/_posts/2016-10-17-introducing-chalk.md b/_posts/2016-10-17-introducing-chalk.md index c1605fed8..c09ecc5cb 100644 --- a/_posts/2016-10-17-introducing-chalk.md +++ b/_posts/2016-10-17-introducing-chalk.md @@ -23,6 +23,7 @@ tags: [web, jekyll] - Cross browser support (supports all modern browsers). - Media embed for videos. - Enlarge images on click (like Medium). + - Support for local fonts #### Integrations - [Google Analytics](https://analytics.google.com/analytics/web/) @@ -76,12 +77,14 @@ bundle exec jekyll serve ## Deploy to GitHub Pages -Run this in the root project folder in your console: +Before you deploy, commit your changes to any working branch except the `gh-pages` one then run the following command: {% highlight bash %} bin/deploy {% endhighlight %} +**Important note**: Chalk does not support the standard way of Jekyll hosting on GitHub Pages. You need to deploy your working branch with the `bin/deploy` script. This is because Chalk uses Jekyll plugins that aren't supported by GitHub pages. + You can find more info on how to use the gh-pages branch and a custom domain [here](https://help.github.com/articles/quick-start-setting-up-a-custom-domain/). [View this](https://github.com/nielsenramon/kickster#automated-deployment-with-circle-ci) for more info about automated deployment with Circle CI.