How to use the hexo-util.full_url_for.call function in hexo-util

To help you get started, we’ve selected a few hexo-util 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 hexojs / hexo-generator-feed / test / index.js View on Github external
it('Icon (rss2)', () => {
    hexo.config.url = 'http://example.com';
    hexo.config.root = '/';

    hexo.config.feed = {
      type: 'rss2',
      path: 'rss2.xml',
      icon: 'icon.svg'
    };

    const feedCfg = hexo.config.feed;
    const result = generator(locals, feedCfg.type, feedCfg.path);
    const $ = cheerio.load(result.data);

    $('rss>channel>image>url').text().should.eql(full_url_for.call(hexo, hexo.config.feed.icon));
  });
github hexojs / hexo / test / scripts / models / category.js View on Github external
}).then(data => {
      data.permalink.should.eql(full_url_for.call(hexo, data.path));
      hexo.config.url = 'http://yoursite.com';
      return Category.removeById(data._id);
    });
  });
github hexojs / hexo / test / scripts / models / post.js View on Github external
}).then(data => {
      data.permalink.should.eql(full_url_for.call(hexo, slug));
      hexo.config.url = 'http://yoursite.com';
      return Post.removeById(data._id);
    });
  });
github hexojs / hexo / test / scripts / models / page.js View on Github external
}).then(data => {
      data.permalink.should.eql(full_url_for.call(hexo, data.path));
      hexo.config.url = 'http://yoursite.com';
      return Page.removeById(data._id);
    });
  });
github hexojs / hexo / test / scripts / models / tag.js View on Github external
}).then(data => {
      data.permalink.should.eql(full_url_for.call(hexo, data.path));
      hexo.config.url = 'http://yoursite.com';
      return Tag.removeById(data._id);
    });
  });
github hexojs / hexo / test / scripts / hexo / hexo.js View on Github external
return hexo._generate().then(() => checkStream(route.get(path),
      full_url_for.call(hexo, path)));
  });
github hexojs / hexo-generator-feed / lib / generator.js View on Github external
posts = posts.filter(post => {
    return post.draft !== true;
  });

  if (posts.length <= 0) {
    feedConfig.autodiscovery = false;
    return;
  }

  if (feedConfig.limit) posts = posts.limit(feedConfig.limit);

  let url = config.url;
  if (url[url.length - 1] !== '/') url += '/';

  let icon = '';
  if (feedConfig.icon) icon = full_url_for.call(this, feedConfig.icon);
  else if (config.email) icon = gravatar(config.email);

  const xml = template.render({
    config,
    url,
    icon,
    posts,
    feed_url: config.root + path
  });

  return {
    path,
    data: xml
  };
};
github hexojs / hexo / lib / plugins / helper / full_url_for.js View on Github external
module.exports = function(path) {
  return full_url_for.call(this, path);
};