Live data from Hacker News

Show HN: Makesite – A static site generator in 125 lines of Python

github.com

21–30 of 63 posts

Re: Show HN: Makesite – A static site generator in 125 lines of Python

#21
post #19

Personally, I used Jekyll for a while before switching to a simple Makefile based approach. I write everything in Markdown, which gets compiled via Pandoc, concatenated with a header and footer. I also recently started using pygments to generate colorized inline HTML to syntax highlight code blocks. If anyone is interested, I wrote up the process[1], although I have not updated the post with the pygments script yet.…

I do something similar, except with a `bash` script and hand writing the titles + dates. I thought about automating that, but work in different time zones so prefer to choose. One thing I might have of interest to you is a small DNT (DoNotTrack) JS file [1] and some CSS that adds some visual markdown features to the page after the fact [2]. P.S. Your output looks like it's missing ` ` and other tags? And how are you…

Since I may not have time to update my article for a while, here is a link to the script[1].

I am unclear on your dnt script? What does it do? I don't have any facilities on my site to track users at all as it stands.

I will probably be mooching parts of your CSS though, thanks for posting it here!

Edit: you are correct, I seem to have forgotten to include tags... I should probably fix that.

[1] https://gist.github.com/charlesdaniels/ac5fa6e3e77aef5ff5c85...

Re: Show HN: Makesite – A static site generator in 125 lines of Python

#22
This is cool, and if I had the time I'd want to do something like this for automatically generating a google-photos style site from my Pictures directory.

Also, if you're looking for a stable Python-based static site generator... I've been pretty happy with Pelican (https://blog.getpelican.com/).

Re: Show HN: Makesite – A static site generator in 125 lines of Python

#23
how stupid is to measure code in terms of lines?

Make all that a library then you can claim:

A static site generator in only 3 lines of Python

Measuring lines of codes is completely wrong. See the Scala trend were people race to find the shortest way to express something generating hard to understand code. 1) Code has to be written to be maintenable. 2) Code has to be written to be read by your coworkers. 3) The bottleneck while coding is not the keyboard.

Re: Show HN: Makesite – A static site generator in 125 lines of Python

#25

Earlier quoted context omitted.

You can even go more minimalist. An empty file is a site too.

Still takes one line, but it would be smaller in size touch i

No need to use such a bloated tool as "touch" to create a site. Your shell can do it:

  > index.html
And there's ofcourse:

   index.html
  
  

hello, world! from $(whoami)

eof
See also: m4.

Re: Show HN: Makesite – A static site generator in 125 lines of Python

#27
post #23

how stupid is to measure code in terms of lines? Make all that a library then you can claim: A static site generator in only 3 lines of Python Measuring lines of codes is completely wrong. See the Scala trend were people race to find the shortest way to express something generating hard to understand code. 1) Code has to be written to be maintenable. 2) Code has to be written to be read by your coworkers. 3) The bott…

[deleted]

Re: Show HN: Makesite – A static site generator in 125 lines of Python

#30
post #23

how stupid is to measure code in terms of lines? Make all that a library then you can claim: A static site generator in only 3 lines of Python Measuring lines of codes is completely wrong. See the Scala trend were people race to find the shortest way to express something generating hard to understand code. 1) Code has to be written to be maintenable. 2) Code has to be written to be read by your coworkers. 3) The bott…

Unless you have put effort into squeezing as much logic as possible into each line, the less code the easier it is to maintain. With more code, more stuff can go wrong. It's not just because we are bad at writing code, we have probability against us. If the bug average is 1 bug per 100 LOC then 100 LOC will have less bugs then 10k LOC. We also have physics against us, reading and comprehending 10k LOC of code will take much longer then reading 100 LOC. With that said I do agree with you that LOC don't say much about anything. It's a stupid metric. With higher level languages, a 100 LOC file might actually be millions LOC if you include all the libraries. Them being libraries means they are mostly decoupled, which makes things better, because coupling is the root of most complexity.
Post reply on HN