Skip to content

Commit 086cc6a

Browse files
committed
Get rid of {{ site.github.url }}
* Also get rid of absolute links to http://www.ev3dev.org * Introduce publish.rb script to publish to personal gh-pages branch (this was the whole reason for using site.github.url in the first place) Fixes ev3dev#90
1 parent 2653a17 commit 086cc6a

32 files changed

Lines changed: 145 additions & 107 deletions

README.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,9 @@ Now you should be able to visit your page at: [http://localhost:4000](http://loc
4848
Previewing Your Changes Online
4949
---
5050

51-
When forking, you can create a new branch called `gh-pages`, then your
52-
changes can be viewed as `http://<user>.github.io/ev3dev.github.io`. When you do this
53-
though, GitHub will send you lots of email like this, which you should ignore.
54-
55-
The page build completed successfully, but returned the following warning:
56-
57-
CNAME already taken: www.ev3dev.org
58-
59-
For information on troubleshooting Jekyll see:
60-
61-
https://help.github.com/articles/using-jekyll-with-pages#troubleshooting
62-
63-
If you have any questions please contact us at https://github.com/contact.
64-
65-
If it really gets on your nerves, you can rename the `CNAME` file. Just make sure to
66-
change it back before you submit your pull request.
67-
68-
51+
We have a special script to use to publish your changes using the `gh-pages`
52+
branch of your fork of ev3dev.github.io. From the root directory of your local
53+
copy of ev3dev.github.io, run `./publish <github-user-name>` where
54+
*github-user-name* is your actual GitHub user name. This will copy the
55+
contents of `_site`, fix it up a bit and push it to your fork on GitHub. You
56+
can view the results at `http://<github-user-name>.github.io/ev3dev.github.io`.

_config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
markdown: kramdown
22
permalink: pretty
3-
exclude: [README.md, Gemfile, Gemfile.lock, repo-metadata.html]
3+
exclude:
4+
- README.md
5+
- Gemfile
6+
- Gemfile.lock
7+
- repo-metadata.html
8+
- publish.rb
49

510
gems:
611
- jekyll-mentions

_includes/head.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
<meta http-equiv="X-UA-Compatible" content="IE=edge">
55

66
<title>{{ page.title }}</title>
7-
<link rel="alternate" type="application/atom+xml" href="{{ site.github.url }}/news/atom.xml" title="Atom feed">
7+
<link rel="alternate" type="application/atom+xml" href="/news/atom.xml" title="Atom feed">
88
<link rel="icon" href="favicon.ico" />
99

1010
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
11-
<link rel="stylesheet" href="{{ site.github.url }}/stylesheets/bootstrap.css">
12-
<link rel="stylesheet" href="{{ site.github.url }}/stylesheets/bootstrap-extensions.css">
11+
<link rel="stylesheet" href="/stylesheets/bootstrap.css">
12+
<link rel="stylesheet" href="/stylesheets/bootstrap-extensions.css">
1313
<!-- Nav infrastructure and misc utils (search, user cards, embeds, CC license) -->
14-
<link rel="stylesheet" href="{{ site.github.url }}/stylesheets/infrastructure-utils.css" />
14+
<link rel="stylesheet" href="/stylesheets/infrastructure-utils.css" />
1515

1616
<!-- 3rd-party libraries -->
1717
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
1818
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
19-
<script src="{{ site.github.url }}/javascripts/jquery.getUrlParam.js"></script>
20-
<script src="{{ site.github.url }}/javascripts/jquery.loadTemplate-1.4.4.min.js"></script>
21-
<script src="{{ site.github.url }}/javascripts/respond.js"></script>
22-
<script src="{{ site.github.url }}/javascripts/ua-parser.min.js"></script>
19+
<script src="/javascripts/jquery.getUrlParam.js"></script>
20+
<script src="/javascripts/jquery.loadTemplate-1.4.4.min.js"></script>
21+
<script src="/javascripts/respond.js"></script>
22+
<script src="/javascripts/ua-parser.min.js"></script>
2323

2424
<!-- Loads user-cards from GH API -->
25-
<script src="{{ site.github.url }}/javascripts/cards.js"></script>
25+
<script src="/javascripts/cards.js"></script>
2626
<!-- Responds to queries typed into the "Quick nav" box -->
27-
<script src="{{ site.github.url }}/javascripts/search.js"></script>
27+
<script src="/javascripts/search.js"></script>
2828
<!-- Converts static descriptors of tab target content into live text and links -->
29-
<script src="{{ site.github.url }}/javascripts/tabs.js"></script>
29+
<script src="/javascripts/tabs.js"></script>
3030
<!-- Adds classes and other styles to pages where hard-coded css can't be used -->
31-
<script src="{{ site.github.url }}/javascripts/style-helpers.js"></script>
31+
<script src="/javascripts/style-helpers.js"></script>
3232

3333
<!--[if lt IE 9]>
3434
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>

_includes/header.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<span class="icon-bar"></span>
88
<span class="icon-bar"></span>
99
</button>
10-
<a class="navbar-brand" href="{{ site.github.url }}/">
11-
<img id="brand-logo" src="{{ site.github.url }}/images/ev3dev_logo_white.png" />
10+
<a class="navbar-brand" href="/">
11+
<img id="brand-logo" src="/images/ev3dev_logo_white.png" />
1212
</a>
1313
</div>
1414
<div class="collapse navbar-collapse">
1515
<ul class="nav navbar-nav">
1616
<li>
17-
<a href="{{ site.github.url }}/" title="There's no place like Home...">Home</a>
17+
<a href="/" title="There's no place like Home...">Home</a>
1818
</li>
1919
<li class="dropdown">
2020
<a class="dropdown-toggle" data-toggle="dropdown" title="Documentation on how to use ev3dev">
@@ -23,26 +23,26 @@
2323
</a>
2424
<ul class="dropdown-menu">
2525
<li>
26-
<a href="{{ site.github.url }}/docs/getting-started">Getting Started</a>
26+
<a href="/docs/getting-started">Getting Started</a>
2727
</li>
2828
<li>
29-
<a href="{{ site.github.url }}/docs/tutorials">Tutorials</a>
29+
<a href="/docs/tutorials">Tutorials</a>
3030
</li>
3131
<li role="separator" class="divider"></li>
3232
<li>
33-
<a href="{{ site.github.url }}/docs/motors">Motors</a>
33+
<a href="/docs/motors">Motors</a>
3434
</li>
3535
<li>
36-
<a href="{{ site.github.url }}/docs/sensors">Sensors</a>
36+
<a href="/docs/sensors">Sensors</a>
3737
</li>
3838
<li role="separator" class="divider"></li>
3939
<li>
40-
<a href="{{ site.github.url }}/docs">More...</a>
40+
<a href="/docs">More...</a>
4141
</li>
4242
</ul>
4343
</li>
4444
<li>
45-
<a href="{{ site.github.url }}/news" title="News about ev3dev">News</a>
45+
<a href="/news" title="News about ev3dev">News</a>
4646
</li>
4747
<li class="dropdown">
4848
<a class="dropdown-toggle" data-toggle="dropdown">
@@ -51,16 +51,16 @@
5151
</a>
5252
<ul class="dropdown-menu">
5353
<li>
54-
<a href="{{ site.github.url }}/projects" title="Discover projects that use ev3dev">Projects</a>
54+
<a href="/projects" title="Discover projects that use ev3dev">Projects</a>
5555
</li>
5656
<li>
57-
<a href="{{ site.github.url }}/share" title="Share projects that use ev3dev">Share</a>
57+
<a href="/share" title="Share projects that use ev3dev">Share</a>
5858
</li>
5959
<li>
60-
<a href="{{ site.github.url }}/contribute" title="How to contribute to ev3dev">Contribute</a>
60+
<a href="/contribute" title="How to contribute to ev3dev">Contribute</a>
6161
</li>
6262
<li>
63-
<a href="{{ site.github.url }}/support" title="Found a bug? Have a question?">Get Help</a>
63+
<a href="/support" title="Found a bug? Have a question?">Get Help</a>
6464
</li>
6565
</ul>
6666
</li>

_includes/inline-screenshot.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="screenshot inline-screenshot pull-right">
2-
<a href="{{ site.github.url }}{{ include.source }}">
3-
<img src="{{ site.github.url }}{{ include.source }}" />
2+
<a href="{{ include.source }}">
3+
<img src="{{ include.source }}" />
44
</a>
55
<p>
66
<small>

_includes/screenshot.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
source: The url of the image
88
caption: (optional) A caption that is displayed under the image.
99

10-
{% endcomment %}{% assign url = include.source %}{% assign first_char = url | first %}{%if first == '/' %}{% assign url = site.github.url | append: url %}{% endif %}<span class="screenshot"><a href="{{ site.github.url }}{{ include.source }}"><img src="{{ url }}" alt="screenshot" class="img-responsive" /></a>{% if include.caption %}<p><small>{{ include.caption }}</small></p>{% endif %}</span>
10+
{% endcomment %}<span class="screenshot"><a href="{{ include.source }}"><img src="{{ include.source }}" alt="screenshot" class="img-responsive" /></a>{% if include.caption %}<p><small>{{ include.caption }}</small></p>{% endif %}</span>

_includes/title.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h1>
1717
{% if edit_path %}
1818
<a class="btn btn-primary pull-right" href="{{ edit_path }}">Edit on Github</a>
1919
{% elsif show_news_link %}
20-
<a class="btn btn-primary pull-right" href="{{ site.github.url }}/news/atom.xml">Subscribe via Atom</a>
20+
<a class="btn btn-primary pull-right" href="/news/atom.xml">Subscribe via Atom</a>
2121
{% endif %}
2222
</h1>
2323
</div>

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ First, here are the things you need before starting:
3434
The instructions on this page only apply to releases dated December
3535
2015 or later. Older releases are no longer supported. There are many major changes
3636
in the December release, so if something seems broken or the documentation seems incorrect,
37-
please [open an issue on GitHub]({{ site.github.url }}/support){: .alert-link}.
37+
please [open an issue on GitHub](/support){: .alert-link}.
3838
{: .alert .alert-warning}
3939

4040
## Step 1: Download the latest ev3dev image file

docs/sensors/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,12 @@ kernel.
201201
[LEGO 8528]: http://www.bricklink.com/catalogItem.asp?S=8528-1
202202
[I2C protocol]: https://en.wikipedia.org/wiki/I2c
203203
[I2C Sensor Addressing]: i2c-sensor-addressing
204-
[lego-port class]: http://www.ev3dev.org/docs/drivers/lego-port-class
204+
[lego-port class]: /docs/drivers/lego-port-class
205205
[Using I2C Sensors]: using-i2c-sensors
206206
[UART]: https://en.wikipedia.org/wiki/Uart
207207
[using-uart-sensors-on-any-linux]: http://lechnology.com/2014/09/using-uart-sensors-on-any-linux/
208208
[opening an issue]: https://github.com/ev3dev/ev3dev/issues
209-
[contributing page]: http://www.ev3dev.org/contributing/
209+
[contributing page]: /contributing/
210210
[lego-sensor class]: /docs/drivers/lego-sensor-class
211211
[EV3 Input Port Driver]: /docs/ports/legoev3-input-port
212212
[Supported Sensors]: #supported-sensors

docs/tutorials/adding-new-project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ to submit your changes.
132132
The project maintainers will be notified automatically that you have submitted
133133
edits, and will review and merge your changes when they get the chance.
134134

135-
[projects page]: {{ site.github.url }}/projects
135+
[projects page]: /projects
136136
[mindsensor.com]: http://mindsensors.com/
137137
[projects folder]: https://github.com/ev3dev/ev3dev.github.io/tree/master/projects/_posts
138138
[kramdown basics]: http://kramdown.gettalong.org/quickref.html
139139
[template project]: https://github.com/ev3dev/ev3dev.github.io/blob/master/projects/_posts/2014-03-21-Example-Project.md
140-
[template page]: http://www.ev3dev.org/projects/2014/03/21/Example-Project/
140+
[template page]: /projects/2014/03/21/Example-Project/
141141
[raw template]: https://raw.githubusercontent.com/ev3dev/ev3dev.github.io/master/projects/_posts/2014-03-21-Example-Project.md
142142
[website repository]: http://github.com/ev3dev/ev3dev.github.io
143143
[the readme]: https://github.com/ev3dev/ev3dev.github.io

0 commit comments

Comments
 (0)