Skip to content

Commit 2debbf1

Browse files
committed
feat: Add ability to disable landing page and animation.
Added the `disable_landing_page` config value which disables the JS animation for the landing page view and animation.
1 parent a27539f commit 2debbf1

File tree

3 files changed

+62
-53
lines changed

3 files changed

+62
-53
lines changed

_config.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Site settings
22
title: Jekyll-Uno
33
description: 'Jekyll-Uno - a minimal, responsive theme for Jekyll'
4-
url: 'http://joshgerdes.com/jekyll-uno'
4+
url: 'http://localhost:4000' #'http://joshgerdes.com/jekyll-uno'
55
baseurl: '/jekyll-uno'
66
# google_analytics: 'UA-XXXXXX-X'
77
# disqus_shortname: 'your-disqus-name'
8+
# disable_landing_page: true
89

910
author:
1011
name: 'Josh Gerdes'

_includes/header.html

+31-25
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
<i class="icon icon-x-circle btn-mobile-close__icon hidden"></i>
44
</span>
55

6-
<header class="panel-cover" style="background-image: url({{ site.baseurl }}/images/cover.jpg)">
6+
<header class="panel-cover {% if site.disable_landing_page %}panel-cover--collapsed{% endif %}"
7+
style="background-image: url({{ site.baseurl }}/images/cover.jpg)">
78
<div class="panel-main">
89

910
<div class="panel-main__inner panel-inverted">
10-
<div class="panel-main__content">
11+
<div class="panel-main__content">
1112
<a href="{{ site.baseurl }}/" title="link to home of {{ site.title }}">
1213
<img src="{{ site.baseurl }}/images/profile.jpg" class="user-image" alt="My Profile Photo">
1314
<h1 class="panel-cover__title panel-title">{{ site.title }}</h1>
@@ -20,70 +21,75 @@ <h1 class="panel-cover__title panel-title">{{ site.title }}</h1>
2021

2122
<nav class="cover-navigation cover-navigation--primary">
2223
<ul class="navigation">
23-
<li class="navigation__item"><a href="{{ site.baseurl }}/#blog" title="link to {{ site.title }} blog" class="blog-button">Blog</a></li>
24+
<li class="navigation__item"><a href="{{ site.baseurl }}/#blog" title="link to {{ site.title }} blog"
25+
class="blog-button">Blog</a></li>
2426
</ul>
2527
</nav>
2628

2729
<nav class="cover-navigation navigation--social">
2830
<ul class="navigation">
2931

30-
{% if site.author.twitter_username %}
32+
{% if site.author.twitter_username %}
3133
<!-- Twitter -->
3234
<li class="navigation__item">
33-
<a href="http://twitter.com/{{ site.author.twitter_username }}" title="@{{ site.author.twitter_username }} on Twitter" target="_blank">
35+
<a href="http://twitter.com/{{ site.author.twitter_username }}"
36+
title="@{{ site.author.twitter_username }} on Twitter" target="_blank">
3437
<i class="icon icon-social-twitter"></i>
3538
<span class="label">Twitter</span>
3639
</a>
3740
</li>
38-
{% endif %}
41+
{% endif %}
3942

40-
{% if site.author.facebook_username %}
43+
{% if site.author.facebook_username %}
4144
<!-- Facebook -->
4245
<li class="navigation__item">
43-
<a href="http://fb.me/{{ site.author.facebook_username }}" title="{{ site.author.facebook_username }} on Facebook" target="_blank">
46+
<a href="http://fb.me/{{ site.author.facebook_username }}"
47+
title="{{ site.author.facebook_username }} on Facebook" target="_blank">
4448
<i class="icon icon-social-facebook"></i>
4549
<span class="label">Facebook</span>
4650
</a>
4751
</li>
48-
{% endif %}
52+
{% endif %}
4953

50-
{% if site.author.linkedin_username %}
54+
{% if site.author.linkedin_username %}
5155
<!-- LinkedIn -->
5256
<li class="navigation__item">
53-
<a href="https://www.linkedin.com/in/{{ site.author.linkedin_username }}" title="{{ site.author.linkedin_username }} on LinkedIn" target="_blank">
57+
<a href="https://www.linkedin.com/in/{{ site.author.linkedin_username }}"
58+
title="{{ site.author.linkedin_username }} on LinkedIn" target="_blank">
5459
<i class="icon icon-social-linkedin"></i>
5560
<span class="label">LinkedIn</span>
5661
</a>
5762
</li>
58-
{% endif %}
63+
{% endif %}
5964

60-
{% if site.author.github_username %}
65+
{% if site.author.github_username %}
6166
<!-- GitHub -->
6267
<li class="navigation__item">
63-
<a href="https://www.github.com/{{ site.author.github_username }}" title="{{ site.author.github_username }} on GitHub" target="_blank">
68+
<a href="https://www.github.com/{{ site.author.github_username }}"
69+
title="{{ site.author.github_username }} on GitHub" target="_blank">
6470
<i class="icon icon-social-github"></i>
6571
<span class="label">GitHub</span>
6672
</a>
6773
</li>
68-
{% endif %}
74+
{% endif %}
6975

