How to use the sitemap.EnumChangefreq.ALWAYS function in sitemap

To help you get started, we’ve selected a few sitemap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github surmon-china / nodepress / src / modules / sitemap / sitemap.service.ts View on Github external
@Injectable()
export class SitemapService {

  private xmlFilePath = path.format({
    dir: path.join(APP_CONFIG.APP.FRONT_END_PATH, 'static'),
    name: 'sitemap',
    ext: '.xml',
  });

  private pagesMap = [
    { url: APP_CONFIG.APP.URL, changefreq: EnumChangefreq.ALWAYS, priority: 1 },
    { url: urlMap.getVlogPageUrl(), changefreq: EnumChangefreq.MONTHLY, priority: 1 },
    { url: urlMap.getAboutPageUrl(), changefreq: EnumChangefreq.MONTHLY, priority: 1 },
    { url: urlMap.getSitemapPageUrl(), changefreq: EnumChangefreq.ALWAYS, priority: 1 },
    { url: urlMap.getGuestbookPageUrl(), changefreq: EnumChangefreq.ALWAYS, priority: 1 },
  ];

  private sitemap: Sitemap;
  private sitemapCache: ICacheIoResult;

  constructor(
    private readonly cacheService: CacheService,
    @InjectModel(Tag) private readonly tagModel: TMongooseModel,
    @InjectModel(Article) private readonly articleModel: TMongooseModel<article>,
    @InjectModel(Category) private readonly categoryModel: TMongooseModel,
  ) {
    this.sitemapCache = this.cacheService.promise({
      ioMode: true,
      key: CACHE_KEY.SITEMAP,
      promise: this.queryAndWriteToFile.bind(this),
    });</article>
github surmon-china / nodepress / src / modules / sitemap / sitemap.service.ts View on Github external
import { TMongooseModel } from '@app/interfaces/mongoose.interface';
import { Category } from '@app/modules/category/category.model';
import { Article } from '@app/modules/article/article.model';
import { Tag } from '@app/modules/tag/tag.model';

@Injectable()
export class SitemapService {

  private xmlFilePath = path.format({
    dir: path.join(APP_CONFIG.APP.FRONT_END_PATH, 'static'),
    name: 'sitemap',
    ext: '.xml',
  });

  private pagesMap = [
    { url: APP_CONFIG.APP.URL, changefreq: EnumChangefreq.ALWAYS, priority: 1 },
    { url: urlMap.getVlogPageUrl(), changefreq: EnumChangefreq.MONTHLY, priority: 1 },
    { url: urlMap.getAboutPageUrl(), changefreq: EnumChangefreq.MONTHLY, priority: 1 },
    { url: urlMap.getSitemapPageUrl(), changefreq: EnumChangefreq.ALWAYS, priority: 1 },
    { url: urlMap.getGuestbookPageUrl(), changefreq: EnumChangefreq.ALWAYS, priority: 1 },
  ];

  private sitemap: Sitemap;
  private sitemapCache: ICacheIoResult;

  constructor(
    private readonly cacheService: CacheService,
    @InjectModel(Tag) private readonly tagModel: TMongooseModel,
    @InjectModel(Article) private readonly articleModel: TMongooseModel<article>,
    @InjectModel(Category) private readonly categoryModel: TMongooseModel,
  ) {
    this.sitemapCache = this.cacheService.promise({</article>