fix(core): update
This commit is contained in:
parent
89829b84f4
commit
c312622fb1
@ -1,5 +1,7 @@
|
||||
import { SitemapNews } from './smartsitemap.classes.sitemapnews';
|
||||
import { SitemapWebsite } from './smartsitemap.classes.sitemapwebsite';
|
||||
import * as plugins from './smartsitemap.plugins';
|
||||
import * as interfaces from './interfaces';
|
||||
|
||||
export class SmartSitemap {
|
||||
constructor() {}
|
||||
@ -17,6 +19,14 @@ export class SmartSitemap {
|
||||
* creates a normal sitemap from a list of urls
|
||||
*/
|
||||
public async createSitemapFromYmlString(yamlString: string) {
|
||||
const yamlObject = await plugins.smartyaml.yamlStringToObject(yamlString);
|
||||
const yamlObject: interfaces.ISitemapYaml = await plugins.smartyaml.yamlStringToObject(yamlString);
|
||||
const sitemapWebsite = new SitemapWebsite();
|
||||
for(const urlArg of yamlObject.daily) {
|
||||
sitemapWebsite.addUrl({
|
||||
url: urlArg,
|
||||
timestamp: Date.now() - 10000,
|
||||
frequency: 'daily'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user