jsonresume / jsonresume.org

The mono repo that builds the homepage, utils, ui components, registry and anything else
https://jsonresume.org
68 stars 18 forks source link

Add `?theme=random` to registry #7

Open alifeee opened 11 months ago

alifeee commented 11 months ago

It would be useful to be able to visit

https://registry.jsonresume.org/thomasdavis?theme=random

and it redirect you to a random theme.

This could be as simple as making ?theme=random a special endpoint, and returning something like

<!DOCTYPE html>
<html lang="en">
  <head>
    <script>
      // redirect
      options = ["kendall", "onepage", "simple"];

      window.location.href =
        "https://registry.jsonresume.org/thomasdavis?theme=" +
        options[Math.floor(Math.random() * options.length)];
    </script>
  </head>
</html>
thomasdavis commented 10 months ago

I like this idea, will do.

levino commented 9 months ago

I think the random choice of the random theme should and can easily be done on the server side.