Commits

Anonymous committed a689684

Added a (somewhat contrived) example site

Comments (0)

Files changed (22)

example-site/content/about.text

+title: About
+
+Made with [pilcrow](http://github.com/inky/pilcrow).

example-site/content/index.text

+template: home
+
+[About this site](/about)

example-site/content/lorem-ipsum.text

+title: Lorem ipsum
+date: 6 Dec 2009, 22:44 GMT
+
+Lorem ipsum.

example-site/content/whats-new.text

+title: What's new in Python 2.6
+date: October 1 2008
+
+This article explains the new features in Python 2.6, released on October 1
+2008. The release schedule is described in [PEP 361][pep361].
+
+The major theme of Python 2.6 is preparing the migration path to Python 3.0, a
+major redesign of the language. Whenever possible, Python 2.6 incorporates new
+features and syntax from 3.0 while remaining compatible with existing code by
+not removing older features or syntax. When it’s not possible to do that,
+Python 2.6 tries to do what it can, adding compatibility functions in a
+`future_builtins` module and a `-3` switch to warn about usages that will
+become unsupported in 3.0.
+
+Some significant new packages have been added to the standard library, such as
+the `multiprocessing` and `json` modules, but there aren’t many new features
+that aren’t related to Python 3.0 in some way.
+
+Python 2.6 also sees a number of improvements and bugfixes throughout the
+source. A search through the change logs finds there were 259 patches applied
+and 612 bugs fixed between Python 2.5 and 2.6. Both figures are likely to be
+underestimates.
+
+This article doesn’t attempt to provide a complete specification of the new
+features, but instead provides a convenient overview. For full details, you
+should refer to the documentation for Python 2.6. If you want to understand
+the rationale for the design and implementation, refer to the PEP for a
+particular new feature. Whenever possible, “What’s New in Python” links to the
+bug/patch item for each change.
+
+[pep361]: http://www.python.org/dev/peps/pep-0361

example-site/deploy/.htaccess

+DirectorySlash Off
+
+<Files .htaccess>
+    order allow,deny
+    deny from all
+</Files>
+
+<IfModule mod_rewrite.c>
+    RewriteEngine On
+    RewriteBase /
+
+    # rewrite /page.html to /page
+    RewriteCond %{REQUEST_FILENAME}.html -f
+    RewriteRule ^([a-zA-Z0-9/-]+)$ $1.html [QSA,L]
+</IfModule>

example-site/deploy/2008.html

+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Example Site: 2008</title>
+  <link rel="stylesheet" href="/style.css">
+</head>
+<body>
+  <div id="page">
+
+    <div id="header">
+      
+    <p><a href="/">Example Site</a></p>
+
+    </div>
+
+    <div id="body">
+      
+
+<ul>
+    <li>
+      <a href="/2008/whats-new">What's new in Python 2.6</a>
+      (1 Oct)
+    </li>
+</ul>
+
+    </div>
+
+    <div id="footer">
+      
+  <hr>
+  <p><a href="/">Home</a></p>
+
+    </div>
+
+  </div>
+</body>
+</html>

example-site/deploy/2008/whats-new.html

+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Example Site: What's new in Python 2.6</title>
+  <link rel="stylesheet" href="/style.css">
+</head>
+<body>
+  <div id="page">
+
+    <div id="header">
+      
+    <p><a href="/">Example Site</a></p>
+
+    </div>
+
+    <div id="body">
+      
+
+<h1>What's new in Python 2.6</h1>
+
+<p class="time" title="2008-10-01T00:00:00">
+   1 October 2008
+</p>
+
+<p>This article explains the new features in Python 2.6, released on October 1
+2008. The release schedule is described in <a href="http://www.python.org/dev/peps/pep-0361">PEP 361</a>.</p>
+<p>The major theme of Python 2.6 is preparing the migration path to Python 3.0, a
+major redesign of the language. Whenever possible, Python 2.6 incorporates new
+features and syntax from 3.0 while remaining compatible with existing code by
+not removing older features or syntax. When it’s not possible to do that,
+Python 2.6 tries to do what it can, adding compatibility functions in a
+<code>future_builtins</code> module and a <code>-3</code> switch to warn about usages that will
+become unsupported in 3.0.</p>
+<p>Some significant new packages have been added to the standard library, such as
+the <code>multiprocessing</code> and <code>json</code> modules, but there aren’t many new features
+that aren’t related to Python 3.0 in some way.</p>
+<p>Python 2.6 also sees a number of improvements and bugfixes throughout the
+source. A search through the change logs finds there were 259 patches applied
+and 612 bugs fixed between Python 2.5 and 2.6. Both figures are likely to be
+underestimates.</p>
+<p>This article doesn’t attempt to provide a complete specification of the new
+features, but instead provides a convenient overview. For full details, you
+should refer to the documentation for Python 2.6. If you want to understand
+the rationale for the design and implementation, refer to the PEP for a
+particular new feature. Whenever possible, “What’s New in Python” links to the
+bug/patch item for each change.</p>
+
+
+
+    </div>
+
+    <div id="footer">
+      
+  <hr>
+  <p><a href="/">Home</a></p>
+
+    </div>
+
+  </div>
+</body>
+</html>

example-site/deploy/2009.html

+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Example Site: 2009</title>
+  <link rel="stylesheet" href="/style.css">
+</head>
+<body>
+  <div id="page">
+
+    <div id="header">
+      
+    <p><a href="/">Example Site</a></p>
+
+    </div>
+
+    <div id="body">
+      
+
+<ul>
+    <li>
+      <a href="/2009/lorem-ipsum">Lorem ipsum</a>
+      (6 Dec)
+    </li>
+</ul>
+
+    </div>
+
+    <div id="footer">
+      
+  <hr>
+  <p><a href="/">Home</a></p>
+
+    </div>
+
+  </div>
+</body>
+</html>

example-site/deploy/2009/lorem-ipsum.html

+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Example Site: Lorem ipsum</title>
+  <link rel="stylesheet" href="/style.css">
+</head>
+<body>
+  <div id="page">
+
+    <div id="header">
+      
+    <p><a href="/">Example Site</a></p>
+
+    </div>
+
+    <div id="body">
+      
+
+<h1>Lorem ipsum</h1>
+
+<p class="time" title="2009-12-06T22:44:00+00:00">
+   6 December 2009
+</p>
+
+<p>Lorem ipsum.</p>
+
+
+
+    </div>
+
+    <div id="footer">
+      
+  <hr>
+  <p><a href="/">Home</a></p>
+
+    </div>
+
+  </div>
+</body>
+</html>

example-site/deploy/about.html

+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Example Site: About</title>
+  <link rel="stylesheet" href="/style.css">
+</head>
+<body>
+  <div id="page">
+
+    <div id="header">
+      
+    <p><a href="/">Example Site</a></p>
+
+    </div>
+
+    <div id="body">
+      
+
+<h1>About</h1>
+
+<p>Made with <a href="http://github.com/inky/pilcrow">pilcrow</a>.</p>
+
+    </div>
+
+    <div id="footer">
+      
+  <hr>
+  <p><a href="/">Home</a></p>
+
+    </div>
+
+  </div>
+</body>
+</html>

example-site/deploy/index.html

+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Example Site</title>
+  <link rel="stylesheet" href="/style.css">
+</head>
+<body>
+  <div id="page">
+
+    <div id="header">
+      
+    <h1><a href="/">Example Site</a></h1>
+
+    </div>
+
+    <div id="body">
+      
+
+<ul>
+    <li>
+      <a href="/2009/lorem-ipsum">Lorem ipsum</a>
+      (2009-Dec-06)
+    </li>
+    <li>
+      <a href="/2008/whats-new">What's new in Python 2.6</a>
+      (2008-Oct-01)
+    </li>
+</ul>
+
+<p><a href="/about">About this site</a></p>
+
+    </div>
+
+    <div id="footer">
+      
+  <hr>
+  <p><a href="/">Home</a></p>
+
+    </div>
+
+  </div>
+</body>
+</html>

example-site/deploy/robots.txt

+User-agent: *
+Disallow:

example-site/deploy/style.css

+body {
+  background: #eeeeee;
+  color: #000000;
+  font: 1em/1.5 'Helvetica Neue', Helvetica, Arial, sans-serif;
+  margin: 3em;
+}
+#page {
+  background: #ffffff;
+  border: 4px double #999999;
+  max-width: 36em;
+  padding: 2em 3em;
+}
+#footer {
+  border-top: 3px solid #cccccc;
+  margin-top: 3em;
+}
+#footer hr { display: none; }
+p.time {
+  color: #666666;
+  font-size: 0.9em;
+  text-transform: uppercase;
+}

