Code Monkey home page Code Monkey logo

books.alexwlchan.net's Introduction

Hi, I'm Alex. I’m a software developer, writer, and hand crafter from the UK. πŸ‘‹

I have a mix of projects on GitHub – some stuff for my day job, some personal code.

books.alexwlchan.net's People

Contributors

alexwlchan avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

books.alexwlchan.net's Issues

Use a per-colour seed for luminosity in the header shelf images

I want a fixed seed for determinism, and I want a consistent seed to get a consistent shape – but that also means I get a consistent pattern of light/dark/dark/light/etc.

I should really use:

  • the same seed for the shape of every image (e.g. seed = 0)
  • different but consistent seed for the colour of every image (e.g. seed = colour.as_int(16))

This will be more obvious once I actually implement it.

Pass the cover dimensions to the template; use them to assist page layout

Currently I'm setting the width/height of the cover images with max-width/max-height attributes in the CSS, but this means a browser which hasn't loaded all the images will have to keep redrawing the page layout as they load in.

It's a static site! I can know what the dimensions are! If I load them and set them as width/height attributes, a browser can render the whole page when it gets the HTML, then do lazy loading of the remaining images.

Curious cat question

Hi Alex! πŸ‘‹ Great job with building your book-tracking website. I like the design and idea. However, I do have a question: What is the architecture of this project? What role does the πŸ¦€ play? I have a similar project here. Mandy is a new static-site generator built solely by me in the last two weeks. The architecture is quite simple: Mandy fetches all the info from the Mandy project directory, stores this info in a structure and generates the static site's files from this info. In the same way, what is the architecture you used for your project? I'm just curious! πŸ™ˆ

Don't break the site immediately after releasing a new version

There's a bug in the Netlify deploy process where:

  1. I push and tag a new version
  2. GitHub Actions creates the new release
  3. Netlify tries to pull vfd from that release, finds it's missing, and breaks

This is clearly suboptimal; I have to restart the build whenever this happens. For some reason Netlify interprets "build failed" as "upload an empty folder as the site", which is wrong.

Better handle a ^C when running 'vfd add_review'

$ vfd add_review
A newer version of vfd is available, please update:
https://github.com/alexwlchan/books.alexwlchan.net/releases/tag/v1.4.2
? What's the title of the book? Mah
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: OperationInterrupted', src/add_review.rs:56:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Improve the "check you're running the latest version" logic

If you run an out-of-date version of vfd, you get a helpful message:

A newer version of vfd is available, please update:
https://github.com/alexwlchan/books.alexwlchan.net/releases/tag/v1.3.3

Unfortunately this message will also appear locally if you're running a newer version than what's on GitHub, and you haven't pushed your changes yet. This is mildly annoying, and should be fixable.

Deploy the site using Netlify when I push to GitHub

Currently I can only deploy the site when running locally on a Mac that has the binaries installed. But Linux binaries are available through the GitHub releases – Netlify could download those and build the site.

This would allow me to make edits through the GitHub web interface/from an iOS device.

Decide where the 'format' field should live

Precisely because it's not read by any of the rendering code, and is just for my personal records, it's in at least two places (book.format and review.format). It's a property of the book, so I should move it there.

Netlify deploy failing when it tries to run vfd

The build is failing with the following error:

./vfd: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory

I don't think I've suddenly started pulling in libssl.so.3; it's been there for a while. What changed on 11 December?

Screenshot 2022-12-16 at 23 29 25

Review how the colour boosting works

In particular the boost filter passed to the templates. If you over-boost, the colours get washed out to white – that's not what I want. I should look at maybe boosting the saturation or something, rather than the RGB values.

Set up redirects from the old version of the site

As part of the Jekyll rewrite, I changed the URL structure from /reviews/{slug} to /{year}/{slug}.

  • This allows me to read the same book in different years
  • The /reviews/ namespace is unnecessary; there's nothing on this site except reviews

But to make sure any existing links keep working, I should create some redirects from the old URLs to the new URLs.

Use a proper Optional type for books I read at another time

I have a bunch of books that I know I read at sometime, but I don't have any more information than that. In those cases, there's no point capturing the review metadata – it will always be empty.

I should have a better way of handling this – possibly fetching those "reviews" separately, maybe even having them in a separate directory – which will make the internal code cleaner.

Provide a better error message if the Netlify CLI isn't installed

vfd 1.3.4, observe:

$ vfd deploy
Building HTML pages... done in 997ms
Syncing static files... done in 1ms
Creating thumbnail images... done in 9ms
Deploying to Netlify...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:218:86
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The actual problem is that I was running this on a laptop without the Netlify CLI, but that's not obvious from this error.

Create a more flexible contributor model

Currently I have to modify the scripts every time I add a new type of contributor; I should change it so it can accommodate new contributor types on a per-book basis.

Fix "publication_year: (null)"

There are a handful of books that have null as their publication year; this is probably a data bug that was introduced by an old version of the scripts.

I should:

  • Fix the dates in the broken files
  • Update vfd to detect these so it will warn me pro-actively

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.