Live data from Hacker News

Static site generators focus on the wrong thing

blog.pankajmore.in

41–50 of 100 posts

Re: Static site generators focus on the wrong thing

#41
you can build a software service that allows one to maintain a static site in a git repo, which is then published to a host somewhere. the service can go as far as having you input the location of your git repo anywhere in the world, and the location of your hosting, whether it be an S3 bucket, rsync or FTP host, and it can then provide ordinary blog edit / workflow tools which use the git repo as persistence and the hosting location as output. The service would support any number of popular static platforms, or one of its own.

When you do this, you work with the platform as long as you want. Then you can walk away from it - all your content is in your git repo and up on your web host as though the middle layer never existed. Another service can pick up on the same task, which you then point to the same endpoints to continue. If you know how to use git and your host directly, great. If you don't, who cares, these services take care of it for you as a transparent endpoint.

In fact you could even charge money for this kind of thing. Or even make it more open ended than just blogs and web pages, but that's where my thinking got jumbled on this idea and I only got as far as buying a domain for it.

Obviously sites like medium and everyone else would never do this, because it means you can leave their platform immediately. People who are capable of executing this idea pretty much don't need it, and it's otherwise hard to monetize. The desire to lock people into things is really what ruins everything.

Re: Static site generators focus on the wrong thing

#42
post #7

Sure, but they're not called static blog generators, they're static site generators. They are specifically for people who want static sites, not specifically people who want frictionless blogging.

They should be called static blog generators because that's what they all do. You can try to finagle generic sites out of them, but all the ones I have looked at all focus on blogging. I don't want a blog generator and find this immensely irritating.

However I just found this site: http://staticsitegenerators.net/ , which is an impressiv elisting, so possibly I'll find something that fits my needs or gives me a starting point.

Re: Static site generators focus on the wrong thing

#43
post #5

Medium is NOT a blogging platform, contrary to popular belief. Blogging is owning your content, and when you write for Mediium, make no mistake, it belongs to Medium. Although, I just switched over from Wordpress to Jekyll, and I find it there to be a lot less friction for publishing. I talked more about the new and exciting workflow of Jekyll at http://rmorabia.com/redesign I really don't agree with the author here.…

I invite you to glance over the Medium Terms of Service. "You own the rights to the content you post on Medium." https://medium.com/policy/9db0094a1e0f#0fae

You own the copyright; I don't believe that's what rmorabia is talking about, though I may be mistaken.

Re: Static site generators focus on the wrong thing

#44
post #19

If your jekyll generation time is getting too large, you can limit the number of posts it generates like this: jekyll --limit_posts 3 It makes your site feel like new again :) I made this into a rake task which I blogged about here: http://scottpatten.ca/2011/11/speeding-up-jekyll-generation....

I looked at your blog post but it leaves some questions. Does this also update 'latest posts' boxes and tag clouds on all the other pages? What about the homepage? (I used OctoPress, not Jekyll but I suspect there is a way in there to use this same trick)

No, it definitely doesn't do that. I use the `limit_posts` option when I'm writing a single blog post, and then have a "rake deploy" task that re-generates the site fully (without the `limit_posts` option) before rsyncing it up to the server.

I guess I should put the full Rakefile up on that post. Here are the relevant parts:

    desc "generate and deploy"
    task :deploy => ['jekyll:generate', 'deploy:deploy']
    
    namespace :deploy do 
      task :deploy do
        `rsync -r _site/ #{USER}@#{HOST}:#{DEPLOY_DIR}/`
      end
    end
    
    namespace :jekyll do
      desc "start the jekyll server in auto mode"
      task :server, :num_posts do |t, args|
        num_posts = args[:num_posts]
        cmd = "jekyll --auto --server --pygments"
        cmd += " --limit_posts #{num_posts}" if num_posts
        puts "running #{cmd}"
        exec(cmd)
      end
    
      desc "generate the site one time"
      task :generate => :clean do
        `jekyll --no-auto --pygments`
      end
    
      desc "remove the generated site"
      task :clean do
        `rm -rf _site`
      end
    end

Re: Static site generators focus on the wrong thing

#45

I know the author said automation wasn't what they wanted, but gods below this problem begging to be automated away. 1) Only compile newly updated items. 2) git commit -am 'new post' 3) git push origin master The first step needs to be built out in the tool itself, but the rest is a simple bash script, really. It's not even something that needs to be monitored. If you did want to monitor it, it's a few simple `curl`…

