Commits

faassen committed 9ac532a

Move templates back next to the source code.

Comments (0)

Files changed (10)

-75e227bc8bfff19461b7f8784a8fbdb9efef22d6 example_blaag
+4a7879a328516a6acb915dfc2c4cc14b3f0c2971 example_blaag
             'use_filename_for_creation_time': False,
             },
         'html': {
-            'templates_path': 'templates',
             'html_path': 'html',
             'base_url': 'http://localhost:8000/',
             'test_base_url': 'http://localhost:8000/',
     """Generate html from blaag entries."""
     config = get_configuration(config_path)
 
-    templates = Templates(config.get('html', 'templates_path'))
+    templates_path = os.path.join(os.path.dirname(__file__), 'templates')
+    templates = Templates(templates_path)
 
     page_tpl = templates.get('pagetemplate.html')
     blaag_tpl = templates.get('blaag_template.html')

templates/blaag_template.html

+<article id="${identifier}" class="blog box">
+    ${html_body}
+    ${timestamp}
+    ${comments}
+</article>
+      

templates/comments_full.html

+
+<div class='fullcomments'>
+    <div id="disqus_thread"></div>
+    <script type="text/javascript">
+        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
+        var disqus_shortname = '${disqus_name}';
+        var disqus_identifier = '${threadid}';
+        /* * * DON'T EDIT BELOW THIS LINE * * */
+        (function(d) {
+            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+            dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
+            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+        })();
+    </script>
+    <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+    <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+</div>

templates/comments_short.html

+
+<div class='shortcomments'>
+    <a href="${link}#disqus_thread" data-disqus-identifier="${threadid}">Comments</a>
+</div>

templates/created.html

+Blaag created ${timestamp}.

templates/menu_link.html

+<a href='${link}' class='menu_link'>${title}</a>

templates/modified.html

+ Last modified ${timestamp}.

templates/pagetemplate.html

+<!DOCTYPE html >
+<html lang="en">
+<head>
+  <title>${page_title}</title>
+  <meta charset="UTF-8">
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <link rel="stylesheet" type="text/css" href="${css}" />
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
+  <meta name="description" content="${page_title}"/>
+  <meta name="author" content="${author}" />
+</head>
+<body>
+
+    <section class="page">
+      <header class="page">
+        <h1>${page_title}</h1>  
+      </header>  
+      
+      ${main}
+      
+      <nav class="blogs">
+        <a href='/' class='menu_link'>- index -</a>
+        <a href='/rss.xml' class='menu_link'>RSS Feed</a>
+        <h4>My recent posts</h4>
+        ${links}
+      </nav>
+    
+      <footer class="page">
+        <p class="fineprint">Page created using <a href='https://bitbucket.org/haard/blaag'>blaag</a> and abusing <a href='http://docutils.sourceforge.fnet/' target='_blank'>docutils</a>. <a href="/rss.xml">RSS Feed</a> generated using <a href='http://www.dalkescientific.com/Python/PyRSS2Gen.html'>PyRSS2Gen</a><br/> Copyright Fredrik Håård &lt;fredrik at the server named haard dot se&gt;.
+      </footer>
+    </section>
+    
+    <!-- Add JavaScript after this point, it makes the page load faster when client does not need to interpret JS at start -->
+    <script type="text/javascript">
+      var _gaq = _gaq || [];
+      _gaq.push(['_setAccount', '${google_analytics_account}']);
+      _gaq.push(['_trackPageview']);
+      (function() {
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+      })();
+    </script>
+     
+    <script type="text/javascript">
+      var disqus_shortname = '${disqus_name}'; 
+      (function () {
+        var s = document.createElement('script'); s.async = true;
+        s.type = 'text/javascript';
+        s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
+        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
+      }());
+    </script>
+
+</body>
+</html>

templates/timestamp.html

+<div class='timestamp'>
+${timestamps}
+</div>