Skip to content

Commit 4b73664

Browse files
committed
Add the news collection with emoji support. Restructure assets.
1 parent ecafb65 commit 4b73664

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+825
-28
lines changed

_config.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ paginate_path: /blog/page:num/
2525
# Includes
2626
include: ['_pages']
2727

28+
# Emoji support
29+
emoji_dir: /assets/img/emoji
30+
2831
# Collections
2932
collections:
33+
news:
34+
defaults:
35+
layout: post
36+
output: true
37+
permalink: /news/:path/
3038
projects:
3139
output: true
3240
permalink: /projects/:path/
@@ -56,6 +64,6 @@ scholar:
5664

5765
query: "@*"
5866

59-
# Advanced (don't if you are not sure what it is)
67+
# Advanced (don't touch if you are not sure what it is)
6068
jquery_version: "1.11.1"
6169
katex_version: "0.1.1"

_includes/head.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>{{ site.name }}{% if page.title and page.url != "/" %} | {{ page.title }}{% endif %}</title>
77
<meta name="description" content="{{ site.description }}">
88

9-
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
9+
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/main.css">
1010
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
1111

1212
<!-- Load jQuery -->
@@ -15,6 +15,6 @@
1515
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/{{ site.katex_version }}/katex.min.css">
1616
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/{{ site.katex_version }}/katex.min.js"></script>
1717

18-
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
19-
<link rel="stylesheet" href="{{ site.baseurl }}/css/academicons.css">
18+
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/font-awesome.min.css">
19+
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/academicons.css">
2020
</head>

_includes/news.html

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
<div class="news">
22
<h2>news</h2>
3+
{% if site.news %}
4+
<table>
5+
{% for item in site.news %}
6+
<tr>
7+
<td class="date">{{ item.date | date: "%B %-d, %Y" }}</td>
8+
<td class="announcement">
9+
{% if item.inline %}
10+
{{ item.content | remove: '<p>' | remove: '</p>' | emojify }}
11+
{% else %}
12+
<a class="news-title" href="{{ item.url | prepend: site.baseurl }}">{{ item.title }}</a>
13+
{% endif %}
14+
</td>
15+
</tr>
16+
{% endfor %}
17+
</table>
18+
{% else %}
19+
<p>No news so far...</p>
20+
{% endif %}
321
</div>

_layouts/about.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% if page.profile %}
66
<div class="profile col one {{ page.profile.align }}">
77
{% if page.profile.image %}
8-
<img class="one" src="/img/{{ page.profile.image }}">
8+
<img class="one" src="/assets/img/{{ page.profile.image }}">
99
{% endif %}
1010
{% if page.profile.address %}
1111
<div class="address">

_layouts/default.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
{% include footer.html %}
1818

19-
<script src="{{ site.baseurl }}/js/katex.js"></script>
19+
<script src="{{ site.baseurl }}/assets/js/katex.js"></script>
2020

2121
</body>
2222

