Permalink
Browse files

404 page.

makeHtmlSkel() will now look in the templates dir for 404.html and
generate the coresponding 404.html page in html_dir.
  • Loading branch information...
1 parent 2177e87 commit cd8f01222596c9246f5773e8693f00e5e5c18c95 @vrypan committed Feb 12, 2012
Showing with 56 additions and 0 deletions.
  1. +25 −0 _themes/bucket3/templates/404.html
  2. +25 −0 _themes/bucket3com/templates/404.html
  3. +6 −0 bucket3.py
View
25 _themes/bucket3/templates/404.html
@@ -0,0 +1,25 @@
+{% extends "base.html" %}
+
+{% block page_meta %}
+<meta name="title" content="{{ blog.title }} | Error 404 Page Not Found">
+<meta name="description" content="Error 404: Page not found.">
+<!-- Google will often use this as its description of your page/site. Make it good. -->
+
+<meta name="author" content="{{ blog.author }}">
+<meta name="Copyright" content="{{ blog.copyright }}">
+
+<!-- Dublin Core Metadata : http://dublincore.org/ -->
+<meta name="DC.title" content="{{ blog.title }} | Error 404 Page Not Found">
+<meta name="DC.subject" content="The page you requested was not found. Error 404.">
+<meta name="DC.creator" content="{{ blog.author }}">
+{% endblock page_meta %}
+
+
+{% block content %}
+<div class="entry">
+<h2 class="entry-title">Error 404: page not found.</h2>
+<div class="entry-body">
+ <p>The page you requested was not found. </p>
+ <p>You may like to go to the <a href="{{ blog.url }}">homepage</a></p>
+</div>
+{% endblock %}
View
25 _themes/bucket3com/templates/404.html
@@ -0,0 +1,25 @@
+{% extends "base.html" %}
+
+{% block page_meta %}
+<meta name="title" content="{{ blog.title }} | Error 404 Page Not Found">
+<meta name="description" content="Error 404: Page not found.">
+<!-- Google will often use this as its description of your page/site. Make it good. -->
+
+<meta name="author" content="{{ blog.author }}">
+<meta name="Copyright" content="{{ blog.copyright }}">
+
+<!-- Dublin Core Metadata : http://dublincore.org/ -->
+<meta name="DC.title" content="{{ blog.title }} | Error 404 Page Not Found">
+<meta name="DC.subject" content="The page you requested was not found. Error 404.">
+<meta name="DC.creator" content="{{ blog.author }}">
+{% endblock page_meta %}
+
+
+{% block content %}
+<div class="entry">
+<h2 class="entry-title">Error 404: page not found.</h2>
+<div class="entry-body">
+ <p>The page you requested was not found. </p>
+ <p>You may like to go to the <a href="{{ blog.url }}">homepage</a></p>
+</div>
+{% endblock %}
View
6 bucket3.py
@@ -127,6 +127,12 @@ def makeHtmlSkel(self):
self.html_dir
)
+ tpl = self.tpl_env.get_template('404.html')
+ html = tpl.render()
+ f = open(os.path.join(self.html_dir, '404.html'), 'w')
+ f.write(html.encode('utf8'))
+ f.close()
+
def textAbstract(self, txt):
txt = re.sub('<[^<]+?>', '', txt)

0 comments on commit cd8f012

Please sign in to comment.