generated from polymech/site-template
howto basics :)
This commit is contained in:
@@ -4,6 +4,7 @@ import { PuppeteerUrlChecker, FetchUrlChecker, checkUrl, UrlCheckResult, clean }
|
||||
describe('URL Checker', () => {
|
||||
// Test URLs
|
||||
const validUrl = 'https://backend.orbit.dtu.dk/ws/portalfiles/portal/278424474/Bertelsen_et_al_2022.pdf';
|
||||
const validUrl_ = 'https://dl.asminternational.org/technical-books/edited-volume/157/Extrusion';
|
||||
const invalidUrl = 'https://example.com/404';
|
||||
const timeoutUrl = 'https://example.com/timeout';
|
||||
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ import {
|
||||
} from "config/config.js"
|
||||
|
||||
|
||||
const NB_ITEMS = 50
|
||||
const NB_ITEMS = 250
|
||||
|
||||
import { env, logger } from '@/base/index.js'
|
||||
|
||||
@@ -111,7 +111,7 @@ export const asset_local_rel = async (item: IHowto, asset: IImage) => {
|
||||
const sanitizedFilename = sanitizeFilename(asset.name).toLowerCase()
|
||||
const asset_path = path.join(HOWTO_ROOT(), item.slug, sanitizedFilename)
|
||||
if (exists(asset_path)) {
|
||||
return `/resources/howtos/${item.slug}/${sanitizedFilename}`
|
||||
return asset_path//`/resources/howtos/${item.slug}/${sanitizedFilename}`
|
||||
} else {
|
||||
await download(asset.downloadUrl, asset_path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user