mirror of
https://github.com/BradNut/personal-website-sveltekit
synced 2025-09-08 23:20:18 +00:00
Remove commented out code.
This commit is contained in:
parent
17b5325ec4
commit
6013181aa1
2 changed files with 0 additions and 14 deletions
|
|
@ -38,14 +38,12 @@ export async function fetchArticlesApi(
|
||||||
since: `${pageQuery.since}`,
|
since: `${pageQuery.since}`,
|
||||||
page: `${pageQuery.page}`
|
page: `${pageQuery.page}`
|
||||||
});
|
});
|
||||||
// console.log(`Entries params: ${entriesQueryParams}`);
|
|
||||||
|
|
||||||
if (USE_REDIS_CACHE) {
|
if (USE_REDIS_CACHE) {
|
||||||
const cached = await redis.get(entriesQueryParams.toString());
|
const cached = await redis.get(entriesQueryParams.toString());
|
||||||
|
|
||||||
if (cached) {
|
if (cached) {
|
||||||
const response = JSON.parse(cached);
|
const response = JSON.parse(cached);
|
||||||
// console.log('Cache hit!');
|
|
||||||
const ttl = await redis.ttl(entriesQueryParams.toString());
|
const ttl = await redis.ttl(entriesQueryParams.toString());
|
||||||
|
|
||||||
return { ...response, cacheControl: `max-age=${ttl}` };
|
return { ...response, cacheControl: `max-age=${ttl}` };
|
||||||
|
|
@ -84,14 +82,7 @@ export async function fetchArticlesApi(
|
||||||
const { _embedded, page, pages, total, limit } = await pageResponse.json();
|
const { _embedded, page, pages, total, limit } = await pageResponse.json();
|
||||||
const articles: Article[] = [];
|
const articles: Article[] = [];
|
||||||
|
|
||||||
// do {
|
|
||||||
// nbEntries += entries._embedded.items.length;
|
|
||||||
// console.log(`number of articles fetched: ${_embedded.items.length}`);
|
|
||||||
_embedded.items.forEach((article: WallabagArticle) => {
|
_embedded.items.forEach((article: WallabagArticle) => {
|
||||||
// if (articles?.length === +WALLABAG_MAX_ARTICLES) {
|
|
||||||
// console.log('Reached 30 articles');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
const rawTags = article?.tags?.map((tag) => tag.slug);
|
const rawTags = article?.tags?.map((tag) => tag.slug);
|
||||||
if (intersect(rawTags, Object.values(ArticleTag))?.length > 0) {
|
if (intersect(rawTags, Object.values(ArticleTag))?.length > 0) {
|
||||||
const tags = rawTags.map((rawTag) => rawTag as unknown as ArticleTag);
|
const tags = rawTags.map((rawTag) => rawTag as unknown as ArticleTag);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import satori from 'satori';
|
|
||||||
import { Resvg } from '@resvg/resvg-js';
|
|
||||||
import { html as toReactNode } from 'satori-html';
|
|
||||||
import FiraSansSemiBold from '$lib/fonts/FiraSans-SemiBold.ttf';
|
|
||||||
import SocialImageCard from '$lib/components/socialImageCard.svelte';
|
import SocialImageCard from '$lib/components/socialImageCard.svelte';
|
||||||
import { dev } from '$app/environment';
|
|
||||||
import { componentToPng } from '$root/lib/renderImage';
|
import { componentToPng } from '$root/lib/renderImage';
|
||||||
|
|
||||||
const height = 630;
|
const height = 630;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue