Skip to content

Commit bafdd14

Browse files
committed
Add XSLT style for RSS, new Atom feed and restructured sitemap.xml
1 parent a3baad8 commit bafdd14

13 files changed

Lines changed: 464 additions & 192 deletions

File tree

_data/services.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
- name: "Contact"
44
url: "/contact/"
5-
class: "services-contact"
65
title: "Contact"
76

87
- name: "RSS"
98
url: "/feed.xml"
10-
class: "rss-link"
11-
title: "Subscribe to RSS"
9+
title: "Subscribe to RSS Feed"
10+
11+
- name: "Atom"
12+
url: "/atom.xml"
13+
title: "Subscribe to Atom Feed"
1214

1315
- name: "sitemap.xml"
1416
url: "/sitemap.xml"
15-
class: "sitemap-link"
16-
title: "Sitemap for Google Webmastertools"
17+
title: "Sitemap for Google Webmaster Tools"

_includes/sitemap_collection.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- {{ include.name }}: {{ include.links | size }} links with priority={{ include.priority }}, changefreq={{ include.changefreq }} -->
2+
{% for link in include.links %}
3+
{% unless link.sitemap.exclude or link.published == false %}
4+
<url>
5+
<loc>{{ site.url }}{{ site.baseurl }}{{ link.url | remove: 'index.html' }}</loc>
6+
{% if link.sitemap.lastmod %}
7+
<lastmod>{{ link.sitemap.lastmod | date: '%Y-%m-%d' }}</lastmod>
8+
{% elsif link.date %}
9+
<lastmod>{{ link.date | date_to_xmlschema }}</lastmod>
10+
{% else %}
11+
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
12+
{% endif %}
13+
{% if link.sitemap.changefreq %}
14+
<changefreq>{{ link.sitemap.changefreq }}</changefreq>
15+
{% else %}
16+
<changefreq>{{ include.changefreq }}</changefreq>
17+
{% endif %}
18+
{% if link.sitemap.priority %}
19+
<priority>{{ link.sitemap.priority }}</priority>
20+
{% else %}
21+
<priority>{{ include.priority }}</priority>
22+
{% endif %}
23+
</url>
24+
{% endunless %}
25+
{% endfor %}

_layouts/default.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
---
22
layout: compress
33
---
4-
{% include head.html %}
4+
<!doctype html>
5+
<html class="no-js" lang="{% if site.language == nil %}en{% else %}{{ site.language }}{% endif %}">
6+
<head>
7+
{% include head.html %}
8+
</head>
59
<body id="top-of-page" class="{{ page.format }}">
10+
{% unless page.skip_boilerplate %}
611
{% include navigation.html %}
12+
{% endunless %}
713

814
{% include masthead.html %}
915

1016
{{ content }}
1117

18+
{% unless page.skip_boilerplate %}
1219
{% include footer.html %}
13-
20+
{% endunless %}
21+
1422
{% include footer_scripts.html %}
1523
</body>
16-
</html>
24+
</html>

_layouts/xml-style.xsl

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
layout: null
3+
source: 'http://www.evagoras.com/2011/02/10/improving-an-xml-feed-display-through-css-and-xslt/'
4+
breadcrumbs: true
5+
---
6+
<?xml version="1.0" encoding="UTF-8"?>
7+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" {{ page.stylesheetAttributes }}>
8+
<xsl:output method="html" encoding="utf-8" />
9+
<xsl:template match="{{ page.rootMatcher }}">
10+
<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html &gt;</xsl:text>
11+
<html>
12+
<head>
13+
<xsl:text disable-output-escaping="yes"><![CDATA[
14+
{% include head.html %}
15+
]]></xsl:text>
16+
</head>
17+
<body id="top-of-page">
18+
<xsl:text disable-output-escaping="yes"><![CDATA[
19+
{% include navigation.html %}
20+
{% include masthead.html %}
21+
{% include alert warning=page.disclaimer classes="text-center" %}
22+
]]></xsl:text>
23+
{{ content }}
24+
<xsl:text disable-output-escaping="yes"><![CDATA[
25+
{% include footer.html %}
26+
{% include footer_scripts.html %}
27+
]]></xsl:text>
28+
</body>
29+
</html>
30+
</xsl:template>
31+
<xsl:template name="slugify">
32+
<xsl:param name="text" select="''" />
33+
<xsl:variable name="dodgyChars" select="' ,.#_-!?*:;=+|&amp;/\\'" />
34+
<xsl:variable name="replacementChar" select="'-----------------'" />
35+
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
36+
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
37+
<xsl:variable name="lowercased"><xsl:value-of select="translate( $text, $uppercase, $lowercase )" /></xsl:variable>
38+
<xsl:variable name="escaped"><xsl:value-of select="translate( $lowercased, $dodgyChars, $replacementChar )" /></xsl:variable>
39+
<xsl:value-of select="$escaped" />
40+
</xsl:template>
41+
</xsl:stylesheet>

_sass/_04_settings_global.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,15 @@ $list-side-margin: 1.3rem;
325325
// $include-html-accordion-classes: $include-html-classes;
326326

