diff --git a/config/utilities/index.js b/config/utilities/index.js index 8dbc3b10..34d8eeb0 100644 --- a/config/utilities/index.js +++ b/config/utilities/index.js @@ -1,11 +1,12 @@ export const shuffleArray = array => { - for (let i = array.length - 1; i > 0; i--) { + const shuffled = [...array] + for (let i = shuffled.length - 1; i > 0; i--) { let j = Math.floor(Math.random() * (i + 1)) - let temp = array[i] - array[i] = array[j] - array[j] = temp + let temp = shuffled[i] + shuffled[i] = shuffled[j] + shuffled[j] = temp } - return array + return shuffled } export const regionNames = new Intl.DisplayNames(['en'], { type: 'region' }) diff --git a/package-lock.json b/package-lock.json index 3a55d2d3..8103e19b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "1.0.5", + "version": "1.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "1.0.5", + "version": "1.0.6", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.5.0", diff --git a/package.json b/package.json index e3099be6..991a8ca7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "1.0.5", + "version": "1.0.6", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "scripts": { diff --git a/src/pages/dynamic/watching/index.html b/src/pages/dynamic/watching/index.html index c5209a8a..be9ee38b 100644 --- a/src/pages/dynamic/watching/index.html +++ b/src/pages/dynamic/watching/index.html @@ -6,7 +6,7 @@ permalink: "/watching/index.html" updated: "now" schema: watching --- -{% assign featuredMovie = movies.recentlyWatched | shuffleArray | first %} +{%- assign featuredMovie = movies.recentlyWatched | shuffleArray | first -%}

{{ title }}

{% render "partials/media/watching/hero.liquid" movie:featuredMovie %}

Here's all of the TV and movies I've been watching presented in what is (hopefully) an organized fashion.