sqlitebrowser / website

The sqlitebrowser.org website. Created using Hugo & blogdown.
1 stars 7 forks source link

Help running blogdown #22

Closed richb-hanover closed 2 months ago

richb-hanover commented 2 months ago

OK - you've thrown down the gauntlet... :-)

I'm new to blogdown, and the README's instructions ("...install Blogdown and point it at a local copy of this repository. It should work pretty automatically.") don't quite do it for me. Some questions:

Many thanks!

justinclift commented 2 months ago

Heh Heh Heh

Blogdown is basically Hugo, a static website generator.

We use a somewhat older version of it (0.111.3), and the output generated by this version is slightly different to newer releases (which can throw off git a bit): https://github.com/sqlitebrowser/website/pull/20#issue-2068737125

So, probably best to just install that specific version of Hugo and go from there?

The "Bookdown" thing is an extension of Hugo to include R Studio extras.

That turned out to be a bad idea :facepalm:, and we never ended up using any of that R stuff, so standard Hugo still works fine with the website.

I'll get those commands worked out for you shortly. Just started my day and realised I still need to get coffee/food. :smile:

richb-hanover commented 2 months ago

Before you spend too much time rummaging around for commands, I want to say that I have made some progress, both toward generating an updated site, and to building a Docker container that lets me run this stuff without installing anything on my computer. (Especially stuff that might conflict with anything else I have installed...)

I pushed a draft PR to my repo at: https://github.com/richb-hanover/sqlitebrowser-website I would ask you to read the README that I tweaked to talk about commands to generate the site.

Your note about Hugo versions is interesting: that project doesn't have a good track record of maintaining backward compatibility... The Docker container I'm using at the moment uses Hugo 0.83.1 (I think the DB4s site might be on 0.111.3). I think it would be straightforward to make the Docker container match.

Anyway, I would appreciate any comments you have about the README, and about the form of the two new blog posts (3.13-rc1 and "Rich's Post" that obviously has bogus content...). Or anything else you notice.

Thanks.

PS No rush here - it's getting late (NH, USA) so I won't look until tomorrow at best.

justinclift commented 2 months ago

k, so first things first, install the version of Hugo we use. :smile:

You can grab prebuilt binaries from here, or compile it yourself.

Would you supply a command that I can use to run blogdown from the command line?

Yep. With the hugo binary in your path, you run this to generate the static site from the input files (markdown + theme):

$ hugo

:grin:

is there a command that'll watch the source files and refresh after a change?

Yep. The above command just generates the output files, useful for committing to git and deploying to the actual website.

In addition to that there's also a "preview" mode kind of thing, where it starts a local web server and generates the content (in memory only) on the fly:

$ hugo server
Start building sites … 
hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192 linux/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio

                   | EN   
-------------------+------
  Pages            | 154  
  Paginator pages  |   0  
  Non-page files   |   0  
  Static files     |  54  
  Processed images |   0  
  Aliases          |   0  
  Sitemaps         |   1  
  Cleaned          |   0  

Built in 77 ms
Watching for changes in /home/debian/website/{content,static,themes}
Watching for config changes in /home/debian/website/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

And is there documentation that describes which directory is the source files and where the output goes?

When you're happy with the result, commit all of it (content + docs) and make a PR from that.

We deploy to our website by simply doing a "git pull" into an Nginx directory and serving the docs directory.

justinclift commented 2 months ago

Heh Heh Heh, near simultaneous timing there. :wink:

Looking at your repo now. :smile:

richb-hanover commented 2 months ago

Looking at your repo now. 😄

Check the "new-blog-posts" branch... Thanks

justinclift commented 2 months ago

Cool, that's a really, really good start.

I've left a bunch of individual comments in things on the two commits in there (at the time of writing this).

Thanks for getting yourself set up and having a go at this. :smile:

richb-hanover commented 2 months ago

Good news. I found a much simpler Hugo-only container that works perfectly. (And it's 0.111.3). It's documented in the README.

I also tweaked the Home page and the two blog postings to be closer to what I would expect to see. (Our edits crossed in the aether...) I'll look in the morning (or maybe evening) tomorrow. THANKS!

justinclift commented 2 months ago

Cool, all good. :smile:

richb-hanover commented 2 months ago

I'm happy to close this in favor of PR #23 that backs away from blogdown in favor of Hugo, and especially running it in a Docker container.

justinclift commented 2 months ago

Sorry for the delay, it's been an interesting last few days personally speaking. Haven't had as much focus and spare time as normal.

Should be able to get your contributions done today too. :smile:

justinclift commented 2 months ago

... and didn't manage to get to it yesterday. It's on the list for today though. :smile:

richb-hanover commented 2 months ago

No rush. Thanks