feat: make tags route path configurable (#5545)

This commit is contained in:
Alexey Pyltsyn 2021-09-21 20:19:18 +03:00 committed by GitHub
parent ba402e9e63
commit 29e06d0677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 28 additions and 4 deletions

View file

@ -183,7 +183,13 @@ async function processBlogSourceFile(
siteDir,
i18n,
} = context;
const {routeBasePath, truncateMarker, showReadingTime, editUrl} = options;
const {
routeBasePath,
tagsBasePath: tagsRouteBasePath,
truncateMarker,
showReadingTime,
editUrl,
} = options;
// Lookup in localized folder in priority
const blogDirPath = await getFolderContainingFile(
@ -267,7 +273,11 @@ async function processBlogSourceFile(
return undefined;
}
const tagsBasePath = normalizeUrl([baseUrl, options.routeBasePath, 'tags']); // make this configurable?
const tagsBasePath = normalizeUrl([
baseUrl,
routeBasePath,
tagsRouteBasePath,
]);
const authors = getBlogPostAuthors({authorsMap, frontMatter});
return {