Create and maintain a basic weblog/Set up on Blogger or Wordpress/Create Nikola Static Site

From WikiEducator
Jump to: navigation, search
The Blogging Handbook
Notionscapital-2493066577-sizes-t.jpg
Logo for Nikola Static Site Generator

Nikola is a static site generator written in Python. Instead of a dynamic powered site (such as Wordpress) sites are powered by pregenerated files (html, images, css). This makes static sites faster and more secure.

Sites can be built easily on a local machine and then the 'output' folder uploaded to the webserver. I recommend DigitalOcean for hosting.

Setting up a Nikola site is really easy. You will need a few minutes’ time and a Python (3.3+; 2.7 partially supported) interpreter.

There are multiple ways to install Nikola.

The best way to do it is to use pip in a virtualenv. We recommend installing the "Nikola[extras]" distribution to access some extra features, but you can drop the [extras] specifier if you don’t want them. Note that you might need to install some extra dependencies for lxml and Pillow in order to compile them or to get full functionality.

You can also download the tarball and install manually.

Some Linux distributions also have Nikola packaged in its repositories — but please make sure it’s a fresh version.

If you prefer, a Docker image is also available.

Nikola is free open-source software, under the MIT license.

Create an empty site (with a setup wizard):

nikola init mysite

You can create a site with demo files in it with nikola init --demo mysite

The rest of these commands have to be executed inside the new mysite folder.

Create a post:

nikola new_post

Edit the post:

The filename should be in the output of the previous command. You can also use nikola new_post -e to open an editor automatically.

Build the site:

nikola build

Start the test server and open a browser:

nikola serve -b

What's Nikola and what can you do with it? Nikola is a static website and blog generator. The very short explanation is that it takes some texts you wrote, and uses them to create a folder full of HTML files. If you upload that folder to a server, you will have a rather full-featured website, done with little effort.

Its original goal is to create blogs, but it supports most kind of sites, and can be used as a CMS, as long as what you present to the user is your own content instead of something the user generates.

Nikola can do:

A blog (example)

Your company's site

Your personal site

A software project's site (example)

A book's site

Since Nikola-based sites don't run any code on the server, there is no way to process user input in forms.

Nikola can't do:

Twitter

Facebook

An Issue tracker

Anything with forms, really (except for comments!)

Keep in mind that "static" doesn't mean boring. You can have animations, slides or whatever fancy CSS/HTML5 thingie you like. It only means all that HTML is generated already before being uploaded. On the other hand, Nikola sites will tend to be content-heavy. What Nikola is good at is at putting what you write out there.

source: GetNikola
Retrieved from "https://wikieducator.org/index.php?title=Create_and_maintain_a_basic_weblog/Set_up_on_Blogger_or_Wordpress/Create_Nikola_Static_Site&oldid=995959"