Skip to main content

A simple static site generator.

Project description

Feni is a simple static site generator. You can use it to build your site from a set of markdown files and a number of templates (Jinja2)

Feni needs the following information to function, that it can read from command line arguments or from a configuration file.

1. A source directory. This is where Feni looks for content. Right now it only look for .md files. Each of this file should be of format as shown below.:

main: true
type: post
permalink: test-post.html
data-title: My test post
data-subtitle: This is as test post
---
###This is the content of the post in markdown format###

Every article needs to have a header in yaml format that contain information regarding how the final html should be generated. The first one, the ‘main’ attribute denotes if the article is intended to be a whole article or if it is part of a bigger article. If it is a whole article, this attribute should be true. If it is a sub article, then this should be false.

The next attribute, the ‘type’, as the name implies, denotes the type of the article. This attribute is used to find a template that can be used to expand this article.

‘permalink’ attribute is the final location of the generated html file. This should be relative path. The generated html is placed under this path relative to the output directory. If you omit this value, this article will not be generated.

the data- attributes are custom fields that you can define, which will be available in your template. This can be any valid yaml value. For example, you this can be a list where each item is information about an article. This list can be used to display a list of articles in the target template. If you define a value ‘data-article_name’, then that value will be available in the template as ‘article_name’ key.

  1. A destination directory. This is where the generated files will be put.

3. A decorator directory. This is where all the other files, like css files, js files, background images come from. This folder will be mostly copied as such into the output folder. If there are files matching the enabled file handlers, then those will be passed through them. Right now only .less files will be processed into css files.

  1. A path to a templates folder that should contain all the jinja templates.

  2. Path to a template configuration file. This file has the following format.:

    about.html:
        types:
            - aboutme
    post.html:
        types:
            - post

As you can see, this just lists the template files and declares the type of articles it can handle. By default, Feni looks for this file in the templates folder under the name templates.yaml. But you can change that using the –templatemap option

Feni can read this from a configuration file in yaml format.

source: articles destination: output decorator: design templatemap: templates/templates.yaml

By default, Feni looks for the this file in the current folder and folders above it. Paths read from it will be considers as relative to the directory where it is found. Template paths in template.yaml will be taken relative to the template directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Feni-0.3.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file Feni-0.3.tar.gz.

File metadata

  • Download URL: Feni-0.3.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Feni-0.3.tar.gz
Algorithm Hash digest
SHA256 5fb547b681afe07728001795df6343f6b50b6cd0c143ac847beb80889e735b63
MD5 248d11260eba52fd4303b4de8d58d43c
BLAKE2b-256 a89ecf93bb01f151d88f25302a87b198c2aac9854a0d17ef5e16c6907ccf53e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page