example-site/files/.htaccess

+DirectorySlash Off
+
+<Files .htaccess>
+    order allow,deny
+    deny from all
+</Files>
+
+<IfModule mod_rewrite.c>
+    RewriteEngine On
+    RewriteBase /
+
+    # rewrite /page.html to /page
+    RewriteCond %{REQUEST_FILENAME}.html -f
+    RewriteRule ^([a-zA-Z0-9/-]+)$ $1.html [QSA,L]
+</IfModule>

example-site/files/robots.txt

+User-agent: *
+Disallow:

example-site/files/style.less

+@background: #fff;
+@text: #000;
+
+body {
+    background: @background - #111;
+    color: @text;
+    font: 1em/1.5 'Helvetica Neue', Helvetica, Arial, sans-serif;
+    margin: 3em;
+}
+
+#page {
+    background: @background;
+    border: 4px double (@background - #666);
+    max-width: 36em;
+    padding: 2em 3em;
+}
+
+#footer {
+    border-top: 3px solid (@background - #333);
+    margin-top: 3em;
+    hr { display: none; }
+}
+
+p.time {
+    color: #666;
+    font-size: 0.9em;
+    text-transform: uppercase;
+}

example-site/site.yml

+site_title: Example Site
+title_format: "%(site_title)s: %(title)s"
+root: /
+domain: "http://localhost/"