_layouts/post.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<header class="post-header">
77
<h1 class="post-title">{{ page.title }}</h1>
8-
<p class="post-meta">{{ page.date | date: "%B %-d, %Y — %H:%M" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
8+
<p class="post-meta">{{ page.date | date: "%B %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
99
</header>
1010

1111
<article class="post-content">

_news/announcement_1.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: post
3+
date: 2015-10-22 15:59:00-0400
4+
inline: true
5+
---
6+
7+
A simple inline announcement.

_news/announcement_2.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
layout: post
3+
title: A long announcement with details
4+
date: 2015-10-22 15:59:00-0400
5+
inline: false
6+
---
7+
8+
Announcements and news can be much longer than just quick inline posts. In fact, they can have all the features available for the standard blog posts. See below.
9+
10+
***
11+
12+
Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptown vinyl kitsch. Four loko meh 8-bit, tousled banh mi tilde forage Schlitz dreamcatcher twee 3 wolf moon. Chambray asymmetrical paleo salvia, sartorial umami four loko master cleanse drinking vinegar brunch. <a href="https://www.pinterest.com" target="blank">Pinterest</a> DIY authentic Schlitz, hoodie Intelligentsia butcher trust fund brunch shabby chic Kickstarter forage flexitarian. Direct trade <a href="https://en.wikipedia.org/wiki/Cold-pressed_juice" target="blank">cold-pressed</a> meggings stumptown plaid, pop-up taxidermy. Hoodie XOXO fingerstache scenester Echo Park. Plaid ugh Wes Anderson, freegan pug selvage fanny pack leggings pickled food truck DIY irony Banksy.
13+
14+
#### Hipster list
15+
<ul>
16+
<li>brunch</li>
17+
<li>fixie</li>
18+
<li>raybans</li>
19+
<li>messenger bag</li>
20+
</ul>
21+
22+
Hoodie Thundercats retro, tote bag 8-bit Godard craft beer gastropub. Truffaut Tumblr taxidermy, raw denim Kickstarter sartorial dreamcatcher. Quinoa chambray slow-carb salvia readymade, bicycle rights 90's yr typewriter selfies letterpress cardigan vegan.
23+
24+
<hr>
25+
<br/>
26+
Pug heirloom High Life vinyl swag, single-origin coffee four dollar toast taxidermy reprehenderit fap distillery master cleanse locavore. Est anim sapiente leggings Brooklyn ea. Thundercats locavore excepteur veniam eiusmod. Raw denim Truffaut Schlitz, migas sapiente Portland VHS twee Bushwick Marfa typewriter retro id keytar.
27+
28+
<blockquote>
29+
We do not grow absolutely, chronologically. We grow sometimes in one dimension, and not in another, unevenly. We grow partially. We are relative. We are mature in one realm, childish in another.
30+
—Anais Nin
31+
</blockquote>
32+
33+
Fap aliqua qui, scenester pug Echo Park polaroid irony shabby chic ex cardigan church-key Odd Future accusamus. Blog stumptown sartorial squid, gastropub duis aesthetic Truffaut vero. Pinterest tilde twee, odio mumblecore jean shorts lumbersexual.

_news/announcement_3.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: post
3+
date: 2015-10-22 16:59:00-0400
4+
inline: true
5+
---
6+
7+
A simple inline announcement with Markdown emoji! :sparkles: :smile:

_plugins/emoji.rb

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Jekyll Emoji
2+
#
3+
# Chris Kempson (http://chriskempson.com)
4+
# https://github.com/chriskempson/jekyll-emoji
5+
#
6+
# A jekyll plug-in that provides a Liquid filter for emojifying text with
7+
# https://github.com/github/gemoji. See http://www.emoji-cheat-sheet.com for
8+
# a full listing of emoji codes.
9+
#
10+
# Installation:
11+
# - Run `gem install gemoji` or add `gem 'gemoji'` to your gemfile and run `bundle install`
12+
# - Copy this file to your `_plugins` directory
13+
# - Add a line like `emoji_dir: images/emoji` to your `_config.yml`
14+
# - If you want to use external source for emoji, set `emoji_dir: http://...` to your `_config.yml`.
15+
#
16+
# Usage:
17+
# - Apply the filter wherever needed e.g. {{ content | emojify }}
18+
# - Add some emoji to your article! e.g. "Hello :wink:"
19+
20+
require 'gemoji'
21+
22+
module Jekyll
23+
24+
module EmojiFilter
25+
26+
def emojify(content)
27+
return false if !content
28+
29+
config = @context.registers[:site].config
30+
if config['emoji_dir']
31+
emoji_dir = config['emoji_dir']
32+
end
33+
34+
content.to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
35+
if Emoji.find_by_alias($1) and emoji_dir
36+
'<img alt="' + $1 + '" src="' + emoji_dir + "/#{$1}.png" + '" class="emoji" />'
37+
else
38+
match
39+
end
40+
end
41+
end
42+
43+
end
44+
45+
class EmojiGenerator < Generator
46+
def generate(site)
47+
config = site.config
48+
return false if not config['emoji_dir']
49+
return false if config['emoji_dir'].start_with?('http')
50+
emoji_dir = File.join(config['source'], config['emoji_dir'])
51+
return false if File.exist?(File.join(emoji_dir, 'smiley.png'))
52+
53+
puts " Copying: Emoji from Gemoji to " + config['emoji_dir']
54+
55+
# Make Emoji directory
56+
FileUtils.mkdir_p(emoji_dir)
57+
58+
# Copy Gemoji files
59+
unicode_emoji_dir = File.join(Emoji.images_path, 'emoji')
60+
Emoji.all.each do |em|
61+
# Use the name rather than the unicode character
62+
FileUtils.cp File.join(unicode_emoji_dir, em.image_filename), File.join(emoji_dir, em.name + '.png')
63+
end
64+
end
65+
end
66+
67+
end
68+
69+
Liquid::Template.register_filter(Jekyll::EmojiFilter)

_posts/2015-03-15-formatting-and-links.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptow
1414
<li>messenger bag</li>
1515
</ul>
1616

17-
Hoodie Thundercats retro, tote bag 8-bit Godard craft beer gastropub. Truffaut Tumblr taxidermy, raw denim Kickstarter sartorial dreamcatcher. Quinoa chambray slow-carb salvia readymade, bicycle rights 90's yr typewriter selfies letterpress cardigan vegan.
17+
Hoodie Thundercats retro, tote bag 8-bit Godard craft beer gastropub. Truffaut Tumblr taxidermy, raw denim Kickstarter sartorial dreamcatcher. Quinoa chambray slow-carb salvia readymade, bicycle rights 90's yr typewriter selfies letterpress cardigan vegan.
1818

1919
<hr>
2020
<br/>
21-
Pug heirloom High Life vinyl swag, single-origin coffee four dollar toast taxidermy reprehenderit fap distillery master cleanse locavore. Est anim sapiente leggings Brooklyn ea. Thundercats locavore excepteur veniam eiusmod. Raw denim Truffaut Schlitz, migas sapiente Portland VHS twee Bushwick Marfa typewriter retro id keytar.
21+
Pug heirloom High Life vinyl swag, single-origin coffee four dollar toast taxidermy reprehenderit fap distillery master cleanse locavore. Est anim sapiente leggings Brooklyn ea. Thundercats locavore excepteur veniam eiusmod. Raw denim Truffaut Schlitz, migas sapiente Portland VHS twee Bushwick Marfa typewriter retro id keytar.
2222

2323
<blockquote>
24-
We do not grow absolutely, chronologically. We grow sometimes in one dimension, and not in another, unevenly. We grow partially. We are relative. We are mature in one realm, childish in another.
24+
We do not grow absolutely, chronologically. We grow sometimes in one dimension, and not in another, unevenly. We grow partially. We are relative. We are mature in one realm, childish in another.
2525
—Anais Nin
2626
</blockquote>
2727

28-
Fap aliqua qui, scenester pug Echo Park polaroid irony shabby chic ex cardigan church-key Odd Future accusamus. Blog stumptown sartorial squid, gastropub duis aesthetic Truffaut vero. Pinterest tilde twee, odio mumblecore jean shorts lumbersexual.
28+
Fap aliqua qui, scenester pug Echo Park polaroid irony shabby chic ex cardigan church-key Odd Future accusamus. Blog stumptown sartorial squid, gastropub duis aesthetic Truffaut vero. Pinterest tilde twee, odio mumblecore jean shorts lumbersexual.

_posts/2015-05-15-images.markdown

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ title: a post with images
44
date: 2015-05-15 21:01:00
55
description: this is what included images could look like
66
---
7-
Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptown vinyl kitsch. Fingerstache four loko meh 8-bit, tousled banh mi tilde forage Schlitz dreamcatcher twee 3 wolf moon. Chambray asymmetrical paleo salvia, sartorial umami four loko master cleanse drinking vinegar brunch.
7+
Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptown vinyl kitsch. Fingerstache four loko meh 8-bit, tousled banh mi tilde forage Schlitz dreamcatcher twee 3 wolf moon. Chambray asymmetrical paleo salvia, sartorial umami four loko master cleanse drinking vinegar brunch.
88

99
<div class="img_row">
10-
<img class="col three" src="/img/9.jpg">
10+
<img class="col three" src="/assets/img/9.jpg">
1111
</div>
1212
<div class="img_row">
13-
<img class="col three" src="{{ site.baseurl }}/img/9.jpg">
13+
<img class="col three" src="{{ site.baseurl }}/assets/img/9.jpg">
1414
</div>
1515
<div class="col three caption">
16-
A simple, elegant caption looks good between image rows, after each row, or doesn't have to be there at all.
16+
A simple, elegant caption looks good between image rows, after each row, or doesn't have to be there at all.
1717
</div>
1818
<div class="img_row">
19-
<img class="col two" src="/img/8.jpg">
20-
<img class="col one" src="/img/10.jpg">
19+
<img class="col two" src="/assets/img/8.jpg">
20+
<img class="col one" src="/assets/img/10.jpg">
2121
</div>
2222

2323
Slow-carb four dollar toast Helvetica pop-up. Kale chips next level literally trust fund Pitchfork. Jean shorts Pinterest beard, farm-to-table irony craft beer swag tofu 8-bit Banksy. Quinoa forage fanny pack, pug hashtag Echo Park heirloom Schlitz tote bag artisan Neutra mumblecore 90's shabby chic raw denim.
2424

2525

2626
<div class="img_row">
27-
<img class="col one" src="/img/11.jpg">
28-
<img class="col one" src="/img/12.jpg">
29-
<img class="col one" src="/img/7.jpg">
27+
<img class="col one" src="/assets/img/11.jpg">
28+
<img class="col one" src="/assets/img/12.jpg">
29+
<img class="col one" src="/assets/img/7.jpg">
3030
</div>

_posts/2015-07-15-code.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Produces something like this:
1414

1515
{% highlight c++ %}
1616

17-
int main(int argc, char const *argv[])
17+
int main(int argc, char const \*argv[])
1818
{
1919
string myString;
2020

_sass/_base.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ figcaption {
9393
font-size: $small-font-size;
9494
}
9595

96-
96+
img.emoji {
97+
height: 1em;
98+
}
9799

98100
/**
99101
* Lists
@@ -136,7 +138,7 @@ a {
136138
}
137139
}
138140

139-
article a {
141+
article a, .news a {
140142
color: $theme-color;
141143
font-weight: 100;
142144

_sass/_layout.scss

+9
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ display: line;
8888
border-top: 1px solid $grey-color-light;
8989
margin-top: 50px;
9090
padding-top: 20px;
91+
92+
h2 { margin-bottom: 10px; }
93+
table {
94+
border-collapse: collapse;
95+
width: 100%;
96+
97+
tr { text-align: left; }
98+
td { padding: 5px;}
99+
}
91100
}
92101

93102
/**

css/academicons.css renamed to assets/css/academicons.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
@font-face {
99
font-family: 'academicons';
10-
src:url('fonts/academicons.eot?qbqm87');
11-
src:url('fonts/academicons.eot?#iefixqbqm87') format('embedded-opentype'),
12-
url('fonts/academicons.ttf?qbqm87') format('truetype'),
13-
url('fonts/academicons.woff?qbqm87') format('woff'),
14-
url('fonts/academicons.svg?qbqm87#academicons') format('svg');
10+
src:url('/assets/fonts/academicons.eot?qbqm87');
11+
src:url('/assets/fonts/academicons.eot?#iefixqbqm87') format('embedded-opentype'),
12+
url('/assets/fonts/academicons.ttf?qbqm87') format('truetype'),
13+
url('/assets/fonts/academicons.woff?qbqm87') format('woff'),
14+
url('/assets/fonts/academicons.svg?qbqm87#academicons') format('svg');
1515
font-weight: normal;
1616
font-style: normal;
1717
}

assets/css/font-awesome.min.css

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

assets/fonts/FontAwesome.otf

104 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/fonts/fontawesome-webfont.eot

67.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)