Skip to content

Commit 3706846

Browse files
peternewmanArachnid
authored andcommitted
Enable initial Travis CI workflow (pidcodes#183)
* Remove errant .DS_Store file * Ignore .DS_Store * Create a list of organisations * Add an org list * Show number of PIDs per org * Fix HTML issue, sort orgs by title * Try and fix the PID count * Try and fix issues * Try again to fix issues * Try yet again to fix issues * Correct the urlpart * Change to sort_natural, minor code tidy * Try and fix the sorting * Try again to fix the sorting * Remove debugging * Add a link to orgs page * Install dependencies for Travis * Create .travis.yml * Add the Travis script * Update the Ruby version * Bump the Ruby version some more * Switch back to the documented version * Add the exclude * Update based on jekyll/jekyll#5413 * Add github-pages Gem * Add missing gems * Add redcarpet * Switch to tasks so we can run multiple CI tasks * Switch to tasks * Fix the matrix * More matrix fixing * Turn on more htmlproofer options * Make the check less strict * Don't bother complaining about extra jekyll tags * Escape HTML entities * Fix the email link * Fix the link within the 404 page! * Escape more HTML entities * Remove an invalid site URL * Cache ruby bundles * Escape even more HTML entities * Escape yet more HTML entities * Escape more HTML entities and switch to a div * Try and fix the errant paragraph item * Add a Travis badge to the readme * Update Gemfile Adapted from https://github.com/lunaryorn/lunaryorn.github.io * Update _config.yml * Add some more checks to Travis * Report GH Pages versions * Tidy up, add redcarpet back in * Try and stop the spurious paragraph tags
1 parent c54c858 commit 3706846

File tree

14 files changed

+88
-27
lines changed

14 files changed

+88
-27
lines changed

.travis-ci.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -e # halt script on error
3+
4+
HTMLPROOFER_OPTIONS="./_site --check-html --report-missing-names --log-level=:debug"
5+
6+
bundle exec jekyll doctor
7+
bundle exec jekyll build
8+
9+
if [[ $TASK = 'htmlproofer' ]]; then
10+
bundle exec htmlproofer $HTMLPROOFER_OPTIONS --disable-external
11+
elif [[ $TASK = 'htmlproofer-external' ]]; then
12+
bundle exec htmlproofer $HTMLPROOFER_OPTIONS
13+
fi
14+
15+
# Validate GH Pages DNS setup
16+
bundle exec github-pages health-check

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
sudo: false # route your build to the container-based infrastructure for a faster build
2+
3+
language: ruby
4+
5+
# Cache Ruby bundles
6+
cache: bundler
7+
8+
before_script:
9+
- bundle exec github-pages versions
10+
11+
# Assume bundler is being used, therefore
12+
# the `install` step will run `bundle install` by default.
13+
script: "bash -ex .travis-ci.sh"
14+
15+
env:
16+
global:
17+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
18+
19+
matrix:
20+
fast_finish: true
21+
include:
22+
- rvm: 2.2.5
23+
env: TASK='htmlproofer'
24+
- rvm: 2.2.5
25+
env: TASK='htmlproofer-external'
26+
allow_failures:
27+
- rvm: 2.2.5
28+
env: TASK='htmlproofer-external'

1209/E500/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ layout: pid
33
title: Helios Laser DAC
44
owner: GitleMikkelsen
55
license: Creative Commons Attribution-NonCommercial 4.0 International
6-
site: TBD
76
source: https://github.com/Grix/helios_dac
87
---
9-
Open source, low cost USB DAC for the ISP-DB25 laser projector protocol.
8+
Open source, low cost USB DAC for the ISP-DB25 laser projector protocol.

404.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Sorry, we can't seem to find this page's pixylls.
99

1010
<div class="mt3">
1111
<a href="{{ site.baseurl }}/" class="button button-blue button-big">Home</a>
12-
<a href="{{ site.baseurl }}/contact/" class="button button-blue button-big">Contact</a>
12+
<a href="{{ site.baseurl }}/about/" class="button button-blue button-big">About</a>
1313
</div>

Gemfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require "json"
2+
require "open-uri"
3+
4+
source "https://rubygems.org"
5+
6+
versions = open("https://pages.github.com/versions.json") do |source|
7+
JSON.parse(source.read)
8+
end
9+
10+
# Github Pages environment
11+
gem "github-pages", versions['github-pages']
12+
gem "redcarpet"
13+
14+
gem "html-proofer"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
21
# pid.codes
3-
Website for pid.codes
2+
[![Build Status](https://travis-ci.org/pidcodes/pidcodes.github.com.svg?branch=master)](https://travis-ci.org/pidcodes/pidcodes.github.com)
43

4+
Website for [pid.codes](http://pid.codes)

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ share_reddit: false
4444
share_stumbleupon: false
4545

4646
# Build settings
47+
exclude: [vendor]
48+
gems:
49+
- jekyll-paginate
50+
- redcarpet
4751
markdown: redcarpet
4852
redcarpet:
4953
extensions: ['smart', 'tables', 'with_toc_data']

_includes/head.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<head>
22
<meta charset="utf-8">
33
<meta http-equiv="X-UA-Compatible" content="IE=edge">
4-
<title>{% if include.title %}{{ include.title }} &#8211; {% elsif page.title %}{{ page.title }} &#8211; {% endif %}{{ site.title }}</title>
4+
<title>{% if include.title %}{{ include.title | xml_escape }} &#8211; {% elsif page.title %}{{ page.title | xml_escape }} &#8211; {% endif %}{{ site.title | xml_escape }}</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
<meta name="description" content="{% if page.summary %}{{ page.summary }}{% else %}{{ site.description }}{% endif %}">
7-
<meta name="author" content="{{ site.author }}">
8-
{% if page.categories %}<meta name="keywords" content="{{ page.categories | join: ', ' }}">{% endif %}
6+
<meta name="description" content="{% if page.summary %}{{ page.summary | xml_escape }}{% else %}{{ site.description | xml_escape }}{% endif %}">
7+
<meta name="author" content="{{ site.author | xml_escape }}">
8+
{% if page.categories %}<meta name="keywords" content="{{ page.categories | join: ', ' | xml_escape }}">{% endif %}
99
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
1010

1111
<!-- Custom CSS -->
@@ -23,9 +23,9 @@
2323
<!-- From: https://github.com/mmistakes/hpstr-jekyll-theme/blob/master/_includes/head.html -->
2424
<meta property="og:locale" content="en_US">
2525
<meta property="og:type" content="article">
26-
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
27-
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
26+
<meta property="og:title" content="{% if page.title %}{{ page.title | xml_escape }}{% else %}{{ site.title | xml_escape }}{% endif %}">
27+
<meta property="og:description" content="{% if page.description %}{{ page.description | xml_escape }}{% else %}{{ site.description | xml_escape }}{% endif %}">
2828
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
29-
<meta property="og:site_name" content="{{ site.title }}">
29+
<meta property="og:site_name" content="{{ site.title | xml_escape }}">
3030

3131
</head>

_includes/pidtable.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{% assign org = orgs|where:"url",orgpath|first %}
1111
<tr>
1212
<th><a href="{{pid.url}}">{{urlparts[2]|upcase}}</a></th>
13-
<td>{{org.title}} {{pid.title}}</td>
13+
<td>{{org.title|xml_escape}} {{pid.title|xml_escape}}</td>
1414
</tr>
1515
{% endif %}
1616
{% endfor %}

_layouts/org.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="measure">
1414
<div class="post">
1515
<header class="post-header">
16-
<h1 class="h2">{{page.title}}</h1>
16+
<h1 class="h2">{{page.title|xml_escape}}</h1>
1717
</header>
1818
<article class="post-content">
1919
{{ content }}
@@ -28,7 +28,7 @@ <h2>Allocated PIDs</h2>
2828
<tr>
2929
<th><a href="/{{pidurlparts[1]}}/">{{pidurlparts[1]}}</a></th>
3030
<th><a href="{{pid.url}}">{{pidurlparts[2]}}</a></th>
31-
<td>{{page.title}} {{pid.title}}</td>
31+
<td>{{page.title|xml_escape}} {{pid.title|xml_escape}}</td>
3232
</tr>
3333
{% endfor %}
3434
</table>

0 commit comments

Comments
 (0)