Skip to content

Commit b18f742

Browse files
committedFeb 1, 2014
adding gallery support, download page support.
1 parent d28c283 commit b18f742

File tree

9 files changed

+77
-3
lines changed

9 files changed

+77
-3
lines changed
 

‎_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ author :
1515
email : starstructor@gmail.com
1616
github : Starstructor
1717

18+
gallery :
19+
- http://i.imgur.com/1Eu7C4k.png
20+
- http://i.imgur.com/TwLGnmF.png
21+
- http://i.imgur.com/xzM69M2.png
22+
1823
# The production_url is only used when full-domain names are needed
1924
# such as sitemap.txt
2025
# Most places will/should use BASE_PATH to make the urls

‎_includes/gallery

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% assign gallery = site.gallery %}
2+
3+
<div id="screenshots" class="container">
4+
{% for picture in gallery %}
5+
<a href="{{ picture }}"><img class="screenshot" src="{{ picture }}" alt="Screenshot" style="width: 30%;height: 5%" /></a>
6+
{% endfor %}
7+
</div>

‎_includes/stable_downloads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% get_tags %}

‎_includes/themes/twitter/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</head>
3535

3636
<body>
37-
<header class="navbar navbar-inverse">
37+
<header id="header" class="navbar navbar-inverse">
3838
<div class="navbar-inner">
3939
<div class="container-narrow">
4040
<a class="brand" href="{{ HOME_PATH }}">{{ site.title }}</a>

‎_plugins/github_api.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require 'net/http'
2+
require 'openssl'
3+
require 'json'
4+
5+
module Jekyll
6+
class GetTags < Liquid::Tag
7+
def initialize(tag_name, text, tokens)
8+
super
9+
10+
uri = URI('https://api.github.com/repos/Starstructor/starstructor/tags')
11+
12+
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
13+
request = Net::HTTP::Get.new uri
14+
response = http.request request
15+
@json_obj = JSON.parse response.body
16+
end
17+
end
18+
19+
def render(context)
20+
@json_obj.each do |tag|
21+
%|<li>Download #{tag['name']} (<a href='#{tag['zipball_url']}'>ZIP</a> \| <a href='#{tag['tarball_url']}'>TAR</a>)</li>|
22+
end
23+
end
24+
end
25+
end
26+
27+
Liquid::Template.register_tag('get_tags', Jekyll::GetTags)

‎_plugins/youtube.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require 'uri'
2+
require 'cgi'
3+
4+
module Jekyll
5+
class YouTubeTag < Liquid::Tag
6+
def initialize(tag_name, video_url, tokens)
7+
super
8+
query = URI::parse(video_url).query
9+
params = CGI::parse(query)
10+
@vid = params["v"][0]
11+
end
12+
13+
def render(context)
14+
%|<iframe width="560" height="315" src="http://www.youtube.com/embed/#{@vid}" frameborder="0" allowfullscreen></iframe>|
15+
end
16+
end
17+
end
18+
19+
Liquid::Template.register_tag('youtube', Jekyll::YouTubeTag)

‎assets/themes/twitter/css/style.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ body {
44
color: #EEE;
55
}
66

7+
header#header {
8+
width: 100%;
9+
}
10+
711
section#mainContainer {
812
border-radius: 5px;
913
background-color: #000;
@@ -12,6 +16,14 @@ section#mainContainer {
1216
padding: 5px;
1317
}
1418

19+
div#screenshots {
20+
21+
}
22+
23+
img.screenshot {
24+
margin: 5px;
25+
}
26+
1527
/* Custom container */
1628
.container-narrow {
1729
margin: 0 auto;

‎downloads.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
<div id="downloads">
88
<h5>Releases (stable)</h5>
99
<ul id="stable">
10-
<li>At some point, I will try to utilize the github api to fetch all tags.</li>
10+
<!--{% get_tags %} this does not work on github pages due to jekyll's --safe option.-->
11+
<li>Download 0.7.5145.12730 (<a href='https://api.github.com/repos/Starstructor/starstructor/zipball/0.7.5145.12730'>ZIP</a> | <a href='https://api.github.com/repos/Starstructor/starstructor/tarball/0.7.5145.12730'>TAR</a>)</li>
12+
<li>Download 0.7.5145.7246 (<a href='https://api.github.com/repos/Starstructor/starstructor/zipball/0.7.5145.7246'>ZIP</a> | <a href='https://api.github.com/repos/Starstructor/starstructor/tarball/0.7.5145.7246'>TAR</a>)</li>
13+
<li>Download v0.7.5143.8266 (<a href='https://api.github.com/repos/Starstructor/starstructor/zipball/v0.7.5143.8266'>ZIP</a> | <a href='https://api.github.com/repos/Starstructor/starstructor/tarball/v0.7.5143.8266'>TAR</a>)</li>
1114
</ul>
1215

1316
<h5>Unstable</h5>

‎gallery.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
title: Gallery
55
group: navigation
66
---
7-
The Gallery
7+
{% include gallery %}

0 commit comments

Comments
 (0)
Please sign in to comment.