fixed accessibility
This commit is contained in:
parent
08b2227b22
commit
805ce53362
3 changed files with 3 additions and 6 deletions
src/data/blog
|
@ -155,15 +155,12 @@ However, there is one interesting entry there: `urls`. This is a dynamic list of
|
|||
This is where the magic snippet comes in, which 1. fetches the sitemap, 2. replaces the URLs and 3. fetches each of the URLs once to warm up the `serve` webserver to ensure that the server-caching correctly works (improves the performance by a lot).
|
||||
|
||||
```typescript
|
||||
// 1. fetch sitemap
|
||||
const sitemap = await (await fetch('http://website:8081/sitemap-0.xml')).text();
|
||||
|
||||
// 2. replace URLs
|
||||
const urls = sitemap.match(/<loc>(.*?)<\/loc>/g)!.map(
|
||||
(loc) => loc.replace(/<\/?loc>/g, '').replace(/https:\/\/firq.dev/g, 'http://website:8081')
|
||||
);
|
||||
|
||||
// 3. warm up serve
|
||||
for (const url of urls) { await fetch(url) };
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue