Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Commit 29f100c

Browse files
committed
Swift 2 support
1 parent 5c09936 commit 29f100c

File tree

6 files changed

+34
-20
lines changed

6 files changed

+34
-20
lines changed

_assets/css/theme.css.less

+13-6
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ body.home {
138138
}
139139
}
140140
}
141-
.version {
142-
color: rgba(255, 255, 255, 0.7);
143-
}
144141
}
145142

146143
.select2-results {
@@ -192,9 +189,6 @@ body.home {
192189
#accordion {
193190
margin: 30px 0;
194191

195-
#versions {
196-
margin-top: 30px;
197-
}
198192
.panel {
199193
color: @panel-text;
200194
background: @panel-bottom;
@@ -234,6 +228,15 @@ a {
234228
color: @content-link;
235229
}
236230

231+
#version {
232+
background: #eee;
233+
234+
.container {
235+
text-align: center;
236+
padding: 5px 0;
237+
}
238+
}
239+
237240
.content {
238241
margin: 0 0 50px;
239242

@@ -353,6 +356,10 @@ a {
353356
}
354357
}
355358

359+
.declaration .comment {
360+
margin: -0.5em 0 20px 30px;
361+
}
362+
356363
code {
357364
background: transparent;
358365
color: inherit;

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ baseurl: ""
77
url: "http://swiftdoc.org"
88
twitter_username: SwiftDocOrg
99
github_username: SwiftDocOrg
10-
swift_version: "Swift version 1.2 (swiftlang-602.0.49.3)"
10+
swift_version: "Swift version 1.2 (602.0.49.3) & 2.0 (700.0.38.1)"
1111

1212
port: 4040
1313
include: [ "_[A-Z]*", "__[A-Z]*" ]

_includes/head.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<head>
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
{% if page.title == "Home" %}
8+
<title>{{ site.title }} &#8212; {{ site.description }}</title>
9+
{% else %}
710
<title>{% if page.title %}{{ page.title | strip_html }} &#8212; {% endif %}{{ site.title }}</title>
11+
{% endif %}
812
<meta name="viewport" content="width=device-width, initial-scale=1">
913
<meta name="description" content="{{ meta_description }}">
1014
<meta name="keywords" content="{{ meta_keywords }}">
@@ -52,7 +56,7 @@
5256
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
5357
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
5458
<![endif]-->
55-
{% if page.version %}
56-
<script src="/assets/js/swift-linkdata-{{ page.version }}.js"></script>
59+
{% if page.root %}
60+
<script src="{{ page.root }}/assets/js/swift-linkdata.js"></script>
5761
{% endif %}
5862
</head>

_includes/header.html

+13-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,23 @@ <h1><a href="/">SwiftDoc.org</a></h1>
3434
<h1><a href="/">{{ site.title }}</a></h1>
3535
<p>Auto-generated documentation for <a href="https://developer.apple.com/swift/">Swift</a>. Command-click no more.</p>
3636

37-
{% if page.url == "/index.html" %}
37+
{% if page.layout == "home" %}
3838
<div class="form-group form-group-lg input-group-lg has-feedback">
3939
<input type="hidden" class="form-control select2">
4040
<span class="glyphicon glyphicon-search form-control-feedback"></span>
4141
</div>
4242
{% endif %}
4343
</div>
4444
</div>
45+
46+
{% unless page.url contains "/news" %}
47+
<div id="version">
48+
<div class="container">
49+
{% if page.url contains "/swift-2" %}
50+
Swift version: <a href="/">1.2</a> &nbsp;|&nbsp; <strong>2.0</strong>
51+
{% else %}
52+
Swift version: <strong>1.2</strong> &nbsp;|&nbsp; <a href="/swift-2/">2.0</a>
53+
{% endif %}
54+
</div>
55+
</div>
56+
{% endunless %}

_includes/post.html

-9
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,4 @@ <h1><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h1>
99
{{ content }}
1010
</article>
1111

12-
<p class="meta">
13-
<span class="tags">
14-
<span class="glyphicon glyphicon-tag"></span>
15-
{% for tag in post.tags %}
16-
<a href="{{ site.baseurl }}/news/tags/{{ tag }}">{{ tag }}</a>
17-
{% endfor %}
18-
</span>
19-
</p>
20-
2112
</div>

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: "home"
33
title: "Home"
4+
root: ""
45
---
56

67
<div class="container-fluid home-block">
@@ -324,7 +325,6 @@ <h2>Operators</h2>
324325
<h2>Globals</h2>
325326

326327
<ul class="main-list">
327-
<li><a href="/global/var/">Variables</a></li>
328328
<li><a href="/global/alias/">Type Aliases</a></li>
329329
</ul>
330330

0 commit comments

Comments
 (0)