Git Product home page Git Product logo

migi's Introduction

Migi

Migi is a minimal static site generator named after the parasite which lives in Shinichi's right hand in the anime "Parasyte", which in turn was named after the Japanese word for right (ミギー).

For instructions on how to use Migi, please read the short walk-through on the wiki page.

Features

  • Caching: Optimizes your site's performance by storing and reusing content, minimizing build times.
  • Tagging: Enhances content organization, allowing easy categorization and retrieval of content.
  • Templates: Flexible templating system adaptable to various content types, from blogs to portfolios.
  • Syntax Highlighting: Supports .tmThemes for customizable code presentation.
  • HTML Minification: Reduces the size of your HTML files, improving load times and efficiency.

Installation

Ensure you have Rust and Cargo installed on your system. Then, install Migi with the following command:

cargo install migi

or if cloning from the GitHub, use the provided makefile:

make && sudo make install

and sudo make uninstall to completely uninstall.

Quick Start

migi new mysite
cd mysite
migi build

This sequence of commands creates and builds a new static site in the mysite directory.

Creating Posts

To create a new post, add a markdown file in the content/ directory.

Use the header section in each post for metadata like title and tags. (Refer to the wiki page).

Community and Support

Issues and Discussions: For support, feature requests, or bug reports, visit the GitHub Issues.

Contributions: Contributions are welcome!

Star the repository or contribute to support my work!

migi's People

Contributors

bunkrat avatar

Stargazers

 avatar

Watchers

 avatar

migi's Issues

Sorting of posts (ordered)

Add an option in config.toml to allow for sorting posts by categories such as title for alphabetical sorting, date for a chronological sorting, etc.

Markdown in Templates

Templates should not force users to write HTML. You should be able to write markdown in templates instead.

Some thought should be put into the structure of websites as well. For instance, what if a user does not want a blog, but just a website with 4 or 5 basic pages? Must they write it all in HTML as templates? Would they write those pages as posts? How would they link to the 'homepage'?

Update Syntax Highlighting Upon Build

Syntax highlighting needs to apply if the user alters the config.yml file.

Currently, the only conditions to meet for re-rendering to HTML are cache and time based.

To recreate: just run the build command on any website, then change the syntax theme in the config.yml. It will not warrant an update and will just keep the old syntax theme.

Checking configuration too late

Migi currently does not correctly check configurations. The user configuration should be checked ahead of time (at the start of the migi running).

Right now, creating files with no syntax highlighting and then one or two with syntax highlighting required would cause the files that do not need to be syntax highlighted to be rendered properly into their respective HTML; however, the other files would not be writen out and would produce an error.

The expected behavior is that should something be wrong in the configurations file, Migi will stop and return an error.

Proper CLI handling

The current implementation of using env::args() does work; however, perhaps changing to a crate, such as Clap might make sense as Migi undergoes further changes.

This would also allow users more control over the intial structure of they site (e.g., allowing users to specify if the want to generate the default structure when running the new command).

Not rebuilding Properly

When a file in the output/ is removed, the caching system still has the file and so it does not warrant a rebuild. This must be fixed.

Additionally, rename the output/ to build/ and create a compile function to handle the markdown -> html and highlighted snippets concatenation.

Update cache

Cache does not update files based on time, only file name. Files with the same name removed and then added back to content are not re cached.

Potential solution: concatenation of file name and date modified or assigning UUID

Complete 1.0.0 Rework Soon

There will be a rework and major version bump from 0.1.2 to 1.0.0.

Besides the overall quality of the code being better in the upcoming version, many dependencies will be removed.

Migi 0.1.2's dependencies and build time (on my system):

190 total dependencies; 1m27s build time

Migi 1.0.0's dependencies and build time (rough estimate):

25 total dependencies; 0m5.14s build time
  • HTML/CSS minification (via minify html onepass) will no longer be available in 1.0.0.
  • Syntax highlighting (via Syntect) will be replaced by a custom syntax highlighter I am currently developing.
  • The tagging system will be reworked to be more flexible and allow for filters to be applied.

For example:

{ linux cats | sort(date) | max(5) }
This will show the most recent 5 linux and cats posts.

additionally, post tags will likely have attributes such as the following:

  • cats.name
  • cats.link
  • cats.desc
  • cats.date

This will allow for greater flexibility when using templates.

I have also experimented with https://docs.rs/minijinja/latest/minijinja/ and 3 other templating engines; however, found them to provide too many unnecessary features to qualify adding them to Migi.

  • Caching system will be made simpler and more efficient. Right now, things like the tags for each post are cached, but they really don't need to be. Nothing other than the filename and modification date needs to be cached.

  • Lastly, forcing of a page.html/index.html template will cease to exist. You should be able to create a single markdown page and render it to HTML without ever needing to touch templating.
    Furthermore, I may make it so Migi accepts files/directories from stdin instead of relying on the user going into the directory of the site and running build. This would also allow quick conversion of single files like: migi -b my_page.md or migi -b website/ for dirs.

The documentation and README.md will also be updated. Something like:

Tiny code base, hackable static site generator.

Additionally, I may create a website that hosts the documentation rather than relying on GitHub's wiki feature.

The general directory structure will likely change to the following:

static/ source/ template/ build/ .cache/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.