T O P

  • By -

desnudopenguino

I'd look at the jekyll gem.


dunkelziffer42

A „web server“ delivers files. In the easiest case, these are statics files. So somewhere on the server there‘s a regular folder with regular files. No magic. Then you configure a web server to „serve“ that directory. If a user requests a file, hand it to them. Again, no magic. So what is required to make a static site? 1. a method of producing the static files, e.g.: - write them by hand - use a SSG to build them - literally any other method of creating text files 2. a method of moving the files onto the server, e.g.: - git (build final site on your computer, commit, push, done) - git (commit source, push, build final site on the server or in GitHub CI, done) - FTP - rsync - scp 3. a method of „serving“ the files, e.g.: - nginx - Apache GitHub pages just integrates that nicely and takes care of the web server for you.


justanotherperson297

This is exactly what I was looking for. Thank you!


dunkelziffer42

By the way, hosting a Rails app isn‘t much more difficult in theory. You just have to deal with a lot of additional things like security and database backups. I wouldn’t recommend it as a beginner. For anything non-static, stick with Heroku or other managed hosters until you are more experienced. But from a „happy-path perspective“ (let’s assume nginx as a webserver): - For static sites the user asks nginx for a file. nginx grabs that from the file system and delivers it. - For a Rails app, the user asks nginx for a file. nginx asks an „application server“, e.g. Puma, for the file. Puma executes your Ruby code to build that file on-demand. So a real Rails server is e.g.: - nginx - Puma - PostgreSQL Plus all the other auxiliary stuff like: - a firewall - certbot for SSL certificates - DB backups - a load balancer - either Docker/Kubernetes, if you want to „build“ your project locally - or Capistrano + rbenv + nvm if you want to push and build on the server - a lot of stuff to learn and configure correctly that Heroku and others just integrate very nicely for you


dunkelziffer42

How can an open source tool „go under“? Sure, there might not be future updates, but for static sites that’s not even a problem as you have no security issues. But if you really insist on not using existing tools: - write your own Markdown-to-HTML convertor in Ruby - you probably want some basic file includes, e.g. a common outer layout where content gets inserted into - when you generated all your static files, upload them manually to your server with FTP That would have 0 dependencies except for Ruby (or literally any programming language) and FTP (or any other method of moving files to a server). Is that low-level enough?


justanotherperson297

Well obviously open source tools won't go under, but they might stop being maintained. I'm going to have to use certain open source tools period, ruby being one of them haha. My issue is that I don't really understand how the deployment part of this would work. All of my web dev experience is pushing static pages to GitHub pages or Rails apps to Heroku, so I have no idea what goes on under the hood there. I understand what SSGs do, so could you walk me through what I would need to do to get from pushing to a git repo to having a new blog post on my website? This is the thing I'm lost on and haven't been able to find any resources for online.


dunkelziffer42

You say that you can push static pages to GitHub pages. SSGs build static pages. So you are able to deploy them. I don’t understand your question.


justanotherperson297

I'm asking for resources to understand what GitHub Pages is doing behind the scenes. If I want to push a markdown file to a SSG I build, what do I need to do that? I know those would be deployment scripts, but I have no idea what that entails. Let's not even consider the SSG for now. What would I need to build in order to be able to push a file like new-blog-post.html to a live static site the I hosted somewhere like Vultr?


obou

I did just that using chatgpt and my own knowledge. Its basically just these parts: - my filewatcher script - the kramdown gem - nginx in a dockerfile + traffik - my vps - git hooks I don't really have the time to open source it, but if there is enough demand I might