Skip to content

Commit a72fec3

Browse files
committed
format files
1 parent f377a9d commit a72fec3

File tree

2 files changed

+93
-84
lines changed

2 files changed

+93
-84
lines changed

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<link href="{{site.url}}/css/timeline.css" rel="stylesheet" />
2323
{% endif %}
2424

25-
{% if page.layout == "post" %}
25+
{% if page.section-type == "post" %}
2626
{% if site.syntax-highlight %}
2727
<link rel="stylesheet" type="text/css" href=" {{site.url}}/css/everforest.css" />
2828
{% endif %}

_includes/js.html

Lines changed: 92 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -52,114 +52,123 @@
5252

5353
{% if page.section-type == "index" %}
5454

55-
<!-- Collapse navbar when navbar-brand is clicked -->
56-
57-
<script>
58-
$(function () {
59-
$(".navbar-brand").click(function () {
60-
$(".collapse.in") &&
61-
$(".collapse.in").animate({ height: "1px" }, 500, function () {
62-
$(".collapse.in").removeClass("in");
63-
});
55+
<!-- Collapse navbar when navbar-brand is clicked -->
56+
57+
<script>
58+
$(function () {
59+
$(".navbar-brand").click(function () {
60+
$(".collapse.in") &&
61+
$(".collapse.in").animate({ height: "1px" }, 500, function () {
62+
$(".collapse.in").removeClass("in");
63+
});
64+
});
6465
});
65-
});
66-
</script>
66+
</script>
6767

68-
{% if site.dynamic-typing %}
68+
{% if site.dynamic-typing %}
6969

70-
<!-- Dynamic Typing Start -->
70+
<!-- Dynamic Typing Start -->
7171

72-
<script
73-
type="text/javascript"
74-
src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/1.1.7/typed.min.js"
75-
></script>
72+
<script
73+
type="text/javascript"
74+
src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/1.1.7/typed.min.js"
75+
></script>
76+
77+
<script type="text/javascript">
7678

77-
<script type="text/javascript">
79+
var myQuotes = new Array();
80+
{% for line in site.lines %}
81+
myQuotes.push("{{ line.text }}");
82+
{% endfor %}
7883

79-
var myQuotes = new Array();
80-
{% for line in site.lines %}
81-
myQuotes.push("{{ line.text }}");
82-
{% endfor %}
84+
function shuffle(array) {
85+
var currentIndex = array.length, temporaryValue, randomIndex ;
8386

84-
function shuffle(array) {
85-
var currentIndex = array.length, temporaryValue, randomIndex ;
87+
// While there remain elements to shuffle...
88+
while (0 !== currentIndex) {
8689

87-
// While there remain elements to shuffle...
88-
while (0 !== currentIndex) {
90+
// Pick a remaining element...
91+
randomIndex = Math.floor(Math.random() * currentIndex);
92+
currentIndex -= 1;
8993

90-
// Pick a remaining element...
91-
randomIndex = Math.floor(Math.random() * currentIndex);
92-
currentIndex -= 1;
94+
// And swap it with the current element.
95+
temporaryValue = array[currentIndex];
96+
array[currentIndex] = array[randomIndex];
97+
array[randomIndex] = temporaryValue;
98+
}
9399

94-
// And swap it with the current element.
95-
temporaryValue = array[currentIndex];
96-
array[currentIndex] = array[randomIndex];
97-
array[randomIndex] = temporaryValue;
100+
return array;
98101
}
99102

100-
return array;
101-
}
103+
{% if site.shuffle %}
104+
shuffle(myQuotes)
105+
{% endif %}
106+
107+
$(".intro-text").typed({
108+
strings: myQuotes,
109+
typeSpeed: {{ site.type-speed }},
110+
backDelay: {{ site.delete-delay }},
111+
startDelay: {{ site.start-delay }},
112+
loop: {{ site..loop }},
113+
loopCount: {{ site.loop-count }},
114+
cursorChar: "|"
115+
});
116+
</script>
117+
118+
<!-- Dynamic Typing End -->
102119

103-
{% if site.shuffle %}
104-
shuffle(myQuotes)
105120
{% endif %}
106121

107-
$(".intro-text").typed({
108-
strings: myQuotes,
109-
typeSpeed: {{ site.type-speed }},
110-
backDelay: {{ site.delete-delay }},
111-
startDelay: {{ site.start-delay }},
112-
loop: {{ site..loop }},
113-
loopCount: {{ site.loop-count }},
114-
cursorChar: "|"
115-
});
116-
</script>
122+
{% endif %}
117123

118-
<!-- Dynamic Typing End -->
124+
{% if site.disqus-shortname %}
119125

120-
{% endif %} {% endif %} {% if site.disqus-shortname %} {% if page.has-comments
121-
%}
126+
{% if page.has-comments %}
122127

123-
<!-- Comments Counter Start -->
128+
<!-- Comments Counter Start -->
124129

125-
<script type="text/javascript">
126-
var disqus_shortname = "{{ site.disqus-shortname }}";
130+
<script type="text/javascript">
131+
var disqus_shortname = "{{ site.disqus-shortname }}";
127132

128-
(function () {
129-
var s = document.createElement("script");
130-
s.async = true;
131-
s.type = "text/javascript";
132-
s.src = "//" + disqus_shortname + ".disqus.com/count.js";
133-
(
134-
document.getElementsByTagName("HEAD")[0] ||
135-
document.getElementsByTagName("BODY")[0]
136-
).appendChild(s);
137-
})();
138-
</script>
133+
(function () {
134+
var s = document.createElement("script");
135+
s.async = true;
136+
s.type = "text/javascript";
137+
s.src = "//" + disqus_shortname + ".disqus.com/count.js";
138+
(
139+
document.getElementsByTagName("HEAD")[0] ||
140+
document.getElementsByTagName("BODY")[0]
141+
).appendChild(s);
142+
})();
143+
</script>
139144

140-
<!-- Comments Counter End -->
145+
<!-- Comments Counter End -->
141146

142-
{% endif %} {% if page.section-type == "post" %}
147+
{% endif %}
143148

144-
<!-- Disqus Comments -->
149+
{% if page.section-type == "post" %}
145150

146-
<script type="text/javascript">
147-
var disqus_shortname = "{{ site.disqus-shortname }}";
148-
(function () {
149-
var dsq = document.createElement("script");
150-
dsq.type = "text/javascript";
151-
dsq.async = true;
152-
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
153-
(
154-
document.getElementsByTagName("head")[0] ||
155-
document.getElementsByTagName("body")[0]
156-
).appendChild(dsq);
157-
})();
158-
</script>
151+
<!-- Disqus Comments -->
152+
153+
<script type="text/javascript">
154+
var disqus_shortname = "{{ site.disqus-shortname }}";
155+
(function () {
156+
var dsq = document.createElement("script");
157+
dsq.type = "text/javascript";
158+
dsq.async = true;
159+
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
160+
(
161+
document.getElementsByTagName("head")[0] ||
162+
document.getElementsByTagName("body")[0]
163+
).appendChild(dsq);
164+
})();
165+
</script>
159166

160-
<!-- Share buttons Start -->
161-
<script src="https://cdnjs.cloudflare.com/ajax/libs/rrssb/1.14.0/js/rrssb.min.js"></script>
167+
<!-- Share buttons Start -->
168+
<script src="https://cdnjs.cloudflare.com/ajax/libs/rrssb/1.14.0/js/rrssb.min.js"></script>
169+
170+
{% endif %}
162171

163-
{% endif %} {% endif %}
172+
{% endif %}
164173

165174
<!-- Javascript End -->

0 commit comments

Comments
 (0)