327327
$accordion-navigation-padding: rem-calc(12);
328-
$accordion-navigation-bg-color: #ffffff;
329-
$accordion-navigation-hover-bg-color: $grey-1;
330-
$accordion-navigation-active-bg-color: $grey-1;
328+
// $accordion-navigation-bg-color: #ffffff;
329+
// $accordion-navigation-hover-bg-color: $grey-1;
330+
// $accordion-navigation-active-bg-color: $grey-1;
331331
// $accordion-navigation-font-color: $jet;
332332
// $accordion-navigation-font-size: rem-calc(16);
333333
// $accordion-navigation-font-family: $body-font-family;
334334

335335
// $accordion-content-padding: $column-gutter/2;
336-
$accordion-content-active-bg-color: $grey-1;
336+
$accordion-content-active-bg-color: $body-bg;
337337

338338
// 02. Alert Boxes
339339
// - - - - - - - - - - - - - - - - - - - - - - - - -

assets/css/atom.scss

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
---
3+
@charset "utf-8";
4+
5+
@import "functions.scss";
6+
7+
$include-html-classes: false;
8+
@import "01_settings_colors.scss";
9+
@import "02_settings_typography.scss";
10+
@import "03_settings_mixins_media_queries.scss";
11+
@import "04_settings_global.scss";
12+
13+
* {
14+
display: block;
15+
}
16+
17+
:root {
18+
margin: 3em;
19+
background: $body-bg;
20+
color: $body-font-color;
21+
font-family: $body-font-family;
22+
}
23+
24+
feed {
25+
> title {
26+
text-align: center;
27+
color: lighten($primary-color, 25%);
28+
font-family: $header-font-family;
29+
font-size: $font-size-h1 * 1.5;
30+
font-weight: bolder;
31+
&::before {
32+
content: 'Atom Feed for ';
33+
font-weight: initial;
34+
}
35+
&::after {
36+
content: "This Atom feed is meant to be used by RSS reader applications and websites.";
37+
display: block;
38+
padding: 1em;
39+
background-color: $alert-color;
40+
color: #fff;
41+
font-family: initial;
42+
font-size: initial;
43+
letter-spacing: initial;
44+
}
45+
}
46+
47+
> id,
48+
> updated,
49+
> subtitle,
50+
> author,
51+
> link,
52+
> generator {
53+
display: none;
54+
}
55+
}
56+
57+
entry {
58+
padding: 1em 0;
59+
border-bottom: 1px solid invert($body-bg);
60+
&:last-child {
61+
border-bottom: none;
62+
}
63+
64+
> title {
65+
color: $secondary-color;
66+
font-family: $header-font-family;
67+
font-size: $font-size-h1;
68+
margin-bottom: 0.5em;
69+
}
70+
71+
> link::after {
72+
content: attr(href);
73+
color: $primary-color;
74+
}
75+
76+
> updated {
77+
color: $grey-5;
78+
font-size: small;
79+
}
80+
81+
> summary {
82+
margin-top: 1em;
83+
}
84+
85+
> id,
86+
> author,
87+
> category,
88+
> published,
89+
> content {
90+
display: none;
91+
}
92+
}

assets/css/rss.scss

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
---
3+
@charset "utf-8";
4+
5+
@import "functions.scss";
6+
7+
$include-html-classes: false;
8+
@import "01_settings_colors.scss";
9+
@import "02_settings_typography.scss";
10+
@import "03_settings_mixins_media_queries.scss";
11+
@import "04_settings_global.scss";
12+
13+
* {
14+
display: block;
15+
}
16+
17+
:root {
18+
margin: 3em;
19+
background: $body-bg;
20+
color: $body-font-color;
21+
font-family: $body-font-family;
22+
}
23+
24+
channel {
25+
> title {
26+
text-align: center;
27+
color: lighten($primary-color, 25%);
28+
font-family: $header-font-family;
29+
font-size: $font-size-h1 * 1.5;
30+
font-weight: bolder;
31+
&::before {
32+
content: 'RSS Feed for ';
33+
font-weight: initial;
34+
}
35+
&::after {
36+
content: "This RSS feed is meant to be used by RSS reader applications and websites.";
37+
display: block;
38+
padding: 1em;
39+
background-color: $alert-color;
40+
color: #fff;
41+
font-family: initial;
42+
font-size: initial;
43+
letter-spacing: initial;
44+
}
45+
}
46+
47+
> description,
48+
> link {
49+
display: none;
50+
}
51+
}
52+
53+
item {
54+
padding: 1em 0;
55+
border-bottom: 1px solid invert($body-bg);
56+
&:last-child {
57+
border-bottom: none;
58+
}
59+
60+
> title {
61+
color: $secondary-color;
62+
font-family: $header-font-family;
63+
font-size: $font-size-h1;
64+
margin-bottom: 0.5em;
65+
}
66+
67+
> link {
68+
color: $primary-color;
69+
}
70+
71+
> pubDate {
72+
color: $grey-5;
73+
font-size: small;
74+
}
75+
76+
> description {
77+
margin-top: 1em;
78+
overflow: hidden;
79+
white-space: nowrap;
80+
text-overflow:ellipsis;
81+
}
82+
83+
> guid,
84+
> category {
85+
display: none;
86+
}
87+
}

0 commit comments

Comments
 (0)