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

14 files changed

+88
-27
lines changed

.travis-ci.sh

+16
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

+28
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

+1-2
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

+1-1
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

+14
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

+2-2
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

+4
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

+7-7
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

+1-1
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

+2-2
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>

_layouts/pid.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
<div class="post">
1818
<header class="post-header">
1919
<h1 class="h2">
20-
<a href="/{{vid}}/">{{vid}}</a> /
20+
<a href="/{{vid}}/">{{vid|upcase}}</a> /
2121
{{pid|upcase}} -
22-
{{page.title}}
22+
{{page.title|xml_escape}}
2323
</h1>
2424
</header>
2525
<article class="post-content">
2626
<table>
27-
<tr><th>VID</th><td>0x{{vid}}</td></tr>
27+
<tr><th>VID</th><td>0x{{vid|upcase}}</td></tr>
2828
<tr><th>PID</th><td>0x{{pid|upcase}}</td></tr>
29-
<tr><th>Owner</th><td><a href="{{org.url}}">{{org.title}}</a></td></tr>
30-
<tr><th>License</th><td>{{page.license}}</td></tr>
29+
<tr><th>Owner</th><td><a href="{{org.url}}">{{org.title|xml_escape}}</a></td></tr>
30+
<tr><th>License</th><td>{{page.license|xml_escape}}</td></tr>
3131
{% if page.site %}
32-
<tr><th>Site</th><td><a href="{{page.site}}">{{page.site}}</a></td></tr>
32+
<tr><th>Site</th><td><a href="{{page.site}}">{{page.site|xml_escape}}</a></td></tr>
3333
{% endif %}
3434
{% if page.source %}
35-
<tr><th>Source</th><td><a href="{{page.source}}">{{page.source}}</a></td></tr>
35+
<tr><th>Source</th><td><a href="{{page.source}}">{{page.source|xml_escape}}</a></td></tr>
3636
{% endif %}
3737
</table>
3838
{{ content }}

about.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ pid.codes seeks to solve this issue for anyone producing open-source hardware. W
1212

1313
pid.codes will assign PIDs on any VID we own to any open-source hardware project needing one. To learn how to get a PID or PIDs for your project, see the [how to get a PID](/howto/) page.
1414

15-
pid.codes will also gladly accept donations of Vendor IDs from other organisations that no longer require them, and take responsibility for administering them. If you have a VID code that is no longer in use, please contact us at [admin@pid.codes](admin@pid.codes).
15+
pid.codes will also gladly accept donations of Vendor IDs from other organisations that no longer require them, and take responsibility for administering them. If you have a VID code that is no longer in use, please contact us at [admin@pid.codes](mailto:admin@pid.codes).
1616

1717
This site is in no way supported or endorsed by [USB-IF](http://www.usb.org/).

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
<div class="post">
1717
<a href="{{ post.url | prepend: site.baseurl }}" class="post-link">
1818
<p class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</p>
19-
<h3 class="h2 post-title">{{ post.title }}</h3>
19+
<h3 class="h2 post-title">{{ post.title | xml_escape }}</h3>
2020
</a>
21-
<p class="post-summary">
21+
<div class="post-summary">
2222
{% if post.summary %}
2323
{{ post.summary }}
2424
{% else %}
2525
{{ post.excerpt }}
2626
{% endif %}
27-
</p>
27+
</div>
2828
</div>
2929
{% endfor %}
3030
</div>

pids.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ permalink: /pids/
77
{% for vid in vids %}
88
{% assign urlparts = vid.url|split:"/" %}
99
{% assign vidno = urlparts[1] %}
10-
<h3><a href="{{vid.url}}">0x{{urlparts[1]}}</a></h3>
10+
<h3><a href="{{vid.url}}">0x{{vidno}}</a></h3>
1111
{%include pidtable.html vid=vidno %}
1212
{% endfor %}

0 commit comments

Comments
 (0)