marmite 0.1.0

MARkdown Makes sITEs is a very simple static site generator, mainly for simple blogs.
marmite-0.1.0 is not a library.

DO NOT USE IT YET

Logo

Marmite

[Markdown Makes site] is a very! simple static site generator.

How it works

It does "one" simple thing only:

Reads all .md files on the content folder Using CommonMark parse it to HTML content Renders each content using templates from the templates folder Outputs the rendered static site to the site folder.

AGPL License

Installation

Install my-project with cargo

cargo install marmite

Or download the pre-built binary from the releases page.

Write the content

  1. Initialize the project

This command creates the initial folder structure

marmite init myblog

Folder structure will be

myblog
├── marmite.yaml        # Site configuration
├── content
│   ├── about.md        # Page on the menu
│   └── first-post.md   # Post on the timeline
├── static
│   └── style.css       # Empty CSS
└── templates
    ├── base.html       # Common HTML
    ├── content.html    # Renders page and post
    └── list.html       # Renders index, tags, archive
  1. Write the site data

marmite.yaml

name: My Blog
tagline: This blog is awesome
url: https://www.myblog.com
pagination: 10
  1. Write yout content

Drop an .md file on the content/ folder.

Pages vs Posts

  • Post: If it has a date property it is considered a post to show in the index posts list.
  • Page: If it does not have a date it is considered a page to show in the menu.

Metadatada

Front matter is used in yaml format.

---
date: "2024-01-01"
title: Title
slug: title
tags: comma,separated,tags
show_in_menu: true
---

  • date: If informed, the content is considered a Post and shows in index list.
  • title: If not defined, the first line of the markdown content is used.
  • slug: If not defined, the filename is used to build the url.
  • tags: Optional
  • show_in_menu: if content is a page (has no date) then it is added in the menu.

All fields are optional, if nothing is declared then the content is considered a Page that does't show in the listing, neither rss or menu. (useful for drafts, or pages accessible with link only.)

Example Post

content/first-post.md

---
date: "2024-01-01"
title: My First Blog Post
slug: my-first-blog-post
tags: poetry,life
---

# Hello this is my first post

This blog was generated by `Marmite` the simplest static site generator

I can have local images as along as those are located on the `static` folder.

## Images

![local image](/static/img/simple.png)

I can also have remote images

![remote image](https://github.com/rochacbruno/marmite/logo.png)


## Code Snippets

```python
de foo():
    return "bar"
```

editors and deployment

Marmite does not come with an editor but as the content is simply markdown files, any text editor will work!

Generated site is pure HTML + CSS so it can be served on any static webserver.

Workflow is generally:

  • Create a new content/your-content-title.md.
  • Edit in your preferred editor (There are some with good preview support).
  • Add the date metadata when it is ready to publish.
  • commit to your preferred repository.
  • use your preferred automation system to publish it to your preferred web server.

Common examples:

  • Edit in Marktext Editor, configure it to move pasted images to static/img, commit to Github, Add an action to build and Publish as a Github Page.
  • Edit directly in the Github Web UI, commit, let CI Action to build and publish.
  • Edit in vim, Generate the site locally, Publish via FTP.
  • Edit in VsCode, Commit to Git Repository, Have the CI to build and Publish (GH pages, netlify etc)

Marmite focus on generating the site from markdown only, the deployment and media management is a separate problem to solve.

That's all!

Marmite is very simple, and limited in functionality, there is no intention to add more features or built-in themes.

If this simplicity does not suit your needs, there are other awesome static site generators.

Here are some that I recommend:

  • Cobalt
  • Zola