GithubHelp home page GithubHelp logo

ddehueck / simple-static-site-editor Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 29 KB

Flask application to update a static site's data

License: MIT License

Python 65.40% CSS 3.61% HTML 30.99%
static-site static-site-cms github-pages

simple-static-site-editor's Introduction

Simple-Static-Site-Editor

Flask application to update a static site's data via JS files. The editor writes to a JS file and the static site reads from the JS file. See my site as an example of a site that consumes this application. It's a good tnterface for editing a github pages site!

Why did you make this? I wanted an interface to update my personal site so I could keep track of smaller scale things like papers I've been reading. I also did not want to add a full backend to my little static site for sake of simplicity (reading a JS file vs. consuming an API).

Why do you write to a JS file instead of a JSON file? To avoid cross-origin resource sharing. If you could load a website and have it try to access any file on your system then that would be a serious security breech, so most browsers do not allow this functionality. Hence, reading a JSON file is much more difficult than reading a JS file as we do not run into this cross-origins problem.

Demo

Demo GIF

How to get running!

$ python -m flask run

Feel free to create an issue if you want to adapt any functionality or learn more!

Features

  • Save data to JSON (in a JS file) to be easily read into html documents with vanilla JS
  • Push file changes to github (will require your own user token)
  • Add/Edit/Delete JSON objects
  • Extend to your own data needs - defined new schemas

Editor File Structure

  • app
    • data # holds data that will be ported to static site
    • managers # directory that handles managers that update data files
    • static
    • templates
    • __init__.py
    • utils.py

simple-static-site-editor's People

Contributors

ddehueck 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.