Skip to content

Commit ea33827

Browse files
authored
Merge pull request #1158 from swiftlang/redesign/blogs
Redesigned Blog and Blog post pages
2 parents 2274f79 + 6ecd471 commit ea33827

File tree

169 files changed

+1516
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+1516
-190
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
assets/javascripts/new-javascripts/vendor/
2+
posts/

_data/new-data/blog/page-data.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
headline: Latest Swift News
2+
read-more: Read more
3+
category_titles:
4+
- 'Language'
5+
- 'Developer Tools'
6+
- 'Adopters'
7+
- 'Community'
8+
- 'Digest'

_layouts/new-layouts/base.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,22 @@
184184
<script src="/assets/javascripts/new-javascripts/application.js"></script>
185185
{% if page.url == "/" %}
186186
<script src="/assets/javascripts/new-javascripts/landing.js"></script>
187+
{% endif %} {% if page.url == "/blog/" %}
188+
<script src="/assets/javascripts/new-javascripts/blog.js"></script>
187189
{% endif %}
188-
<!-- metrics -->
190+
<!-- metrics -->
189191
<script>
190-
/* RSID: */
191-
var s_account="awdswiftorg"
192+
/* RSID: */
193+
var s_account = 'awdswiftorg'
192194
</script>
193195
{% if jekyll.environment != 'development' %}
194196
<script src="https://developer.apple.com/assets/metrics/scripts/analytics.js"></script>
195197
<script>
196-
s.pageName= AC && AC.Tracking && AC.Tracking.pageName();
198+
s.pageName = AC && AC.Tracking && AC.Tracking.pageName()
197199

198-
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
199-
var s_code=s.t();if(s_code)document.write(s_code)
200+
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
201+
var s_code = s.t()
202+
if (s_code) document.write(s_code)
200203
</script>
201204
{% endif %}
202205
<!-- /metrics -->

_layouts/new-layouts/post.html

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
layout: new-layouts/base
3+
---
4+
5+
<section id="post" class="section">
6+
<div class="swoop swoop-1"></div>
7+
8+
<div class="content">
9+
<h1>{{ page.title }}</h1>
10+
11+
{% include authors.html authors=page.author compact=true %}
12+
13+
<time pubdate datetime="{{ page.date | date_to_xmlschema }}"
14+
>{{ page.date | date: "%B %-d, %Y" }}</time
15+
>
16+
{% assign featured_image = page.featured-image %} {% assign
17+
featured_image_dark = page.featured-image-dark %} {% if featured_image.url
18+
%}
19+
<img
20+
class="featured{% if featured_image_dark.url %} hide-dark{% endif %}"
21+
src="{{ featured_image.url }}"
22+
alt="{{ featured_image.alt }}"
23+
/>
24+
{% endif %} {% if featured_image_dark.url %}
25+
<img
26+
class="featured hide-light"
27+
src="{{ featured_image_dark.url }}"
28+
alt="{{ featured_image_dark.alt }}"
29+
/>
30+
{% endif %}
31+
<div class="details">
32+
{{ content }} {% if page.author %}
33+
<hr />
34+
{% assign authors = page.author | array %}
35+
36+
{% if authors.size > 1 %}
37+
<h2>Authors</h2>
38+
{% else %}
39+
<h2>Author</h2>
40+
{% endif %}
41+
42+
{% include authors.html authors=authors %}
43+
{% endif %}
44+
45+
<hr />
46+
47+
<h2>Continue Reading</h2>
48+
49+
{% if page.previous or page.next %}
50+
<nav class="section card-grid">
51+
<div class="content">
52+
<ul class="tertiary-cards">
53+
{% if page.previous %}
54+
<li>
55+
<div>
56+
<h3>{{ page.previous.title }}</h3>
57+
<time pubdate datetime="{{ page.date | date_to_xmlschema }}"
58+
>{{ page.previous.date | date: "%B %-d, %Y" }}</time
59+
>
60+
<p class="nav-excerpt">
61+
{{ page.previous.excerpt | strip_html | truncate: 80, '..' }}
62+
</p>
63+
<a href="{{ page.previous.url }}" rel="prev"> More </a>
64+
</div>
65+
</li>
66+
{% endif %} {% if page.next %}
67+
<li>
68+
<div>
69+
<h3>{{ page.next.title }}</h3>
70+
<time pubdate datetime="{{ page.date | date_to_xmlschema }}"
71+
>{{ page.next.date | date: "%B %-d, %Y" }}</time
72+
>
73+
<p class="nav-excerpt">
74+
{{ page.next.excerpt | strip_html | truncate: 80, '..' }}
75+
</p>
76+
<a href="{{ page.next.url }}" rel="next"> More </a>
77+
</div>
78+
</li>
79+
{% endif %}
80+
</ul>
81+
</div>
82+
</nav>
83+
{% endif %}
84+
</div>
85+
</div>
86+
</section>

