Skip to content

Commit f917317

Browse files
committed
Break out toolbar to its own include
1 parent efebc38 commit f917317

File tree

8 files changed

+129
-38
lines changed

8 files changed

+129
-38
lines changed

doc-tool/resources/_includes/scala-logo.svg

Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div id="toolbar">
2+
<a id="home-button" href="{{ site.baseurl }}/index.html">
3+
{% include "scala-logo.svg" %}
4+
</a>
5+
<div id="project-details">
6+
<h1 id="project-name">{{ site.project }} Documentation</h1>
7+
<h2 id="project-version">0.1-SNAPSHOT</h2>
8+
</div>
9+
</div>

doc-tool/resources/_layouts/api-page.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@
22
layout: main
33
extraCSS:
44
- css/sidebar.css
5+
- css/toolbar.css
56
- css/api-page.css
67
---
78

9+
{% include "toolbar" %}
10+
811
<div id="content-wrapper">
12+
{% assign sidebarTop = "75px" %}
913
{% include "sidebar" %}
1014

1115
<script>
12-
document.title = "{{ site.project }} API - {{ entity.name }}"
16+
document.title = "{{ site.project }} Docs - {{ entity.name }}"
1317
</script>
1418

1519
<div id="content-body">
16-
<button type="button" id="menu-toggle" onclick="toggleMenu()" aria-expanded="false">
17-
<span class="sr-only" aria-hidden="true">Toggle navigation</span>
18-
<span class="icon-bar"></span>
19-
<span class="icon-bar"></span>
20-
<span class="icon-bar"></span>
21-
</button>
22-
2320
<div id="entity-container">
2421
<div id="entity-title">
2522
<span id="entity-annotations">
Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
---
2-
layout: sidebar
2+
layout: main
3+
extraCSS:
4+
- css/toolbar.css
5+
- css/sidebar.css
36
---
47

5-
<div id="post-title">
6-
<h3 id="post-date">
7-
{{ page.date | date: '%B %d, %Y' }}
8-
</h3>
9-
<h1 id="main-title">{{ page.title }}</h1>
10-
{% if page.subTitle %}
11-
<h2 id="sub-title">{{ page.subTitle }}</h2>
12-
{% endif %}
13-
</div>
8+
{% include "toolbar" %}
149

15-
<div id="blog-post-container">
16-
{{ content }}
17-
</div>
10+
<div id="content-wrapper">
11+
{% assign sidebarTop = "75px" %}
12+
{% include "sidebar" %}
1813

19-
{% if page.author %}
20-
<div id="post-footer">
21-
{% if page.authorImg %}
22-
<img id="author-image" src="{{ site.baseurl }}/{{ page.authorImg }}">
23-
{% endif %}
24-
<span id="post-author">
25-
{% if page.authorImg == null %}- {% endif %}{{ page.author }}
26-
</span>
27-
</div>
28-
{% endif %}
14+
<div id="content-body" class="doc-page-body">
15+
<div id="post-title">
16+
<h3 id="post-date">
17+
{{ page.date | date: '%B %d, %Y' }}
18+
</h3>
19+
<h1 id="main-title">{{ page.title }}</h1>
20+
{% if page.subTitle %}
21+
<h2 id="sub-title">{{ page.subTitle }}</h2>
22+
{% endif %}
23+
</div>
24+
25+
<div id="blog-post-container">
26+
{{ content }}
27+
</div>
28+
29+
{% if page.author %}
30+
<div id="post-footer">
31+
{% if page.authorImg %}
32+
<img id="author-image" src="{{ site.baseurl }}/{{ page.authorImg }}">
33+
{% endif %}
34+
<span id="post-author">
35+
{% if page.authorImg == null %}- {% endif %}{{ page.author }}
36+
</span>
37+
</div>
38+
{% endif %}
39+
40+
</div><!-- end content-body -->
41+
</div><!-- end content-wrapper -->
Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
---
2-
layout: sidebar
2+
layout: main
3+
extraCSS:
4+
- css/sidebar.css
5+
- css/toolbar.css
6+
- css/api-page.css
37
---
48

5-
<h1 id="doc-page-title">{{ page.title }}</h1>
6-
<div id="doc-page-container">
7-
{{ content }}
8-
</div>
9+
{% include "toolbar" %}
10+
11+
<div id="content-wrapper">
12+
{% assign sidebarTop = "75px" %}
13+
{% include "sidebar" %}
14+
15+
<div id="content-body" class="doc-page-body">
16+
<h1 id="doc-page-title">{{ page.title }}</h1>
17+
<hr/>
18+
<div id="doc-page-container">
19+
{{ content }}
20+
</div>
21+
</div><!-- end content-body -->
22+
</div><!-- end content-wrapper -->

doc-tool/resources/css/toolbar.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700);
2+
3+
div#toolbar {
4+
height: 75px;
5+
width: 100%;
6+
background-color: #4c5264;
7+
position: fixed;
8+
top: 0; left: 0;
9+
z-index: 2;
10+
}
11+
12+
div#toolbar > a#home-button svg g#logo-foreground {
13+
fill: rgba(202, 68, 94, 1);
14+
}
15+
16+
div#toolbar > a#home-button svg g#logo-background {
17+
fill: rgba(202, 68, 94, 0.45);
18+
}
19+
20+
div#toolbar > a#home-button {
21+
margin: 9px 0 0 38px;
22+
user-select: none;
23+
float: left;
24+
}
25+
26+
div#toolbar > div#project-details {
27+
float: left;
28+
color: #fff;
29+
font-family: "Source Sans Pro", sans-serif;
30+
margin: 18px 0 0 40px;
31+
padding-left: 10px;
32+
}
33+
34+
div#toolbar > div#project-details:before {
35+
display: block;
36+
content: '';
37+
position: absolute;
38+
top: 22px;
39+
left: 95px;
40+
width: 1px;
41+
bottom: 20px;
42+
background-color: #767e94;
43+
}
44+
45+
div#toolbar > div#project-details > h1#project-name {
46+
font-size: 20px;
47+
font-weight: 300;
48+
margin-bottom: 3px;
49+
}
50+
51+
div#toolbar > div#project-details > h2#project-version {
52+
font-size: 12px;
53+
font-weight: 200;
54+
margin-left: 1px;
55+
}
56+

doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma
127127

128128
// Copy statics included in resources
129129
Map(
130+
"css/toolbar.css" -> "/css/toolbar.css",
130131
"css/sidebar.css" -> "/css/sidebar.css",
131132
"css/api-page.css" -> "/css/api-page.css",
132133
"css/dottydoc.css" -> "/css/dottydoc.css",
@@ -364,7 +365,7 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma
364365
val defaultIncludes: Map[String, Include] = Map(
365366
"header.html" -> "/_includes/header.html",
366367
"scala-logo.svg" -> "/_includes/scala-logo.svg",
367-
"toc.html" -> "/_includes/toc.html",
368+
"toolbar.html" -> "/_includes/toolbar.html",
368369
"sidebar.html" -> "/_includes/sidebar.html"
369370
).map {
370371
case (name, path) =>

doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class SiteTests extends DottyDocTest with SourceFileOps {
8282
val compd = site.compilableFiles.map(site.stripRoot).toSet
8383

8484
val expectedAssets = Set(
85+
"css/toolbar.css",
8586
"css/sidebar.css",
8687
"css/api-page.css",
8788
"css/dottydoc.css",

0 commit comments

Comments
 (0)