Skip to content

Commit e79649e

Browse files
committed
Add ability to override project thumbnail
1 parent 109ae18 commit e79649e

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

projects/_posts/2014-03-21-Example-Project.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ author: [ "@wasabifan" ] # your GitHub user name
99
programming_language: "JavaScript" # The programming language used in this project
1010

1111
youtube_video_id: rrNaLfE9PWA # The video ID of the YouTube video to be displayed with this post
12+
# thumbnail_override: "/images/projects/my-project/my-image.png" # If you don't have a YouTube video (or the video thumbnail isn't good) you can uncomment this line to set your own image for the project.
1213

1314
project_homepage_url: "http://example.com/my-super-cool-project" # Homepage for this project
1415
source_code_url: "https://github.com/myuser/myrepo" # Provide a link to your code

projects/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@
2424
{% assign num_words = 60 %}
2525
<div class="col-xs-12 col-sm-6 col-md-4 project-thumbnail-container">
2626
<div class="thumbnail">
27-
{% if post.youtube_video_id %}
27+
{% if post.thumbnail_override %}
28+
{% assign num_words = 35 %}
29+
<a href="{{ post.url }}">
30+
<img src="{{post.thumbnail_override}}" alt="{{ post.title }}" />
31+
</a>
32+
{% elsif post.youtube_video_id %}
33+
2834
{% assign num_words = 35 %}
2935
<a href="{{ post.url }}">
3036
<img src="http://img.youtube.com/vi/{{post.youtube_video_id}}/mqdefault.jpg" alt="{{ post.title }}" />

stylesheets/page-content.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
.project-thumbnail-container {
99
img {
1010
margin-top: 15px;
11+
padding-left: 15px !important;
12+
padding-right: 15px !important;
1113
}
1214

1315
.caption {

0 commit comments

Comments
 (0)