Coder Social home page Coder Social logo

zedelghem / pystatic Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 4.0 368 KB

Dead simple static site generator. To build a website you need only one line of Python, the rest is Markdown, HTML, and CSS.

License: GNU General Public License v3.0

Python 42.20% CSS 16.48% HTML 41.32%

pystatic's People

Contributors

alexb7217 avatar zedelghem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pystatic's Issues

Call for templates

Since pystatic is supposed to be simple and ready to go right out of the box, it would be nice to have a couple of pretty and useful templates bundled with the script.

The job is technologically easy, the whole task is to style the list of posts on the front page and the individual post page. Not much more to worry about.

This is a call to the creative minds, aspiring designers looking for portfolio projects, and virtually anyone with a basic grasp of CSS and interesting visual ideas.

I will make one or two myself but an extra pair of hands could do wonders.

Please, read the Readme file and take a look at the existing default template for a quick introduction.

Best,
Z.

RSS?

cool tool! Seems like maybe not in active development anymore but it's going to work well for me! :) So thank you!

But, curious if you're thinking of adding basic rss.xml generation. If not, I can take a swing at it.

Missing templates/lib directory on initial build

On initial checkout of repo and first use, I encountered this error message:

user@dev:~/develoment_dir/pystatic$ python build.py
Tried to copy contents of templates /lib folder but the folder does not exist! Make one, even empty!

Appears that templates/lib needs to be created by user, simple enough. Is there any reason this directory can not be included as part of the standard directory structure? It is shown in the README as part of the intended initial file structure:

|- pystatic.py
|- build.py
|- CONFIG
|- LICENSE
|-
|- templates/
|-- index.html
|-- post.html
|-- css/
|--- style.css
|-- lib/
|--- (empty by default) any additional scripts you might need
|-- assets/
|--- (empty by default) whatever additional files you need
|--- ...
|-
|- posts/
|-- 2018-03-12_best_title.md
|-- ...
|
|- site/
|-- index.html
|-- posts/
|--- 2018-03-12_best_title.html
|--- ...
|-- css/
|--- style.css
|-- assets/
|-- lib/

POSSIBLE BUG: CONFIG file called as config

When testing out the recently added (and very spiffy) CONFIG file, I had a small issue where build.py was not able to locate CONFIG. This appears to be a simple case sensitivity issue, where CONFIG could be renamed lower case 'config'. Conversely, the script could call upper case CONFIG for file input.

Steps to reproduce:

  • Install, configure and prepare to run pystatic
  • Execute python build.py
  • Observe error like:

user:$ python build.py
Traceback (most recent call last):
File "build.py", line 36, in
build_website(parse_config("config")[0], **parse_config("config")[1])
File "/devpath/to/pystatic/pystatic.py", line 227, in parse_config
cfg_file = open(filename, "r")
FileNotFoundError: [Errno 2] No such file or directory: 'config'

images issues

firstly, markdown image embeds don't seem to be working but maybe that's fine, html <img> tag works. But relative links only work either in the post view or in the index, but not both.

If I include <img src=../assets/image.jpg> in a .md post, that image will show in the posts/blogpost.html but in the index it shows as not working since from where the index is it should link to <img src=assets/image.jpg> instead.

A solution is obviously to use hardlinks but would be cool for relative links to be parsed and rendered right in both places.

Or perhaps I'm doing something wrong! ;)

Tried to copy contents of templates /assets folder but the folder does not exist!

I cloned the repo and set up a basic demo of the app. I found one glitch while setting up.

During set up, I ran into this error message when running build.py for the first time:

(ENV) โžœ pystatic git:(master) โœ— python build.py
Tried to copy contents of templates /assets folder but the folder does not exist! Make one, even empty!

I was able to debug simply by tracing pystatic.py to line 249, where it appears a forward slash is missing from the path concatenation. Fixed locally as follows:

    try:
        copytree(css_and_assets_path + "assets", "site/assets")
    except:
        print("Tried to copy contents of", css_and_assets_path, "/assets folder but the folder does not exist! Make one, even empty!")

should have a slash before assets, otherwise build.py doesn't find the assets folder

try:
        copytree(css_and_assets_path + "/assets", "site/assets")
    except:
        print("Tried to copy contents of", css_and_assets_path, "/assets folder but the folder does not exist! Make one, even empty!")

QUESTION: Any Ideas for Pages / Navigation?

Hello: thank you so much for releasing this tool. It is quite efficient and great for getting a quick blog started.

I'm reading the code and contemplating adding an navigation generator for multiple pages. Would like to know if there is any development code already in place or considered for such a feature.

PS thank you for attending to the small typo bug issue I submitted. Very cool of you. ๐Ÿ‘ ๐Ÿ’ฏ ๐Ÿ‘

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.