example-site/templates/_base.html

+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>${head_title}</title>
+  <link rel="stylesheet" href="${root}style.css">
+</head>
+<body>
+  <div id="page">
+
+    <div id="header">
+      ${self.header()}
+    </div>
+
+    <div id="body">
+      ${next.body()}
+    </div>
+
+    <div id="footer">
+      ${self.footer()}
+    </div>
+
+  </div>
+</body>
+</html>
+
+<%def name="header()">
+  % if title:
+    <p><a href="${root}">${site_title}</a></p>
+  % else:
+    <h1><a href="${root}">${site_title}</a></h1>
+  % endif
+</%def>
+
+<%def name="footer()">
+  <hr>
+  <p><a href="${root}">Home</a></p>
+</%def>

example-site/templates/archive_year.html

+<%inherit file="_base.html"/>
+
+<ul>
+  % for entry in entries:
+    <li>
+      <a href="${entry.url}">${entry.title}</a>
+      (${entry.date.day} ${entry.month_name[:3]})
+    </li>
+  % endfor
+</ul>

example-site/templates/entry.html

+<%inherit file="_base.html"/>
+
+% if title:
+<h1>${title}</h1>
+% endif
+
+<p class="time" title="${date.isoformat()}">
+  ${date.strftime('%e %B %Y')}
+</p>
+
+${content}
+
+
+% if prevpost or nextpost:
+<p>
+  % if prevpost:
+  <a href="${prevpost.url}">&larr; ${prevpost.title or 'Untitled'}</a>
+  % endif
+  % if nextpost:
+  <a href="${nextpost.url}">${nextpost.title or 'Untitled'} &rarr;</a>
+  % endif
+</p>
+% endif

example-site/templates/home.html

+<%inherit file="_base.html"/>
+
+<ul>
+  % for page in pages(5):
+    <li>
+      <a href="${page.url}">${page.title or 'Untitled'}</a>
+      (${page.date.strftime('%Y-%b-%d')})
+    </li>
+  % endfor
+</ul>
+
+${content}

example-site/templates/page.html

+<%inherit file="_base.html"/>
+
+% if title:
+<h1>${title}</h1>
+% endif
+
+${content}