antwar
Version:
A static site engine built with React and Webpack
22 lines (19 loc) • 386 B
JavaScript
module.exports = function parseUrl(section, sectionName, fileName) {
if (
section.paths &&
section.paths[sectionName] &&
section.paths[sectionName].url
) {
return section.paths[sectionName].url({
sectionName,
fileName,
});
}
if (section.url) {
return section.url({
sectionName,
fileName,
});
}
return `/${fileName}`;
};