diff --git a/.vscode/settings.json b/.vscode/settings.json index d88496d7..d9dfd3ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -25,7 +25,7 @@ "tslint.enable": true, "eslint.enable": false, "jest.autoEnable": false, - "typescript.tsdk": "node_modules\\typescript\\lib", + "typescript.tsdk": "node_modules/typescript/lib", "[handlebars]": { "editor.formatOnSave": false } diff --git a/CHANGELOG.md b/CHANGELOG.md index 27e71b8f..643210da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ +## 4.1.4 + +- Update copyright date +- Fix lens name normalization +- Fix post category icon +- Increase post cache capacity + ## 4.1.3 -- Use secure YouTube link +- Use secure YouTube link ## 4.1.2 @@ -8,7 +15,7 @@ ## 4.1.1 -= Fix Mapbox pin image reference to use HTTPS +- Fix Mapbox pin image reference to use HTTPS ## 4.1.0 diff --git a/package.json b/package.json index ea17cdfe..e7a9ffcb 100644 --- a/package.json +++ b/package.json @@ -56,11 +56,11 @@ "gulp-typescript": "^4.0.0", "gulp-uglify": "^3.0.0", "merge2": "^1.2.0", - "nodemon": "^1.8.0", + "nodemon": "^1.18.0", "through2": "^2.0.3", "ts-node": "^7.0.0", "tslint": "^5.10.0", - "typescript": "^2.9.0", + "typescript": "^3.0.0", "vinyl": "^2.2.0" }, "repository": { diff --git a/src/app.ts b/src/app.ts index 683ab8cf..d007937a 100644 --- a/src/app.ts +++ b/src/app.ts @@ -26,6 +26,9 @@ export function configureModels() { modelConfig.maxPhotoMarkersOnMap = config.providers.map.maxMarkers; modelConfig.providers.post = postProvider; modelConfig.providers.map = mapProvider; + modelConfig.artistsToNormalize = new RegExp( + config.posts.artistNames.join('|') + ); } async function createWebService() { @@ -56,10 +59,15 @@ async function createWebService() { app.use(Express.static(path.join(root, 'public'))); await blog.load(); - // blog must be loaded before routes are defined - route.standard(app); - app.listen(port); - log.info(`Listening on port ${port}`); + + if (blog.loaded) { + // blog must be loaded before routes are defined + route.standard(app); + app.listen(port); + log.info(`Listening on port ${port}`); + } else { + log.error('Blog data failed to load. Stopping application.'); + } } } diff --git a/src/config/post-provider.ts b/src/config/post-provider.ts index e331c178..96b13ed6 100644 --- a/src/config/post-provider.ts +++ b/src/config/post-provider.ts @@ -39,6 +39,8 @@ export const postProvider: ProviderConfig = { ], maxRetries: 10, retryDelay: 300, + useCache: true, + maxCacheSize: 500, auth: { apiKey: env('FLICKR_API_KEY'), secret: env('FLICKR_SECRET'), diff --git a/src/config/providers.ts b/src/config/providers.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/src/views/html.ts b/src/views/html.ts index d955bb9c..c9c29daa 100644 --- a/src/views/html.ts +++ b/src/views/html.ts @@ -192,18 +192,16 @@ function categoryIcon(title: string): string { * HTML tag for mode of travel category icon. */ function travelModeIcon( - categories: string[] | { [key: string]: Category } + categories: Map | Map ): string { const icons = config.style.icon; const map = icons.mode; + const categoryNames = Array.from(categories.keys()); - if (!is.array(categories)) { - categories = Object.keys(categories); - } if (is.value(map)) { const iconName = Object.keys(map).find(iconName => { const re = map[iconName]; - return (categories as string[]).find(c => re.test(c)) !== undefined; + return categoryNames.find(c => re.test(c)) !== undefined; }); if (is.value(iconName)) { diff --git a/views/partials/footer.hbs b/views/partials/footer.hbs index 4b8acbe2..dbb6a2be 100644 --- a/views/partials/footer.hbs +++ b/views/partials/footer.hbs @@ -1,5 +1,5 @@