Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6d3e71c

Browse files
committed
refactor includes, smooth scroll on page change
1 parentb7e2fbf commit6d3e71c

16 files changed

+59
-18
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎_includes/docs.htmlrenamed to‎_includes/docs/docs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<divclass="doc-contents">
44
<h2>Contents</h2>
55
{% for doc in site.categories[include.category] reversed %}
6-
{% includetable-of-contents.html
6+
{% includedocs/doc-index.html
77
link=doc.link
88
title=doc.title
99
index=forloop.index
@@ -16,7 +16,7 @@ <h2>Contents</h2>
1616
<!-- Docs -->
1717
<div>
1818
{% for doc in site.categories[include.category] reversed %}
19-
{% include doc.html
19+
{% includedocs/doc.html
2020
link=doc.link
2121
title=doc.title
2222
content=doc.content

‎_layouts/default.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
-->
88
<html>
99

10-
{% include head.html %}
10+
{% includebase/head.html %}
1111

1212
<body>
1313

1414
<!-- Page Wrapper -->
1515
<divid="page-wrapper">
1616

17-
{% include header.html %}
17+
{% includebase/header.html %}
1818
{{ content }}
19-
{% include footer.html %}
20-
{% include scripts.html %}
19+
{% includebase/footer.html %}
20+
{% includebase/scripts.html %}
2121

2222
</div>
2323

‎_layouts/landing.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
-->
88
<html>
99

10-
{% include head.html %}
10+
{% includebase/head.html %}
1111

1212
<bodyclass="landing">
1313

1414
<!-- Page Wrapper -->
1515
<divid="page-wrapper">
1616

17-
{% include header.html %}
17+
{% includebase/header.html %}
1818
{{ content }}
19-
{% include footer.html %}
20-
{% include scripts.html %}
19+
{% includebase/footer.html %}
20+
{% includebase/scripts.html %}
2121

2222
</div>
2323

‎_sass/_custom.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
opacity:0.85;
88
}
99

10+
a.smooth:hover {
11+
color:red;
12+
}
13+
1014
.doc-contents {
1115
padding-left:30px;
1216
}

‎atom-coderoad.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@
55
repo: //github.com/coderoad/atom-coderoad
66
---
77

8-
{% include docs.html category="atom-coderoad" %}
8+
{% include docs/docs.html category="atom-coderoad" %}
9+
10+
<!-- <script>if (reSmooth.test(/^#/)) {
11+
let id = '#' + location.hash.replace(reSmooth, '');
12+
$.smoothScroll({scrollTarget: id});
13+
}</script> -->

‎builder-coderoad.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
repo: //github.com/coderoad/builder-coderoad
66
---
77

8-
{% include docs.html category="builder-coderoad" %}
8+
{% include docs/docs.html category="builder-coderoad" %}
99
<!--
1010
<ul>
1111
<li>Installation</li>

‎index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<h2>{{ site.title }}</h2>
99
<p>{{ site.description | markdownify }}</p>
1010
<ulclass="actions">
11-
<li><ahref="/atom-coderoad.html"class="button special">Quick Start</a></li>
11+
<li><ahref="/atom-coderoad.html#install"class="button special">Quick Start</a></li>
1212
</ul>
1313
</div>
1414
<ahref="#one"class="more scrolly">Learn More</a>
@@ -91,7 +91,7 @@ <h2>Accelerated Education</h2>
9191
<p>Find out more about how to setup CodeRoad and get started learning and creating.</p>
9292
</header>
9393
<ulclass="actions vertical">
94-
<li><ahref="/atom-coderoad.html"class="button fit special">Quick Start</a></li>
94+
<li><ahref="/atom-coderoad.html#install"class="button fit special">Quick Start</a></li>
9595
<li><ahref="/overview.html"class="button fit">Overview</a></li>
9696
</ul>
9797
</div>

‎js/modals.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,36 @@ $(function() {
3333
preventDefault:true
3434
});
3535

36+
37+
constscrollnow=function(e){
38+
vartarget;
39+
if(e){
40+
e.preventDefault();
41+
target=this.hash;
42+
}else{
43+
target=location.hash;
44+
}
45+
$.smoothScroll({
46+
offset:-70,
47+
easing:'swing',
48+
speed:400,
49+
autoCoefficient:2,
50+
preventDefault:true,
51+
scrollTarget:target
52+
});
53+
};
54+
55+
if(location.hash){
56+
$('html, body').scrollTop(0).show();
57+
scrollnow();
58+
}
59+
60+
$('a[href*="/"][href*=#]').each(function(){
61+
if(this.pathname.replace(/^\//,'')==location.pathname.replace(/^\//,'')&&this.hostname==location.hostname){
62+
$(this).attr("href",this.hash);
63+
}
64+
});
65+
66+
$('a[href^=#]:not([href=#])').click(scrollnow);
67+
3668
});

‎js/modals.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎tutorial-docs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
<sectionid="suggestions">
1313
<ulclass="actions"style="text-align: center;">
1414
<li>
15-
<aclass="button special"href="/atom-coderoad.html">Quick Start</a>
15+
<aclass="button special"href="/atom-coderoad.html#install">Quick Start</a>
1616
</li>
1717
<li>
18-
<aclass="button"href="/builder-coderoad.html">Builder Start</a>
18+
<aclass="button"href="/builder-coderoad.html#install">Builder Start</a>
1919
</li>
2020
<li>
2121
<aclass="button"href="/overview.html">Overview</a>
2222
</li>
2323
</ul>
2424
</section>
2525

26-
{% include docs.html category="tutorial-docs" %}
26+
{% include docs/docs.html category="tutorial-docs" %}
2727

2828
</div>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp