Skip to content

Commit 2676fa2

Browse files
committed
Improve index page
1 parent 3ea15fa commit 2676fa2

File tree

505 files changed

+48592
-4
lines changed

Some content is hidden

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

505 files changed

+48592
-4
lines changed

Vendorfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from "git://github.com/aucor/jekyll-plugins.git" do
2+
file "_plugins/strip_tag.rb", "strip.rb"
3+
end
4+
5+
from "git://github.com/lipis/flag-icon-css.git" do
6+
file "_sass/_flags.scss", "css/flag-icon.css"
7+
folder "flags", "flags"
8+
end

_plugins/date_to_pretty_filter.rb

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module Jekyll
2+
module DateToPrettyFilter
3+
def date_to_pretty(input)
4+
date = Time.at(input)
5+
now = Time.now
6+
7+
if now - date <= 43200
8+
date.strftime("%H:%M")
9+
elsif now.year == date.year && now.month == date.month && now.day == date.day
10+
date.strftime("%H:%M")
11+
elsif now.year == date.year && now.month == date.month && now.day == date.day + 1
12+
"Yesterday"
13+
elsif now.year == date.year
14+
date.strftime("%e %B")
15+
else
16+
date.strftime("%e %B %Y")
17+
end
18+
end
19+
end
20+
end
21+
22+
Liquid::Template.register_filter(Jekyll::DateToPrettyFilter)

_plugins/strip_tag.rb

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Replaces multiple newlines and whitespace
2+
# between them with one newline
3+
4+
module Jekyll
5+
class StripTag < Liquid::Block
6+
7+
def render(context)
8+
super.gsub /\n\s*\n/, "\n"
9+
end
10+
11+
end
12+
end
13+
14+
Liquid::Template.register_tag('strip', Jekyll::StripTag)

0 commit comments

Comments
 (0)