Skip to content

Commit 32ee7cc

Browse files
authored
Merge pull request GitbookIO#6 from GitbookIO/landing-page
Readme acts as landing page description
2 parents 627dacc + de7da51 commit 32ee7cc

File tree

3 files changed

+40
-11
lines changed

3 files changed

+40
-11
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,14 @@ Extend the theme by creating a file `_layouts/website/page.html` in your book wi
5555
{% endblock %}
5656
```
5757

58+
##### Add short description for the home page
59+
60+
The content of your README will be used as short description on the home page of your FAQ. If you want to keep a separate and more detailed README file for your project, you can use configure your `book.json` to specify the file to use:
61+
62+
```json
63+
{
64+
"structure": {
65+
"readme": "home-page-description.md"
66+
}
67+
}
68+
```

_layouts/website/layout.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,17 @@ <h1>
6060
{% endif %}
6161
{% endblock %}
6262
</h1>
63+
6364
{% block search_input %}{% endblock %}
65+
66+
{% if file.path == readme.file.path %}
67+
<div class="description">
68+
{{ page.content | safe }}
69+
</div>
70+
{% endif %}
6471
</div>
6572
</div>
73+
6674
<div class="faq-page-container">
6775
{% block search_results %}
6876
{% block page %}{% endblock %}
@@ -77,6 +85,7 @@ <h1>
7785
</div>
7886
{% endblock %}
7987

88+
8089
{% block javascript %}
8190
<script src="{{ "gitbook.js"|resolveAsset }}"></script>
8291
{% for resource in plugins.resources.js %}

src/less/website.less

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@
1010
.faq-navbar {
1111
margin: 0px;
1212
border: 0px;
13-
14-
.nav-bar .navbar-nav > li > a {
15-
text-transform: uppercase;
16-
opacity: 0.6;
17-
letter-spacing: 0.1em;
18-
font-weight: 300;
19-
padding-top: 18px;
20-
padding-bottom: 18px;
21-
}
2213
}
2314

2415
.faq-header {
@@ -31,10 +22,23 @@
3122
margin: 0px;
3223
margin-bottom: 30px;
3324

34-
3525
h1 {
3626
border: 0px;
3727
}
28+
29+
.description {
30+
color: #777;
31+
text-align: justify;
32+
line-height: 1.8em;
33+
34+
// Align with faq-page-container
35+
width: @faq-page-container-width;
36+
min-width: @faq-page-container-width;
37+
margin: 0px auto;
38+
padding-left: @faq-page-padding;
39+
padding-right: @faq-page-padding;
40+
padding-top: 40px;
41+
}
3842
}
3943

4044
.faq-page-container {
@@ -65,8 +69,13 @@
6569
}
6670

6771
@media (max-width: @faq-page-container-width) {
72+
.description {
73+
padding-left: 0px;
74+
padding-right: 0px;
75+
}
76+
6877
.faq-page-container {
69-
padding: 0px;
78+
padding: 20px 0px;
7079

7180
> .panel {
7281
border-right: 0px;

0 commit comments

Comments
 (0)