Skip to content

Commit

Permalink
Document all the work on Tapir.
Browse files Browse the repository at this point in the history
  • Loading branch information
belkadan committed Mar 24, 2012
1 parent c5657e9 commit bc6ff5e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This is a theme for the [Jekyll][] site generator which supports the following c
- Post directories. Instead of naming your post `YYYY-MM-DD-Title.md`, you can make a directory named `YYYY-MM-DD-Title/` and anything inside it will be copied to the proper place. (You probably want to put an `index.markdown` or `index.textile` inside that folder.)

You may want to install the [ptools][] gem so that Shadowbox can guess if a file is binary and shouldn't be processed by Liquid.
- An "everything" archive page with live (client-side) search on the content. (This probably won't scale but that's not my problem right now. \*grin\*)
- Search, via [Tapir][].

It is designed so that new users should have to edit as few files as possible:

Expand All @@ -45,6 +45,7 @@ Created by Jordy Rose
[htmlentities]: http://htmlentities.rubyforge.org
[dependencies]: https://github.com/belkadan/jekyll
[ptools]: http://rubygems.org/gems/ptools
[Tapir]: http://tapirgo.com
[jdg]: https://github.com/josegonzalez/josediazgonzalez.com/tree/master/_plugins
[em]: https://github.com/jqr/jqr.github.com

Expand Down
8 changes: 8 additions & 0 deletions _plugins/export_to_tapir.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/ruby -rubygems

# This script is for new users signing up for Tapir who want to use the Tapir's
# article push feature rather than temporarily generating a full newsfeed and
# waiting for Tapir's import to complete. See tapir.yml for details.
#
# This is NOT actually a Jekyll plugin..._plugins/ just seemed like the best place to put it.

if $0 == __FILE__
require 'net/http'
require 'uri'
Expand All @@ -18,6 +24,8 @@
$stdout.sync = true
YAML.each_document(ARGF) do |post|
raise 'Input file should be generated from tapir.yml' unless post.is_a? Hash
# Someone's going to try to feed the template in here...
raise 'Input file should be GENERATED from tapir.yml' unless post['published_on']

req = Net::HTTP::Post.new(url_path)
# Tapir.yml is already CGI-escaped...possibly a stupid decision, but w/e.
Expand Down
20 changes: 19 additions & 1 deletion tapir.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
---
dependencies: news
# This YAML section is NOT part of the file content, it's a header for Jekyll!
# This file is used with the export_to_tapir.rb script, found under _plugins.
# It is for new users signing up for Tapir who want to use the Tapir's article
# push feature rather than temporarily generating a full newsfeed and waiting
# for Tapir's import to complete. To do this:
#
# Step 1: Remove tapir.yml from _config.yml's excludes.
# Step 2: Generate your site. Make sure this is using your live site's baseurl.
# Step 3: Run the export_to_tapir script as follows:
# _plugins/export_to_tapir.rb <your_tapir_secret_key> path/to/generated/tapir.yml
# Step 4: Wait. There's a delay of 0.2s per post so that Tapir doesn't think we're DoSing them.
# Step 5: Put tapir.yml back in _config.yml's excludes.
#
# You should only have to do this once, since Tapir watches your newsfeed for any new posts.
#
# Note that this only causes Tapir to index /news/ posts. If you want /everything/
# on your site indexed, not only will you have to change the for-loop below, but
# you'll have to provide another newsfeed that doesn't just show news-posts.
#
# BTW, this YAML section is NOT part of the file content, it's a header for Jekyll!
---
{% for post in site.news_posts %}
---
Expand Down

0 comments on commit bc6ff5e

Please sign in to comment.