Introductionary blog example for jekyll-assets plugin.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_assets Update Jekyll and Jekyll::Assets to latest versions May 4, 2017
_layouts Add funky search by tags functionality Jan 6, 2013
_plugins
_posts Initial commit Jan 6, 2013
.gitignore Initial commit Jan 6, 2013
Gemfile Update Jekyll and Jekyll::Assets to latest versions May 4, 2017
Gemfile.lock Update Jekyll and Jekyll::Assets to latest versions May 4, 2017
LICENSE
README.md Initial commit Jan 6, 2013
_config.yml Update Jekyll and Jekyll::Assets to latest versions May 4, 2017
index.html Install jekyll-assets and improve styles Jan 6, 2013

README.md

Jekyll-Assets Introduction

This is an example blog for jekyll-assets intro tutorial. Posts were autogenerated using Bluth Ipsum service and following tiny script:

require 'rubygems'
require 'nokogiri'
require 'curb'
require 'yaml'




class Post
  TAGS = %w{ jekyll assets tutorial demo blog }

  attr_reader :date

  def initialize date
    @date = date
  end

  def text
    unless @text
      html = Nokogiri::HTML Curl.get("http://bluthipsum.com/").body_str
      @text = html.css("#main").text.gsub(/\r/, '')
    end

    @text
  end

  def reset!
    @text = nil
  end

  def title
    text.split(/\W+/).first(8).join(" ").sub(/\.*$/, '.')
  end

  def tags
    text.split(/\W+/).first(100).concat(TAGS)
      .map { |t| t.downcase }
      .select { |t| 2 < t.length }
      .uniq.shuffle.first(7)
  end

  def content
    YAML.dump({
      "layout"  => "post",
      "tags"    => tags,
      "title"   => title
    }) << "---\n\n" << text
  end

  def slug
    "#{date}-#{title}".downcase.gsub(/[^a-z0-9]+/, '-').gsub(/^-|-$/, '')
  end

  def filename
    "#{slug}.md"
  end

  def self.generate

  end
end


monthes = (1..12).to_a
days    = (1..29).to_a
titles  = []

42.times do
  post = Post.new("2012-#{"%02d" % monthes.sample}-#{"%02d" % days.sample}")

  # make sure title is unique
  post.reset! while titles.include? post.title.downcase
  titles << post.title.downcase

  puts post.filename
  File.open("_posts/#{post.filename}", "w"){ |io| io.puts post.content }
end

LICENSE

Sources of this example blog are free to use under terms of WTFPL.