70-
{% if site.author.email %}
76+
{% if site.author.email %}
7177
<!-- Email -->
7278
<li class="navigation__item">
7379
<a href="mailto:{{ site.author.email }}" title="Email {{ site.author.email }}" target="_blank">
7480
<i class="icon icon-mail"></i>
7581
<span class="label">Email</span>
7682
</a>
7783
</li>
78-
{% endif %}
84+
{% endif %}
7985

80-
<!-- RSS -->
81-
<li class="navigation__item">
82-
<a href="{{ site.baseurl }}/feed.xml" title="Subscribe" target="_blank">
83-
<i class="icon icon-rss"></i>
84-
<span class="label">RSS</span>
85-
</a>
86-
</li>
86+
<!-- RSS -->
87+
<li class="navigation__item">
88+
<a href="{{ site.baseurl }}/feed.xml" title="Subscribe" target="_blank">
89+
<i class="icon icon-rss"></i>
90+
<span class="label">RSS</span>
91+
</a>
92+
</li>
8793

8894
</ul>
8995
</nav>
@@ -96,4 +102,4 @@ <h1 class="panel-cover__title panel-title">{{ site.title }}</h1>
96102

97103
<div class="panel-cover--overlay"></div>
98104
</div>
99-
</header>
105+
</header>

js/main.js

+29-27
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
---
2-
layout: null
2+
layout: null
33
sitemap:
4-
exclude: 'yes'
4+
exclude: 'yes'
55
---
66

7-
$(document).ready(function () {
8-
$('a.blog-button').click(function (e) {
9-
if ($('.panel-cover').hasClass('panel-cover--collapsed')) return
10-
currentWidth = $('.panel-cover').width()
11-
if (currentWidth < 960) {
7+
$(document).ready(function () {
8+
{% if site.disable_landing_page != true %}
9+
$('a.blog-button').click(function (e) {
10+
if ($('.panel-cover').hasClass('panel-cover--collapsed')) return
11+
currentWidth = $('.panel-cover').width()
12+
if (currentWidth < 960) {
13+
$('.panel-cover').addClass('panel-cover--collapsed')
14+
$('.content-wrapper').addClass('animated slideInRight')
15+
} else {
16+
$('.panel-cover').css('max-width', currentWidth)
17+
$('.panel-cover').animate({ 'max-width': '530px', 'width': '40%' }, 400, swing = 'swing', function () { })
18+
}
19+
})
20+
21+
if (window.location.hash && window.location.hash == '#blog') {
1222
$('.panel-cover').addClass('panel-cover--collapsed')
13-
$('.content-wrapper').addClass('animated slideInRight')
14-
} else {
15-
$('.panel-cover').css('max-width', currentWidth)
16-
$('.panel-cover').animate({'max-width': '530px', 'width': '40%'}, 400, swing = 'swing', function () {})
1723
}
18-
})
1924

20-
if (window.location.hash && window.location.hash == '#blog') {
21-
$('.panel-cover').addClass('panel-cover--collapsed')
22-
}
25+
if (window.location.pathname !== '{{ site.baseurl }}/' && window.location.pathname !== '{{ site.baseurl }}/index.html') {
26+
$('.panel-cover').addClass('panel-cover--collapsed')
27+
}
28+
{% endif %}
2329

24-
if (window.location.pathname !== '{{ site.baseurl }}/' && window.location.pathname !== '{{ site.baseurl }}/index.html') {
25-
$('.panel-cover').addClass('panel-cover--collapsed')
26-
}
30+
$('.btn-mobile-menu').click(function () {
31+
$('.navigation-wrapper').toggleClass('visible animated bounceInDown')
32+
$('.btn-mobile-menu__icon').toggleClass('icon-list icon-x-circle animated fadeIn')
33+
})
2734

28-
$('.btn-mobile-menu').click(function () {
29-
$('.navigation-wrapper').toggleClass('visible animated bounceInDown')
30-
$('.btn-mobile-menu__icon').toggleClass('icon-list icon-x-circle animated fadeIn')
31-
})
35+
$('.navigation-wrapper .blog-button').click(function () {
36+
$('.navigation-wrapper').toggleClass('visible')
37+
$('.btn-mobile-menu__icon').toggleClass('icon-list icon-x-circle animated fadeIn')
38+
})
3239

33-
$('.navigation-wrapper .blog-button').click(function () {
34-
$('.navigation-wrapper').toggleClass('visible')
35-
$('.btn-mobile-menu__icon').toggleClass('icon-list icon-x-circle animated fadeIn')
3640
})
37-
38-
})

0 commit comments

Comments
 (0)