Skip to content

Commit e5089e2

Browse files
committed
added turbolinks
1 parent 0cfd867 commit e5089e2

File tree

3 files changed

+59
-53
lines changed

3 files changed

+59
-53
lines changed

_layouts/default.html

+52-51
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >
66

7-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
8-
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
9-
<link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
10-
<link rel="shortcut icon" type="image/png" href="{{ '/favicon.png' | relative_url }}">
7+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
8+
<script src="https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.2.0/turbolinks.js" integrity="sha256-iM4Yzi/zLj/IshPWMC1IluRxTtRjMqjPGd97TZ9yYpU=" crossorigin="anonymous"></script>
9+
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
10+
<link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
11+
<link rel="shortcut icon" type="image/png" href="{{ '/favicon.png' | relative_url }}">
1112

12-
{% if jekyll.environment == 'production' %}
13-
<link rel="stylesheet" href="{{ '/css/style.css' | relative_url }}">
14-
<link rel="stylesheet" href="{{ '/css/css/fontawesome-all.min.css' | relative_url }}">
15-
<script src="{{ '/js/main.js' | relative_url }}"></script>
16-
{% else %}
17-
<link rel="stylesheet" href="{{ '/css/style.css' | relative_url }}">
18-
<link rel="stylesheet" href="{{ '/css/css/fontawesome-all.min.css' | relative_url }}">
19-
<script src="{{ '/js/main.js' | relative_url }}"></script>
20-
{% endif %}
13+
{% if jekyll.environment == 'production' %}
14+
<link rel="stylesheet" href="{{ '/css/style.css' | relative_url }}">
15+
<link rel="stylesheet" href="{{ '/css/css/fontawesome-all.min.css' | relative_url }}">
16+
<script src="{{ '/js/main.js' | relative_url }}"></script>
17+
{% else %}
18+
<link rel="stylesheet" href="{{ '/css/style.css' | relative_url }}">
19+
<link rel="stylesheet" href="{{ '/css/css/fontawesome-all.min.css' | relative_url }}">
20+
<script src="{{ '/js/main.js' | relative_url }}"></script>
21+
{% endif %}
2122

22-
{% seo %}
23+
{% seo %}
2324

24-
{% if jekyll.environment == 'production' %}
25+
{% if jekyll.environment == 'production' %}
2526
<!-- Global site tag (gtag.js) - Google Analytics -->
2627
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_key }}"></script>
2728
<script>
@@ -30,50 +31,50 @@
3031
gtag('js', new Date());
3132

3233
gtag('config', '{{ site.google_analytics_key }}');
33-
</script>
34-
{% endif %}
34+
</script>
35+
{% endif %}
3536
</head>
3637
<body>
3738
<header>
38-
<h1>
39-
<button type="button" class="open-nav" id="open-nav"></button>
40-
<a href="{{ '/' | relative_url }}" class="logo-link"><img src="{{ '/images/logotype_white.svg' | relative_url }}" height="40" alt="{{ site.title }} logo"></a>
41-
</h1>
39+
<h1>
40+
<button type="button" class="open-nav" id="open-nav"></button>
41+
<a href="{{ '/' | relative_url }}" class="logo-link"><img src="{{ '/images/logotype_white.svg' | relative_url }}" height="40" alt="{{ site.title }} logo"></a>
42+
</h1>
4243

43-
{% if jekyll.environment == 'production' %}
44-
<form action="{{ '/search/' | relative_url }}" method="get">
45-
<input type="text" name="q" id="search-input" placeholder="Search">
46-
<input type="submit" value="Search" style="display: none;">
47-
</form>
48-
{% else %}
49-
<form action="{{ '/search/' | relative_url }}" method="get">
50-
<input type="text" name="q" id="search-input" placeholder="Search">
51-
<input type="submit" value="Search" style="display: none;">
52-
</form>
53-
{% endif %}
44+
{% if jekyll.environment == 'production' %}
45+
<form action="{{ '/search/' | relative_url }}" method="get">
46+
<input type="text" name="q" id="search-input" placeholder="Search">
47+
<input type="submit" value="Search" style="display: none;">
48+
</form>
49+
{% else %}
50+
<form action="{{ '/search/' | relative_url }}" method="get">
51+
<input type="text" name="q" id="search-input" placeholder="Search">
52+
<input type="submit" value="Search" style="display: none;">
53+
</form>
54+
{% endif %}
5455

55-
{% include sidebar.html %}
56+
{% include sidebar.html %}
5657

57-
<!--<p class="copyright">-->
58-
<!--<a href="https://steemit.com.com/">-->
59-
<!--steemit-->
60-
<!--</a>-->
61-
<!--</p>-->
62-
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
58+
<!--<p class="copyright">-->
59+
<!--<a href="https://steemit.com.com/">-->
60+
<!--steemit-->
61+
<!--</a>-->
62+
<!--</p>-->
63+
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
6364
</header>
6465
<div class="main" id="top">
65-
<div class="hero">
66-
<h1 class="hero__h1">Steem Developer Portal {% if page.section %} - {{ page.section }}{% endif %}</h1>
67-
{% if jekyll.environment == 'production' %}
68-
<img class="hero__img" src="{{ '/images/hero.png' | relative_url }}">
69-
{% else %}
70-
<img class="hero__img" src="{{ '/images/hero.png' | relative_url }}">
71-
{% endif %}
72-
</div>
73-
{{ content }}
66+
<div class="hero">
67+
<h1 class="hero__h1">Steem Developer Portal {% if page.section %} - {{ page.section }}{% endif %}</h1>
68+
{% if jekyll.environment == 'production' %}
69+
<img class="hero__img" src="{{ '/images/hero.png' | relative_url }}">
70+
{% else %}
71+
<img class="hero__img" src="{{ '/images/hero.png' | relative_url }}">
72+
{% endif %}
73+
</div>
74+
{{ content }}
7475
</div>
7576
<div class="footer">
76-
<a href="#">Back to top</a>
77+
<a href="#">Back to top</a>
7778
</div>
7879
<script>
7980
document.getElementById("open-nav").addEventListener("click", function () {

_sass/_main.scss

+6
Original file line numberDiff line numberDiff line change
@@ -622,3 +622,9 @@ blockquote {
622622
max-width: 100%;
623623
max-height: 100%;
624624
}
625+
626+
// See: https://github.com/turbolinks/turbolinks#displaying-progress
627+
.turbolinks-progress-bar {
628+
height: 5px;
629+
background-color: $brand-colour;
630+
}

js/main.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ function getClosestHeader() {
100100
}
101101

102102

103-
104-
$(document).ready(function(){
103+
$(document).on('ready turbolinks:load', function() {
105104
// Select all links with hashes
106105
$('a[href*="#"]')
107106
// Remove links that don't actually link to anything

0 commit comments

Comments
 (0)