Git Product home page Git Product logo

flask-blogtheme's Introduction

Flask-BlogTheme

image

Flask extension to switch blog theme easily

Features

  • Clone theme repository to theme folder and set name in config file
  • YAML _config.yml files like Jekyll
  • Easily porting theme from Jekyll or Hexo

Installation

From PyPI

$ pip install Flask-BlogTheme

All are ready for you, prefix the command with sudo if necessary.

From GitHub

$ git clone [email protected]:frostming/Flask-BlogTheme.git
$ cd Flask-BlogTheme
$ python setup.py develop

Usage

from Flask-BlogTheme import BlogTheme from flask import Flask

app = Flask(__name__) BlogTheme(app)

Create a theme folder under your app root, clone some theme repository to it. You can pass an extra theme_folder parameter to BlogTheme() to change the default folder.

Config the theme just as the guide tells, in _config.yml. The theme repository should obey following restrictions:

  • static files under assets folder
  • All layout / templates directly under the theme folder
  • Templates are in jinja2-readable format

Set app.config['BLOG_THEME_NAME'] to the theme name. Then, in you app.py: Then {{theme}} is accessible throughout your app. You can put some settings in the _config.yml under app root path to override the theme config.

Config

Config Description
BLOG_THEME_NAME The theme name
BLOG_THEME_PROCESSOR the context processor for the config, defaults to theme
BLOG_THEME_CONFIG_NAME the config file name, defaults to _config.yml

License

MIT. See the LICENSE file

flask-blogtheme's People

Contributors

frostming avatar

Watchers

 avatar  avatar

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.