Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ac3d9aeb2d | |||
c312622fb1 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartsitemap",
|
"name": "@pushrocks/smartsitemap",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartsitemap",
|
"name": "@pushrocks/smartsitemap",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a sitemap module",
|
"description": "a sitemap module",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { SitemapNews } from './smartsitemap.classes.sitemapnews';
|
import { SitemapNews } from './smartsitemap.classes.sitemapnews';
|
||||||
|
import { SitemapWebsite } from './smartsitemap.classes.sitemapwebsite';
|
||||||
import * as plugins from './smartsitemap.plugins';
|
import * as plugins from './smartsitemap.plugins';
|
||||||
|
import * as interfaces from './interfaces';
|
||||||
|
|
||||||
export class SmartSitemap {
|
export class SmartSitemap {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
@ -17,6 +19,14 @@ export class SmartSitemap {
|
|||||||
* creates a normal sitemap from a list of urls
|
* creates a normal sitemap from a list of urls
|
||||||
*/
|
*/
|
||||||
public async createSitemapFromYmlString(yamlString: string) {
|
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'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user