github pages and jekyll initial evaluation

github appears to offer free web hosting, integrated with their git service. You publish under a subdomain of github.io, or bring your own domain. To publish, you push a git repository (branch) to their service. This allows, or even requires, you to use git version control for the content. The content to be served can either be the git content directly, or it can be processed with jekyll, the static site generator, by the github service.

As service design, this is mostly pretty nice. I would be using git anyway. So instead of pushing to a centralised git repo, and then publishing, this is a single action. With the static-site generation, I’m not so sure. I don’t know what can and can’t be done with Jekyll. But there is still the option to static-site-generate on one’s own computer, and commit the output of that to the repository, and push that, not making use of the github-side Jekyll processing.

Permanent deletion is at best a pain with git, as it’s just not designed for it. So if permanent deletion of content is a requirement for the web site, github pages probably isn’t suitable.

I think the service only makes sense for completely public content, but github perhaps offer customers other versions of the service, that are suitable for proprietary content.

To get started, I’m going to create my tomgjones.github.io site, and then one under my own domain.

My username on github is tomgjones, so the domain will be tomgjones.github.io and I have to create a special repository also called tomgjones. Github pages follows the index.html convention.

I created the respository, added index.html, and pushed it. It did take a few minutes to become available under https://tomgjones.github.io/index.html. This does suffer from the usual “eventual consistency” issues of: when can I expect it to catch up, and can it please tell me that it knows it has some catching-up to process? Otherwise there’s just no feedback. I don’t know the difference between having failed to do the right thing, that will lead to the change, vs just having to wait a bit.

Jekyll does seem to lack findable tutorial or reference documentation, to learn the basics. It’s the usual open-source mess of snips of crap all over the web, with bad and complicated examples. My first attempt at following a “hello world” example had a configuration to pull in remote templating. That’s not a hello world example!

I installed jekyll on Debian 10, and then jekyll serve --watch from the content directory does start the server on localhost:4000. Rendered content seems to be put in _site. The server logs to its console (standard output / error) and it notices straight away when content changes, and has generally informative messages about its activities.

Making foo.md seems to result in rendered versions at both URLs foo and foo.html. In _site, it’s the .html file that’s there.

Let’s see if this is true for the github-hosted service, too. Coming up again against the issue of not knowing how long to wait after pushing, and not knowing whether it just hasn’t caught up yet, or I haven’t made the right change. This thing really needs feedback during the publish process.

Now it’s published, and the github-hosted page looks completely different from the local one. It has some kind of page header, and stylesheet. Looking at the html, there’s a fair bit going on in there. It even pulls in javascript from cloudfare – fuck that. If this kind of thing can happen at all, it’s not usable. It’s a big opaque shit-fest. So we can do the static-site-generation ourselves, before pushing. Do not use the github-side Jekyll stuff. Definite conclusion reached.

FTR, this was the content:


Line wrap
<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Hello World | tomgjones.github.io</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Hello World" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="trying to make github pages site" />
<meta property="og:description" content="trying to make github pages site" />
<link rel="canonical" href="https://tomgjones.github.io/foo.html" />
<meta property="og:url" content="https://tomgjones.github.io/foo.html" />
<meta property="og:site_name" content="tomgjones.github.io" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Hello World" />
<script type="application/ld+json">
{"description":"trying to make github pages site","url":"https://tomgjones.github.io/foo.html","@type":"WebPage","headline":"Hello World","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->

    <link rel="stylesheet" href="/assets/css/style.css?v=5646e8e001f8f647bd5df4eb23c7ee5ced850e7b">
    <!-- start custom head snippets, customize with your own _includes/head-custom.html file -->

<!-- Setup Google Analytics -->



<!-- You can set your favicon here -->
<!-- link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" -->

<!-- end custom head snippets -->

  </head>
  <body>
    <div class="container-lg px-3 my-5 markdown-body">
      
      <h1><a href="https://tomgjones.github.io/">tomgjones.github.io</a></h1>
      

      <h1 id="hello-world">Hello World</h1>


      
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js" integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous"></script>
    <script>anchors.add();</script>
  </body>
</html>

Comments

Popular posts from this blog

the persistent idiocy of "privileged ports" on Unix

google is giving more and more 500 errors

7 minute workout: a straightforward audio recording (and two broken google web sites)