Code Monkey home page Code Monkey logo

mysgen's Introduction

mysgen

test coverage lint type

Python 3.8 - 3.11 Testing framework: pytest Linter and formatter: ruff Type checker: mypy

A very simple static site generator used for mladen.gibanica.net built using Python and Jinja2.

The configuration file config.json should contain the following

{
    "author": "Name",
    "sitename": "Site name",
    "siteurl": "https://address.com",
    "timezone": "Europe/Stockholm",
    "default_lang": "en-gb",
    "theme_path": "path_to_theme",
    "src_path": "path_to_content",
    "build_path": "path_to_build",
    "home": "home",
    "menuitems": {
        "home": "",
        "archive": "archive"
    },
    "post_url": "{{post_url}}",
    "build_date_template": "{{update_date}}",
    "thumbnail_size": [300, 300],
    "markdown_extensions": [
        "meta",
        "fenced_code",
        "mdx_math"
    ],
    "s3-bucket": "bucket",
    "mangle_image_name": true
}

Such a configuration assumes the following folder structure

root/
├─ config.json
├─ path_to_content/
│  ├─ data/
│  ├─ images/
│  ├─ pages/
│  │  ├─ home.md
│  │  ├─ archive.md
│  ├─ posts/
├─ path_to_theme/
│  ├─ css/
│  ├─ js/
│  ├─ templates/
├─ path_to_build/

mysgen's People

Contributors

mgcth avatar dependabot[bot] avatar

Stargazers

Return_of_the_Mack avatar

Watchers

James Cloos avatar  avatar

mysgen's Issues

Mangle image names

Description

Add option to mangel image names and sort them by date. Requires that image name is the date, as the code expects images with stripped metadata.

Local build in Windows is not working due to hard-coded /

There is an issue in certain path splits and combines on my version of Windows; the problem seems to be that certain split and join statements have "/" hard coded in them. When I change that locally to "\", it works (to a degree). Of course, this is no good since I then can't use the code to build in a Unix-based server environment.

Windows compatibility issue

When using mysgen on a Windows computer, build is failing because the parsing is constructed assuming levels are separated by "/", however Windows uses "\" by default.

Would be nice to have some sort of automatic check and fix for this.

Use ruff

Description

Use ruff for formatting and linting.

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.