fix: modernize docker publishing
This commit is contained in:
@@ -3,9 +3,9 @@ import { PrerenderResult } from './rendertron.classes.prerenderresult.js';
|
||||
import * as plugins from './rendertron.plugins.js';
|
||||
|
||||
export class PrerenderManager {
|
||||
public smartssrInstance: plugins.smartssr.SmartSSR;
|
||||
public smartrobotsInstance: plugins.smartrobots.Smartrobots;
|
||||
public smartsitemapInstance: plugins.smartsitemap.SmartSitemap;
|
||||
public smartssrInstance!: plugins.smartssr.SmartSSR;
|
||||
public smartrobotsInstance!: plugins.smartrobots.Smartrobots;
|
||||
public smartsitemapInstance!: plugins.smartsitemap.SmartSitemap;
|
||||
|
||||
constructor() {}
|
||||
|
||||
@@ -31,6 +31,9 @@ export class PrerenderManager {
|
||||
return null;
|
||||
}
|
||||
);
|
||||
if (!prerenderResult) {
|
||||
return done.promise;
|
||||
}
|
||||
done.resolve(prerenderResult.renderResultString);
|
||||
return done.promise;
|
||||
}
|
||||
@@ -64,19 +67,19 @@ export class PrerenderManager {
|
||||
|
||||
public async prerenderSitemap(sitemapUrlArg: string) {
|
||||
logger.log('info', `prerendering sitemap: ${sitemapUrlArg}`);
|
||||
const parsedSitemap = await this.smartsitemapInstance.parseSitemapUrl(sitemapUrlArg);
|
||||
if (!parsedSitemap.urlset?.url) {
|
||||
const parsedSitemap = await plugins.smartsitemap.SmartSitemap.parseUrl(sitemapUrlArg);
|
||||
if (parsedSitemap.type === 'sitemapindex') {
|
||||
for (const sitemap of parsedSitemap.sitemaps) {
|
||||
await this.prerenderSitemap(sitemap.loc);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!(parsedSitemap.urlset.url instanceof Array)) {
|
||||
await this.getPrerenderResultForUrl(parsedSitemap.urlset.url.loc);
|
||||
} else {
|
||||
for (const url of parsedSitemap.urlset.url) {
|
||||
if (!url?.loc) {
|
||||
continue;
|
||||
}
|
||||
await this.getPrerenderResultForUrl(url.loc);
|
||||
|
||||
for (const url of parsedSitemap.urls) {
|
||||
if (!url?.loc) {
|
||||
continue;
|
||||
}
|
||||
await this.getPrerenderResultForUrl(url.loc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user