Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Static Sites With Sculpin (TrueNorth PHP Novemb...

Static Sites With Sculpin (TrueNorth PHP November 2013)

Uncon talk about static sites, static site generators, and Sculpin.

Beau Simensen

November 09, 2013
Tweet

More Decks by Beau Simensen

Other Decks in Programming

Transcript

  1. • Jekyll (Octopress) — jekyllrb.com • Phrozn — phrozn.info •

    PieCrust — bolt80.com/piecrust • Sculpin — sculpin.io • ... too many to count beau.io/tnphp2013
  2. What Are Static Sites? • Plain ol’ HTML files •

    XML, JSON, CSS, etc • Assets • Not interpretted beau.io/tnphp2013
  3. Why Static Sites? • Few restrictions on server environment •

    Easy to deploy (scp, rsync, GitHub) • No database dependencies • Less things to break • Should absorb traffic bursts more easily beau.io/tnphp2013
  4. Why Built Yet Another Static Site Generator? • Not Invented

    Here is a hard habit to kick • Contributed to Jekyll and Octopress • Tried working with Phrozn • Somehow managed to miss PieCrust • Lurking in #symfony and #symfony-dev • Found Composer beau.io/tnphp2013
  5. Why Is Sculpin Special? • Symfony’s Kernel • React’s HTTP

    Server • Embedded Composer • Twig beau.io/tnphp2013
  6. --- layout: default --- # This is a markdown file

    with YAML frontmatter beau.io/tnphp2013
  7. --- layout: default --- # This is a markdown file

    with YAML frontmatter {% extends "default" %} {% block content %} # This is a markdown file with YAML frontmatter {% endblock %} beau.io/tnphp2013
  8. --- layout: default special_value: nice --- # This is a

    markdown file with YAML frontmatter beau.io/tnphp2013
  9. <html> {% if page.special_value is defined %} Special value exists

    and is <strong>{{ page.special_value }}</strong>!. {% endif %} {% block content %}Fallback content{% endblock %} </html> --- layout: default special_value: nice --- # This is a markdown file with YAML frontmatter beau.io/tnphp2013
  10. <html> {% if page.special_value is defined %} Special value exists

    and is <strong>{{ page.special_value }}</strong>!. {% endif %} {% block content %}Fallback content{% endblock %} </html> --- layout: default special_value: nice --- # This is a markdown file with YAML frontmatter beau.io/tnphp2013 <html> Special value exists and is <strong>nice</strong>!. <h1>This is a markdown file with YAML frontmatter</h1> </html>
  11. beau.io/tnphp2013 {% if page.full_title %} <title>{{ page.full_title|raw }}</title> {% else

    %} <title> {{ page.title }} &mdash; {{ site.title }} &mdash; {{ site.subtitle }} </title> {% endif %}