Initial blog setup

main
Thomas Quinot 10 years ago
parent 5080107cb9
commit 6c97f116a5

@ -14,6 +14,7 @@ group :development do
gem 'rubypants', '~> 0.2.0'
gem 'rb-fsevent', '~> 0.9'
gem 'stringex', '~> 1.4.0'
gem 'gemoji'
end
gem 'sinatra', '~> 1.4.2'

@ -16,7 +16,7 @@ deploy_branch = "gh-pages"
## -- Misc Configs -- ##
public_dir = "public" # compiled site directory
public_dir = "public/labnotes" # compiled site directory
source_dir = "source" # source file directory
blog_index_dir = 'source' # directory for your blog's index page (if you put your index in source/blog/index.html, set this to 'source/blog')
deploy_dir = "_deploy" # deploy directory (for Github pages deployment)

@ -2,10 +2,10 @@
# Main Configs #
# ----------------------- #
url: http://yoursite.com
title: My Octopress Blog
subtitle: A blogging framework for hackers.
author: Your Name
url: http://thomas.quinot.org/labnotes/
title: Thomas' Lab Notes
subtitle: Stuff worth not forgetting
author: Thomas Quinot
simple_search: https://www.google.com/search
description:
@ -16,7 +16,7 @@ description:
date_format: "ordinal"
# RSS / Email (optional) subscription links (change if using something like Feedburner)
subscribe_rss: /atom.xml
subscribe_rss: /labnotes/atom.xml
subscribe_email:
# RSS feeds can list your email address if you like
email:
@ -26,10 +26,10 @@ email:
# ----------------------- #
# If publishing to a subdirectory as in http://site.com/project set 'root: /project'
root: /
root: /labnotes
permalink: /blog/:year/:month/:day/:title/
source: source
destination: public
destination: public/labnotes
plugins: plugins
code_dir: downloads/code
category_dir: blog/categories
@ -99,3 +99,9 @@ google_analytics_tracking_id:
# Facebook Like
facebook_like: false
### Local configuration below
# 20141121 thomas
# Emoji
emoji_dir: labnotes/images/emoji

@ -4,11 +4,11 @@ require 'sass-globbing'
project_type = :stand_alone
# Publishing paths
http_path = "/"
http_images_path = "/images"
http_path = "/labnotes/"
http_images_path = "/labnotes/images"
http_generated_images_path = "/images"
http_fonts_path = "/fonts"
css_dir = "public/stylesheets"
http_fonts_path = "/labnotes/fonts"
css_dir = "public/labnotes/stylesheets"
# Local development paths
sass_dir = "sass"

@ -0,0 +1,69 @@
# Jekyll Emoji
#
# Chris Kempson (http://chriskempson.com)
# https://github.com/chriskempson/jekyll-emoji
#
# A jekyll plug-in that provides a Liquid filter for emojifying text with
# https://github.com/github/gemoji. See http://www.emoji-cheat-sheet.com for
# a full listing of emoji codes.
#
# Installation:
# - Run `gem install gemoji` or add `gem 'gemoji'` to your gemfile and run `bundle install`
# - Copy this file to your `_plugins` directory
# - Add a line like `emoji_dir: images/emoji` to your `_config.yml`
# - If you want to use external source for emoji, set `emoji_dir: http://...` to your `_config.yml`.
#
# Usage:
# - Apply the filter wherever needed e.g. {{ content | emojify }}
# - Add some emoji to your article! e.g. "Hello :wink:"
require 'gemoji'
module Jekyll
module EmojiFilter
def emojify(content)
return false if !content
config = @context.registers[:site].config
if config['emoji_dir']
if config['emoji_dir'].start_with?('http')
emoji_dir = config['emoji_dir']
else
emoji_dir = '/' + File.join(config['source'], config['emoji_dir'])
end
end
content.to_str.gsub(/(?<!\w):([a-z0-9\+\-_]+):/) do |match|
if Emoji.find_by_alias($1) and emoji_dir
'<img alt="' + $1 + '" src="' + config['emoji_dir'] + "/#{$1}.png" + '" class="emoji" />'
else
match
end
end
end
end
class EmojiGenerator < Generator
def generate(site)
config = site.config
return false if not config['emoji_dir']
return false if config['emoji_dir'].start_with?('http')
emoji_dir = File.join(config['source'], config['emoji_dir'])
return false if File.exist?(emoji_dir + '/smiley.png')
# Make Emoji directory
FileUtils.mkdir_p(emoji_dir)
# Copy Gemoji files
Dir["#{Emoji.images_path}/emoji/*.png"].each do |src|
FileUtils.cp src, emoji_dir
end
end
end
end
Liquid::Template.register_filter(Jekyll::EmojiFilter)
Loading…
Cancel
Save