Skip to content

Commit

Permalink
Add hyde, base template, basic readme/makefile, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
pquerna committed Mar 1, 2011
1 parent e867a6f commit 5f2c440
Show file tree
Hide file tree
Showing 379 changed files with 38,977 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
site.log
*.pyc
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@



setup: hyde/requirements.txt
pip install -r hyde/requirements.txt

build:
python hyde/hyde.py -g -s . -d deploy

run:
python hyde/hyde.py -w -s .

11 changes: 11 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Cast Project Website

Step 1) Install Hyde and related tools:

$ make setup

Step 2) Build site:
$ make build

Step 2.5) Run server for testing:
$ make run
120 changes: 120 additions & 0 deletions content/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Thanks, http://html5boilerplate.com
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com

# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk

<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
</IfModule>
</IfModule>

<IfModule mod_headers.c>
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
# We need to inform proxies that content changes based on UA
Header append Vary User-Agent
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
</IfModule>

# Webfont access
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>

# Proper MIME type for all files
# audio
AddType audio/ogg oga ogg

# video
AddType video/ogg ogv
AddType video/mp4 mp4
AddType video/webm webm

# Proper svg serving. Required for svg webfonts on iPad
# twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml svg svgz
AddEncoding gzip svgz

# webfonts
AddType application/vnd.ms-fontobject eot
AddType font/truetype ttf
AddType font/opentype otf
AddType font/woff woff

# assorted types
AddType image/x-icon ico
AddType image/webp webp
AddType text/cache-manifest manifest
AddType text/x-component htc
AddType application/x-chrome-extension crx
AddType application/x-xpinstall xpi
AddType application/octet-stream safariextz

# gzip compression
<IfModule mod_deflate.c>
# force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>

# html, txt, css, js, json, xml, htc:
<IfModule filter_module>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
FilterChain COMPRESS
FilterProtocol COMPRESS change=yes;byteranges=no
</IfModule>

<IfModule !mod_filter.c>
# Legacy versions of Apache
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
</IfModule>

# webfonts and svg:
<FilesMatch "\.(ttf|otf|eot|svg)$" >
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
# e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
Options -MultiViews

# unicode
AddDefaultCharset utf-8
AddCharset utf-8 .html .css .js .xml .json .rss

<IfModule mod_rewrite.c>
RewriteEngine on

# we don't want www, right? shorter urls rock
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

{% if GENERATE_CLEAN_URLS %}
RewriteBase {{ node.site.settings.SITE_ROOT }}

{% hyde_listing_page_rewrite_rules %}

# listing pages whose names are the same as their enclosing folder's
RewriteCond %{REQUEST_FILENAME}/$1.html -f
RewriteRule ^([^/]*)/$ %{REQUEST_FILENAME}/$1.html

# regular pages
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^.*$ %{REQUEST_FILENAME}.html
{% endif %}
</IfModule>
13 changes: 13 additions & 0 deletions content/about/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends "_staticpage.html" %}

{%hyde
title: "About"
%}

{% block article %}

Hyde is a static website generator using django templates & an "extensible generation engine".

Read more about Hyde [here:]({{content}}/{{links.introducing_hyde}})

{% endblock %}
10 changes: 10 additions & 0 deletions content/blog/2007/happy-christmas.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "_post.html" %}

{%hyde
title: Merry Christmas
created: 2007-12-20 18:20:30
%}

{% block article %}

{% endblock %}
5 changes: 5 additions & 0 deletions content/blog/2007/listing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "skeleton/_listing.html" %}

{%hyde
title: Archives
%}
5 changes: 5 additions & 0 deletions content/blog/2008/2008.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "skeleton/_listing.html" %}

{%hyde
title: Archives
%}
32 changes: 32 additions & 0 deletions content/blog/2008/happy-christmas.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "_post.html" %}

{%load webdesign %}

{%hyde
title: Merry Christmas
created: 2008-12-20 18:20:30
%}

{% block article %}

{%article%}

{% excerpt %}

### {% lorem 10 w random %} ###

{% lorem 3 p %}

{%endexcerpt%}

### {% lorem 5 w random %} ###

{% lorem 2 p %}

### {% lorem 2 w random %} ###

{% lorem 3 p %}

{%endarticle%}

{% endblock %}
32 changes: 32 additions & 0 deletions content/blog/2008/happy-new-year.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "_post.html" %}

{%load webdesign %}

{%hyde
title: Happy New Year
created: 2008-12-31 18:21:15
%}

{% block article %}

{%article%}

{% excerpt %}

### {% lorem 10 w random %} ###

{% lorem 3 p %}

{%endexcerpt%}

### {% lorem 5 w random %} ###

{% lorem 2 p %}

### {% lorem 2 w random %} ###

{% lorem 3 p %}

{%endarticle%}

{% endblock %}
5 changes: 5 additions & 0 deletions content/blog/2009/2009.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "skeleton/_listing.html" %}

{%hyde
title: Archives
%}
37 changes: 37 additions & 0 deletions content/blog/2009/introducing-hyde.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% extends "_post.html" %}

{%load webdesign %}

{%hyde
title: Introducing Hyde
created: 2009-01-20 22:07:29
%}

{% block article %}

{%article%}

{% excerpt %}

### {% lorem 10 w random %} ###

{% lorem 3 p %}

{%endexcerpt%}

{% reference test_reference%}

<p style="color:red">This is a reference.</p>

### {% lorem 5 w random %} ###
{%endreference%}

{% lorem 2 p %}

### {% lorem 2 w random %} ###

{% lorem 3 p %}

{%endarticle%}

{% endblock %}
5 changes: 5 additions & 0 deletions content/blog/2010/2010.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "skeleton/_listing.html" %}

{%hyde
title: Archives
%}
34 changes: 34 additions & 0 deletions content/blog/2010/hyde_has_references.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{% extends "_post.html" %}

{%load webdesign %}

{%hyde
title: Hyde has references
created: 2010-10-15 22:07:29
%}

{% block article %}
{%refer to "../2009/introducing-hyde.html" as hyde_intro%}
{{hyde_intro.test_reference}}

{%article%}

{% excerpt %}

### {% lorem 10 w random %} ###

{% lorem 3 p %}

{%endexcerpt%}

### {% lorem 5 w random %} ###

{% lorem 2 p %}

### {% lorem 2 w random %} ###

{% lorem 3 p %}

{%endarticle%}

{% endblock %}
1 change: 1 addition & 0 deletions content/blog/atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{%extends "skeleton/_atom.xml"%}
5 changes: 5 additions & 0 deletions content/blog/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "skeleton/_listing.html" %}

{%hyde
title: Archives
%}
23 changes: 23 additions & 0 deletions content/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends "skeleton/_body.html" %}

{%hyde
title: "Hyde : Ready for customization"
created: 2009-02-01 18:09:05
listing: True
%}

{% block content_body %}

<h2>Recent Posts</h2>

{%recent_posts recents 5 %}

<ul>
{%for post in recents %}
<li>
<a href='{{post.url}}'>{{post.title}}</a>
</li>
{%endfor%}
</ul>

{%endblock%}
Binary file added content/prerendered/hyde-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions hyde/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*~
*.pyc
.DS_Store
deploy/*
*.cprof
*.profile
*.log
pylint*
*.tmproj
test_site
3 changes: 3 additions & 0 deletions hyde/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/tornado"]
path = lib/tornado
url = git://github.com/facebook/tornado.git
Loading

0 comments on commit 5f2c440

Please sign in to comment.