Skip to content

Commit 1ea453a

Browse files
committed
use templates and inlcude files
Created include files for common parts of pages like menu, title, footer, etc. Also created template for project posts.
1 parent 5fd5083 commit 1ea453a

File tree

14 files changed

+145
-23
lines changed

14 files changed

+145
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
_site/
22
*.orig
33
*~
4+
*.lock

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gem 'github-pages'

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ You can view your changes locally by installing [jekyll](http://jekyllrb.com/).
99

1010
In ubuntu 14.04:
1111

12-
sudo apt-get install git ruby1.9.1-dev nodejs
13-
sudo gem install jekyll
12+
sudo apt-get install git ruby2.0-dev nodejs
13+
sudo gem install bundle
1414
git clone git@github.com:<user>/ev3dev.github.io
1515
cd ev3dev.github.io
16-
jekyll serve &
16+
bundle install
17+
bundle exec jekyll serve --watch &
1718
www-browser http://localhost:4000 &
1819
# work, work, work
19-
jekyll build
20-
# refresh browser
21-
# repeat until satisfied
22-
git commit -am "<describe your changes here>"
23-
git push
2420

2521
Alternately, when forking, you can create a new branch called `gh-pages`, then your
2622
changes can be viewed as `http://<user>.github.io/ev3dev.github.io`. When you do this

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
permalink: pretty
12
exclude: [README.md]
3+
24
gems:
35
- jekyll-mentions

_includes/author-mention.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- Provides @mention function for author_mention variable -->
2+
3+
{% assign authors = author_mention | split: ' ' %}
4+
{% for author in authors %}
5+
{% assign author_no_at_sign = author | strip_html | remove_first: "@" %}
6+
{% assign at_sign = author | strip_html | replace: author_no_at_sign %}
7+
<!-- first function does not work and truncate function returns trailing "..." -->
8+
{% assign test_at_sign_is_first = author | truncate: 4 | replace: "@" | size %}
9+
<!-- this looks weird, but it was the only way I could figure out how to test
10+
that the first character of author is "@" -->
11+
{% if at_sign.size > 0 and test_at_sign_is_first == 3 %}
12+
<a href="https://github.com/{{ author_no_at_sign }}">{{ author }}</a>
13+
{% else %}
14+
{{ author }}
15+
{% endif %}
16+
{% endfor %}

_includes/header.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<div id="header">
22
<nav>
3-
<li class="home"><a href="/">Home</a></li>
4-
<li class="projects"><a href="/projects">Projects That Use ev3dev</a></li>
3+
<li class="home">
4+
<a href="/" title="There's no place like Home...">Home</a>
5+
</li>
6+
<li class="projects">
7+
<a href="/projects" title="List of projects that use ev3dev">Projects Gallery</a>
8+
</li>
59
<!-- items below float right, so appear in reverse order -->
6-
<li class="issues"><a href="https://github.com/mindboards/ev3dev/issues">Issues</a></li>
7-
<li class="wiki"><a href="https://github.com/mindboards/ev3dev/wiki">Wiki</a></li>
8-
<li class="wiki"><a href="https://github.com/mindboards/ev3dev/releases">Download</a></li>
10+
<li class="issues">
11+
<a href="https://github.com/ev3dev/ev3dev/issues" title="Found a bug? Report it here.">Issues</a>
12+
</li>
13+
<li class="wiki">
14+
<a href="https://github.com/ev3dev/ev3dev/wiki" title="Useful info on how to use ev3dev">Wiki</a>
15+
</li>
16+
<li class="otherPlaces">
17+
<a href="https://github.com/ev3dev/ev3dev/releases" title="SD card image files">Download</a>
18+
</li>
919
</nav>
1020
</div>
1121

_includes/title.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="title">
22
<div id="logoContainer">
3-
<a href="index.html">
3+
<a href="/">
44
<img id="logo" src="https://avatars3.githubusercontent.com/u/6878323?s=140" />
55
</a>
66
<div id="titleHeader" class="clear">

_layouts/project.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
3+
---
4+
<!doctype html>
5+
<html>
6+
{% include head.html %}
7+
<body>
8+
{% include header.html %}
9+
<div class="wrapper">
10+
<section>
11+
{% include title.html %}
12+
<div class="breadcrumbs">
13+
<a href="/projects">&lt; Back to Projects Gallery</a>
14+
</div>
15+
{{ content }}
16+
<br />
17+
<div id="project-credit">
18+
{% assign author_mention = page.author %}
19+
Posted by {% include author-mention.html %} on {{ page.date | date_to_string }}
20+
</div>
21+
</section>
22+
{% include footer.html %}
23+
</div>
24+
</body>
25+
</html>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
author: "@cavenel"
3+
layout: project
4+
category: projects
5+
---
6+
7+
You can find a demo of the robot using the rubiks cube example here:
8+
<iframe width="560" height="315" src="//www.youtube.com/embed/HuKsfp19yF0" frameborder="0" allowfullscreen="1" > </iframe><br />
9+
10+
11+
The model is based on [mindcub3r](http://www.mindcuber.com/mindcub3r/mindcub3r.html), from David Gilday.
12+
13+
I have two different solving algorithms, one is running on the brick and gives a solution in around 60 steps ([source](http://cubex.sourceforge.net/)). The other one gives a solution in around 20 steps, but takes around 500 MB of memory, so I need to run it on a computer ([source](http://www.cube20.org/src/)).
14+
15+
You can find the code in my [git repository](https://github.com/cavenel/ev3dev_examples).
16+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
author: "@G33kDude and @dlech"
3+
layout: project
4+
category: projects
5+
---
6+
7+
This is still a work in progress. It is a Segway-style balancing robot based on
8+
the [HTWay](http://www.hitechnic.com/blog/gyro-sensor/htway/). You can control
9+
it with the EV3 IR Remote/Sensor.
10+
11+
Interesting features:
12+
13+
* Uses udev to enumerate sensors and motors. Sensors and motors can be plugged
14+
into any port without any configuration changes.
15+
* Can use either the EV3 Gyro sensor or the HiTechnic Gyro sensor. The gyro
16+
sensor type is automatically detected, so you don't have to make any
17+
configuration changes.
18+
19+
TODO: Update for new motor ABI, make a video, building instructions,
20+
Wiimote control, smartphone control, and more...
21+
22+
![ev3dev HTWay](https://dl.dropbox.com/s/gdrb1uk3uy20anu/Gyro_Bot5.png)
23+
24+
Code is [here](https://gist.github.com/dlech/11098915).

0 commit comments

Comments
 (0)