Skip to content

Commit

Permalink
use liquid for parsing the cover url
Browse files Browse the repository at this point in the history
  • Loading branch information
bjesus committed Nov 26, 2024
1 parent be2ffa0 commit b20552f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ const appConfig = useAppConfig();
import { createDbWorker } from "sql.js-httpvfs";
import { useLocalStorage } from "@vueuse/core";
import { getFile, saveFile } from "./indexdb";
import { Liquid } from "liquidjs";
const liquid = new Liquid();
useHead({
title: appConfig.title,
Expand Down Expand Up @@ -184,12 +186,7 @@ const setResults = (books) => {
b[key] = b[columns[key]];
delete b[columns[key]];
}
b.image_url = images
.replaceAll("${id}", b.id)
.replaceAll("${md5}", b.md5)
.replaceAll("${md5_lowercse}", b.md5?.toLowerCase())
.replaceAll("${ipfs_cid}", b.ipfs_cid)
.replaceAll("${id_group}", Math.floor(b.id / 1000) * 1000);
b.image_url = liquid.parseAndRenderSync(images, b);
return b;
});
};
Expand Down
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@vueuse/core": "^11.1.0",
"liquidjs": "^10.19.0",
"lucide-vue-next": "^0.439.0",
"nuxt": "^3.13.0",
"nuxt-lucide-icons": "^1.0.5",
Expand Down

0 comments on commit b20552f

Please sign in to comment.