_plugins/convert-header.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def convert_header(el, indent)
1616
el_attribute['class'] = "header-with-anchor"
1717
@toc << [el.options[:level], el_attribute['id'], el.children] if el_attribute['id'] && in_toc?(el)
1818
format_as_block_html("h#{level}", el_attribute, "#{inner(el, indent)} <a title=\"Permalink for #{inner(el, indent)}\ section\" href=\"##{el_attribute['id']}\">
19-
<?xml version=\"1.0\" encoding=\"utf-8\"?> <svg width=\"24px\" height=\"24px\" viewBox=\"0 0 14 14\" role=\"img\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 11.58824,9.823529 q 0,-0.294117 -0.20589,-0.499999 L 9.85294,7.794118 q -0.20588,-0.205883 -0.5,-0.205883 -0.30882,0 -0.52941,0.235295 0.0221,0.02206 0.13971,0.136029 0.11764,0.113971 0.15808,0.158088 0.0404,0.04412 0.1103,0.139706 0.0698,0.09559 0.0956,0.1875 0.0257,0.09191 0.0257,0.202206 0,0.294117 -0.20588,0.5 -0.20588,0.205882 -0.5,0.205882 -0.1103,0 -0.20221,-0.02573 Q 8.35293,9.301471 8.25733,9.231621 8.16173,9.161771 8.11763,9.121327 8.07353,9.080887 7.95954,8.963238 7.84557,8.845591 7.82351,8.823533 7.58086,9.051474 7.58086,9.360297 q 0,0.294118 0.20588,0.5 l 1.51471,1.522059 q 0.19853,0.19853 0.5,0.19853 0.29412,0 0.5,-0.191177 l 1.08088,-1.073529 q 0.20589,-0.205883 0.20589,-0.492648 z M 6.41912,4.639706 q 0,-0.294118 -0.20588,-0.5 L 4.69853,2.617647 q -0.20588,-0.205882 -0.5,-0.205882 -0.28677,0 -0.5,0.198529 L 2.61765,3.683823 q -0.20589,0.205883 -0.20589,0.492648 0,0.294117 0.20589,0.499999 l 1.52941,1.529412 q 0.19853,0.19853 0.5,0.19853 0.30882,0 0.52941,-0.227942 Q 5.15437,6.15441 5.03676,6.040441 4.91912,5.92647 4.87868,5.882353 4.83828,5.838233 4.76838,5.742647 q -0.0698,-0.09559 -0.0956,-0.1875 -0.0257,-0.09191 -0.0257,-0.202206 0,-0.294117 0.20588,-0.5 0.20588,-0.205882 0.5,-0.205882 0.1103,0 0.20221,0.02573 0.0919,0.02573 0.1875,0.09559 0.0956,0.06985 0.1397,0.110294 0.0441,0.04044 0.15809,0.158089 Q 6.15443,5.154409 6.17649,5.176467 6.41914,4.948526 6.41914,4.639703 z M 13,9.823529 q 0,0.882353 -0.625,1.492647 l -1.08088,1.07353 Q 10.68382,13 9.80147,13 q -0.88971,0 -1.5,-0.625 L 6.78676,10.852941 Q 6.17647,10.242647 6.17647,9.360294 q 0,-0.904412 0.64706,-1.536764 L 6.17647,7.176471 Q 5.54412,7.82353 4.64706,7.82353 q -0.88235,0 -1.5,-0.617648 L 1.617647,5.676471 Q 1,5.058824 1,4.176471 1,3.294118 1.625,2.683824 L 2.70588,1.610294 Q 3.31618,1 4.19853,1 q 0.88971,0 1.5,0.625 l 1.51471,1.522059 q 0.61029,0.610294 0.61029,1.492647 0,0.904412 -0.64706,1.536764 L 7.82353,6.823529 Q 8.45588,6.17647 9.35294,6.17647 q 0.88235,0 1.5,0.617648 l 1.52941,1.529411 Q 13,8.941176 13,9.823529 z\"/></svg>
19+
<?xml version=\"1.0\" encoding=\"utf-8\"?> <svg width=\"18px\" height=\"18px\" viewBox=\"0 0 14 14\" role=\"img\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 11.58824,9.823529 q 0,-0.294117 -0.20589,-0.499999 L 9.85294,7.794118 q -0.20588,-0.205883 -0.5,-0.205883 -0.30882,0 -0.52941,0.235295 0.0221,0.02206 0.13971,0.136029 0.11764,0.113971 0.15808,0.158088 0.0404,0.04412 0.1103,0.139706 0.0698,0.09559 0.0956,0.1875 0.0257,0.09191 0.0257,0.202206 0,0.294117 -0.20588,0.5 -0.20588,0.205882 -0.5,0.205882 -0.1103,0 -0.20221,-0.02573 Q 8.35293,9.301471 8.25733,9.231621 8.16173,9.161771 8.11763,9.121327 8.07353,9.080887 7.95954,8.963238 7.84557,8.845591 7.82351,8.823533 7.58086,9.051474 7.58086,9.360297 q 0,0.294118 0.20588,0.5 l 1.51471,1.522059 q 0.19853,0.19853 0.5,0.19853 0.29412,0 0.5,-0.191177 l 1.08088,-1.073529 q 0.20589,-0.205883 0.20589,-0.492648 z M 6.41912,4.639706 q 0,-0.294118 -0.20588,-0.5 L 4.69853,2.617647 q -0.20588,-0.205882 -0.5,-0.205882 -0.28677,0 -0.5,0.198529 L 2.61765,3.683823 q -0.20589,0.205883 -0.20589,0.492648 0,0.294117 0.20589,0.499999 l 1.52941,1.529412 q 0.19853,0.19853 0.5,0.19853 0.30882,0 0.52941,-0.227942 Q 5.15437,6.15441 5.03676,6.040441 4.91912,5.92647 4.87868,5.882353 4.83828,5.838233 4.76838,5.742647 q -0.0698,-0.09559 -0.0956,-0.1875 -0.0257,-0.09191 -0.0257,-0.202206 0,-0.294117 0.20588,-0.5 0.20588,-0.205882 0.5,-0.205882 0.1103,0 0.20221,0.02573 0.0919,0.02573 0.1875,0.09559 0.0956,0.06985 0.1397,0.110294 0.0441,0.04044 0.15809,0.158089 Q 6.15443,5.154409 6.17649,5.176467 6.41914,4.948526 6.41914,4.639703 z M 13,9.823529 q 0,0.882353 -0.625,1.492647 l -1.08088,1.07353 Q 10.68382,13 9.80147,13 q -0.88971,0 -1.5,-0.625 L 6.78676,10.852941 Q 6.17647,10.242647 6.17647,9.360294 q 0,-0.904412 0.64706,-1.536764 L 6.17647,7.176471 Q 5.54412,7.82353 4.64706,7.82353 q -0.88235,0 -1.5,-0.617648 L 1.617647,5.676471 Q 1,5.058824 1,4.176471 1,3.294118 1.625,2.683824 L 2.70588,1.610294 Q 3.31618,1 4.19853,1 q 0.88971,0 1.5,0.625 l 1.51471,1.522059 q 0.61029,0.610294 0.61029,1.492647 0,0.904412 -0.64706,1.536764 L 7.82353,6.823529 Q 8.45588,6.17647 9.35294,6.17647 q 0.88235,0 1.5,0.617648 l 1.52941,1.529411 Q 13,8.941176 13,9.823529 z\"/></svg>
2020
</a>", indent)
2121
end
2222
end

_posts/2015-12-03-swift-3-api-design.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2-
layout: post
2+
layout: new-layouts/post
33
published: true
44
date: 2015-12-03 12:01:01
55
title: Swift 3 API Design Guidelines
6+
category: "Language"
67
---
78

89
The design of commonly-used libraries has a large impact on the

_posts/2015-12-03-swift-linux-port.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2-
layout: post
2+
layout: new-layouts/post
33
published: true
44
date: 2015-12-03 11:01:01
55
title: The Swift Linux Port
6+
category: 'Developer Tools'
67
---
78

89
With the launch of the open source Swift project, we are also releasing

_posts/2015-12-03-welcome.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2-
layout: post
2+
layout: new-layouts/post
33
date: 2015-12-03 10:01:01
44
published: true
55
title: The Swift.org Blog
6+
category: "Community"
67
---
78

89
Welcome to the blog on Swift.org! Today we launched the open source Swift project along with the Swift.org website. We couldn't be more excited to work together in an open community to find and fix issues, add enhancements, and bring Swift to new platforms.

_posts/2016-01-29-swift-api-transformation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
layout: post
2+
layout: new-layouts/post
33
published: true
44
date: 2016-1-29
55
title: "It's Coming: the Great Swift API Transformation"
66
author: dabrahams
7+
category: "Language"
78
---
89

910
Cocoa, the Swift standard library, maybe even your own types and

_posts/2016-02-01-swift-CI.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
layout: post
2+
layout: new-layouts/post
33
published: true
44
date: 2016-02-01 18:00:00
55
title: Continuous Integration now Available
66
author: najacque
7+
category: "Community"
78
---
89

910
We are excited to announce that we have rolled out [continuous integration](/documentation/continuous-integration) (aka, CI) for the Swift project!

0 commit comments

Comments
 (0)