Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Jekyll #425

Merged
merged 10 commits into from
Dec 12, 2013
Merged

Switch to Jekyll #425

merged 10 commits into from
Dec 12, 2013

Conversation

konklone
Copy link
Contributor

Switches to Jekyll, where HTML is generated upon deploy. Coming from a system powered by the DocumentUp API plus a compile.rb script, where HTML was frozen into the repo.

Changes:

  • New pygments theme, taken from MozMorrow/tomorrow-pygments. (.err class disabled, to allow for ellipses.)
  • Switched fenced code block syntax to Jekyll (Liquid) syntax, for Jekyll-level pygments highlighting.
  • TOC is now generated upon demand, but is generated in each page -- and then copied to the layout-level sidebar via JS upon page load. (Awful hack.)
  • Each page now has a tiny bit of YAML front-matter at the top, specifying the default layout.

I wrote a small adapt.rb script that can be run on all .md files in a directory to transform them from old to new style.

My hope is that someday, I can ditch the Jekyll highlight blocks and put the fenced code blocks back, either if:

I'd also like to ditch the JS hack for moving the TOC on-load from the content into the nav, by either:

  1. A custom, our-layout-specific post-processing Jekyll plugin that does this swapping at generate-time, using Nokogiri.
  2. Some sort of Jekyll plugin that allows whole HTML blocks to flow up to the layout (similar to Rails/Sinatra's content_for)
  3. Our base DocumentUp-adapted layout is reworked to allow the nav to be generated at the top of the file, but styled to the side like it is now.
  4. We break the nav into a beginning, an end, surrounding where the TOC would go, then use _includes for the beginning and end, and move the whole nav into the body of individual pages.

1 is my favorite, but it requires plugin support in GH Pages.

@konklone
Copy link
Contributor Author

This prophecy of #383 is being fulfilled here, You can read the details of my solution above, accompanied by a description of my tradeoffs, hopes, and dreams.

/cc @benbalter @adelevie

konklone added a commit that referenced this pull request Dec 12, 2013
@konklone konklone merged commit acca64a into propublica:gh-pages Dec 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant