
Makesite.py – Simple, lightweight, and magic-free static site/blog generator - staticwebdev
https://github.com/sunainapai/makesite
======
brenden2
Cool, but I'm so tired of Python that I've started to avoid any projects
written with it. Dealing with dependencies, 2 vs. 3, pip, virtualenv, etc is
such a pain.

I think the Java/Go/Rust model where all dependencies are included in the
binary is the way to go.

~~~
idoubtit
In my opinion, the worst problem is the lack of a standard way to handle
dependencies. I recently had a hard time deploying a small Python project over
a few heterogeneous Linux machines.

For example, this "simple, lightweight" program has dependencies, as one can
see in its .travis.yaml file. That's why the readme has the command `pip
install commonmark` (plus more dependencies for dev). But, wait, doesn't `pip`
install as root in /usr/local/ by default? (BTW, the documentation of `pip
install` is mute on the subject.) So I should use pipenv, but last time I
tried it was broken and the ticket had low activity. So virtualenv + pip, but
it's a mess since I like using many terminals. I've heard about poetry, but
that's not standard at all...

~~~
jacquesm
Python deployment is a shitshow. Unfortunately mission critical stuff (looking
at you letsencrypt) is also written in it which means that your systems are
built on very shaky foundations.

~~~
kalia35
What ? This seems like a bold affirmation. I find it very simple actually :

    
    
      apt install python3 virtualenv
      virtualenv env
      . env/bin/activate
      pip install -r requirements.txt
    

Done. And then with fabric you can automate deployments in a few lines of
codes !

~~~
jacquesm
Right up until it nukes your perfectly working server.

The happy case works, it always does. The problem is in the edge cases and the
exceptions. This probably goes for the bulk of all software.

~~~
kalia35
Well in ten years I have never had a nuked server by pip or virtualenv. I am
sure there are edge cases but that must be true for all the ways of deploying
stuff. I guess the ones you know well appear simple to you !

~~~
jacquesm
I've had a production server be hosed by running 'letsencrypt-auto'. My bad I
guess but still, that's one that I really did not see coming.

~~~
StavrosK
I kind of agree with both of you. I don't think Python deployment is _that_
bad, as most modern managers get it right (I prefer Poetry nowadays). However
something like letsencrypt-auto, which AFAIK installs its own dependencies, is
not something I'd run. I've actually never used it precisely because it's too
magical. Programs shouldn't install their own dependencies anywhere outside of
a virtualenv.

~~~
jklehm
Have you heard of our Lord and Savior pipx? Solves the python tool isolation
issue nicely.

~~~
StavrosK
I haven't used it, I use virtualfish which does a great job as well.

~~~
jklehm
Virtualfish is new to me, will check it out thanks.

~~~
StavrosK
And it turned out that pipx wasn't what I thought it was, so thank you as
well! Though virtualfish is only useful if you use the fish shell.

------
dmortin
Are static site generators only for small sites? E.g. if there is a site with
100,000 pages and the site owner wants to change something in the template
(adding something to the sidebar, or footer, etc.) then does he have to
regenerate and redeploy all the 100,000 pages every time when he makes a
global change?

~~~
softwaredoug
Based on our experience (n=1) I would say, yes, it works best for small sites.
We have a medium site with on the order of 1000s of pages. Jekyll has become a
bit unwieldy to rebuild a full static version of the site (takes about 5 mins
for a full rebuild). I would certainly say an order of magnitude higher we’d
definitely want server side Wordpress or similar.

~~~
dikaio
5 minute+ rebuilds are enough to move you to WordPress? 5 minute rebuilds does
seem high but the benefits you get with static site generators (security, push
“anywhere”, performance, etc) far outweigh having to manage everything else
coming with a wordpress site. I suppose if you and your team are pushing new
articles multiple times a day the builds could become annoying but even then
I’d build/deploy and go grab a cup of joe; come back all done

~~~
softwaredoug
There’s more to it than that. It’s also that our marketing team can understand
and work with Wordpress. Static site generators are still the domain of
“developer websites”

Taking 5 minutes to build frankly is more a reason our developers give in and
say “meh whatever the marketing team wants, just point me at a place to blog”.

~~~
datashaman
[https://github.com/planetjekyll/awesome-jekyll-
editors](https://github.com/planetjekyll/awesome-jekyll-editors)

------
jjjbokma
Nice, I wrote a simple, lightweight and magic-free static site/blog generator
as well [0]. Example site: [http://plurrrr.com/](http://plurrrr.com/)

[0] [https://github.com/john-bokma/tumblelog](https://github.com/john-
bokma/tumblelog)

------
x3haloed
Crap. You beat me to it!
[https://github.com/x3haloed/afsw](https://github.com/x3haloed/afsw)

------
welder
Good job, but why would I use this when it takes less code and less time than
it takes to read Makesite.py source code, to build my own with Jinja2 [1],
PyQuery [2], markdown2 [3]?

Python is so easy and powerful there's no need for a static site generator.

[1]:
[https://jinja.palletsprojects.com/en/2.10.x/](https://jinja.palletsprojects.com/en/2.10.x/)

[2]: [https://pythonhosted.org/pyquery/](https://pythonhosted.org/pyquery/)

[3]:
[https://pypi.org/project/markdown2/](https://pypi.org/project/markdown2/)

------
m000
I don't want to bash or put down anyone, but frankly I don't see any point
with Makesite.py. But, why do we have a toy project that openly admits that it
reinvents the wheel on the first page of HN?

Makesite.py is "sold" as an alternative to Jekyll for people who prefer
Python. Yet, it completely fails to mention Pelican [1]. Why should I bother
with this instead of going with the featureful and well-tested Pelican?

[1]
[https://github.com/getpelican/pelican](https://github.com/getpelican/pelican)

~~~
foo101
> Makesite.py is "sold" as an alternative to Jekyll for people who prefer
> Python.

That's a really strange argument to make. If you see the README, it mentions,
"But then did you yearn to use something even simpler to generate your blog?
Do you like Python? Perhaps the thought of writing your own static site
generator crossed your mind but you thought it would be too much work? If you
answered "yes" to these questions, then this project is for you."

Makesite.py is being presented as a do-it-yourself blogging solution with
makesite.py serving as a good starting point to start hacking. It is very
different from Jekyll. How does it make sense to mention Pelican which is, if
anything, similar to Jekyll and not similar to Makesite.py?

~~~
m000
In fact I have written more than one DIY static site generators for small
sites in the distant past. The bottom line of my experience was: they don't
worth the effort. You will start missing features sooner than you think, and
it will be entirely up to you to implement them from scratch. Instead of
actually adding content to your site, you'll end up adding features to your
feature-strapped hack.

In the presence of excellent tools like Jekyll or Pelican that are also fairly
easy to use and extend, I'd need a concrete use-case before going DIY. If
there is no concrete use-case, the DIY static generators is just another
version of the "not invented here" syndrome. Just my 2¢.

~~~
foo101
There is no one-size-fits-all solution. Some people prefer full-blown feature-
rich static site generators like Jekyll or Pelican or Hugo. Some people like
to write their own minimal static site generator. To each their own.

