zedelghem / pystatic Goto Github PK
View Code? Open in Web Editor NEWDead 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
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
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.
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.
Post files created in Visual Studio Code are not recognized by pystatic. I don't really know why, probably a default formatting issue.
Any other text editor I tested works perfectly fine.
Since it is not a particularly troublesome issue I am leaving it as it is for now.
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/
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:
python build.py
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'
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! ;)
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!")
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.