Clementine (The Clockwork Century, #1.1)
Review:Marked improvement over Boneshaker in some areas, worse in some others. Not much character development, but a forward-moving plot. |
Review:Marked improvement over Boneshaker in some areas, worse in some others. Not much character development, but a forward-moving plot. |
I am a very big proponent of static site generators. I would not have bothered writing Nikola otherwise. But there is always that feeling that maybe there is some little thing which is hard to implement, like a contact form.
And let's face it, the easiest way to solve some of those things is by sticking a few lines of PHP in your HTML.
So, if you really want to, you can do it. I think Nikola (github master) is the first static site generator that supports php code. Here's how:
Add php to your page_compilers (because I will never put it there by default):
post_compilers = { "rest": ('.txt', '.rst'), "markdown": ('.md', '.mdown', '.markdown'), "textile": ('.textile',), "txt2tags": ('.t2t',), "bbcode": ('.bb',), "wiki": ('.wiki',), "ipynb": ('.ipynb',), "html": ('.html', '.htm'), "php": ('.php'), }
Add php posts or pages to your post_pages:
post_pages = ( ("posts/*.txt", "posts", "post.tmpl", True), ("posts/*.php", "posts", "post.tmpl", True), ("stories/*.txt", "stories", "story.tmpl", False), ("stories/*.php", "stories", "story.tmpl", False), )
Create a php post:
nikola new_post posts/foo.php
Put php in there:
<!-- .. date: 2013/04/16 09:57:09 .. title: php test .. slug: foo --> <?php Print "Hello, World!"; ?>
Build the site as usual, and you should end up with a page with PHP extension, that has that PHP in the "content" area, so it will follow your site's theme. Of course you can't do things like add HTTP headers and such, but hey, read the title.
Yes, version 5.4.4 of Nikola, my static site/blog generator is just published at the usual place, including the following improvements:
New Japanese translation.
Nikola check exists with 1 if there is an error
New HIDE_UNTRANSLATED_POSTS option that ensures you don't have mixed-language pages (Issue #373)
New theme "site-planetoid" for use with the planetoid plugin.
New 'retired' tag for posts that should no longer be in feeds.
Added post data as a uptodate check for mustache (Issue #456)
Rebuild post pages when the post's translation list changes (Issue #458)
Handle "-h" (Issue #460)
Added correct help for console command (Issue #460)
Escape twittercard data (Issue #452)
Added missing "twittercard" in story template
Added support for per-language tags (Issue #450)
Fix wrong path splitting (Issue #434)
Remember locale even when set_locale failes (Issue #446)
Decode path argument in new_post (Issue #442)
task_indexes had missing config dependencies (Issue #441)
Removed bogus links to slides assets that were removed
Compressed files were seen as unknown by "nikola check"
local search and mustache plugins must be disabled by default (Issue #437)
Avoid failure if there are no tags and USE_GZIP is enabled (Issue #439)
Fix aspect ratio detection in Vimeo videos (Issue #440)
Blogger importer was passing wrong options to "nikola init" (Issue #408)
Review:Nice steampunk, even if half the physics make no sense whatsoever (like, the blight being heavier than air yet it flowing up from the ground, and everyone living underground). |