Can't agree with this more. All you need is a simple rakefile[0] that does it for you. I have something like this for myself -

  prakhar1989.github.com git/master*
  $ rake
  rake default  # List tasks
  rake draft    # Create a new draft in ./_drafts
  rake post     # Create a new post in ./_posts
  rake preview  # Live Preview (use mode=drafts for drafts)
  rake publish  # Push to github
[0] - https://github.com/prakhar1989/prakhar1989.github.com/blob/m...

Re: Static site generators focus on the wrong thing

#46
I write a lot (in Japanese) on the web and have had some meaningful traffic. I think the most I got on a single day is like 150k visitors. And I've tried everything from raw HTML to SSG to Wordpress to a homegrown CMS.

The truth of the matter is, for most web writers, any CMS is plenty performant. You probably won't even need a cache, and if you end up needing one, it's usually pretty straightforward to add it. And it's pretty self-evident to me that updating one document and saving it is easier than re-generating the updated parts of your website with some script before git-this-git-that.

One good argument against CMS is security: many of them have a history of security woes. This is partly why I ended up writing my own very minimal CMS engine. All it does is read some markdown files and render them. For me, that achieves both security (or at least if not, it's easier for me to go through my 100 lines of Ruby code than the Wordpress codebase) and low friction.

Re: Static site generators focus on the wrong thing

#47
post #44

Earlier quoted context omitted.

I looked at your blog post but it leaves some questions. Does this also update 'latest posts' boxes and tag clouds on all the other pages? What about the homepage? (I used OctoPress, not Jekyll but I suspect there is a way in there to use this same trick)

No, it definitely doesn't do that. I use the `limit_posts` option when I'm writing a single blog post, and then have a "rake deploy" task that re-generates the site fully (without the `limit_posts` option) before rsyncing it up to the server. I guess I should put the full Rakefile up on that post. Here are the relevant parts: desc "generate and deploy" task :deploy => ['jekyll:generate', 'deploy:deploy'] namespace :d…

Pity! Still, thanks for the tip (I can see one usecase for which it is handy, proofreading).

Re: Static site generators focus on the wrong thing

#48

This is an argument that literally goes back to the dawn of the CMS. CMS designs tend to fall somewhere between two extremes: completely static (grinding out HTML files) and completely dynamic (generating new pages for each request). Static is appealing because it scales like crazy, but it's also unappealing because it requires a "compilation"/"rebuilding" step that gets longer and longer as your site gets bigger. Dy…

I moved my blog from Wordpress to a static site but I'm actually thinking of returning to Wordpress. Wordpress gives you comments, RSS feeds, search, categorisation and mailing list subscriptions out of the box. I'm missing those features in my static site. I don't want to outsource comments to Disqus. And there are caching techniques you can use to speed up Wordpress.

I'm guessing most of the static site generators probably fulfilled the needs of the programmer who wrote them (which is totally fine and kudos to them for releasing their work so others could benefit). However, static site generators are not what you'd call "user-friendly" (in my view) unless you're comfortable with the command line and like markdown. (Wordpress isn't particulalry user-friendly either, but more so than static site generators in my opinion.)

Re: Static site generators focus on the wrong thing

#49
post #3

I use Pelican[1] (Python) SSG and they are adding (have added?) a feature to skip articles that have not been touched. That makes compilation really fast. [1] https://github.com/getpelican/pelican

I appreciate that they have that feature, but haven't makefiles had the same feature since the late 1970s?

I love the idea of a static site generator, but they're really, really reinventing the wheel...

Re: Static site generators focus on the wrong thing

#50

I recently upgraded my Jekyll install, and I must say this beast is becoming bloated. One of the many gem packages it now requires is a JS interpreter. Why? I use an SSG because they're simple, don't require dynamic page loads and are more secure. However, the 'simple' part of this is wearing thin. Like so much of modern web software the developers only add things to it. They never remove or refactor. So you end up w…

Wait, were there days when software bloat didn't happen? I think feature creep and accompanying bloat is human nature for all time.

Hummm, I used to use three bash scripts to publish the vanity site, now its two, I just 'curate' the list of pages by adding list items.

Markdown -> script to generate a page with a header and footer and basic navigation.

Another separate script to invoke lftp to sync with remote server when ready to publish. Lftp looks after incremental updating.

In emergency, I can ssh into server and edit the html with nano. As I have shell access, I could just run the page generation script on the server I suppose.

Post reply on HN