Skip to content

Commit 24314b8

Browse files
committed
debug windows
1 parent e5fb373 commit 24314b8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/compiler/contentModel2/collection/enhancers/links.js

+2
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ const attachRelevantPosts = (post, posts) => {
8383
}
8484

8585
const linkPosts = (contentModel) => {
86+
console.log('linkPosts')
8687
return {
8788
...contentModel,
8889
posts: contentModel.posts.map((post) => {
8990
const category = contentModel.categories.find(cat => {
91+
console.log('links find', cat.path, post.category.path)
9092
return cat.path === post.category.path
9193
})
9294
const postInCategory = category.posts.find(p => p.path === post.path)

src/compiler/contentModel2/collection/models/post.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ const getTranscript = (metadata, localAssets) => {
3939
}
4040

4141
const getPostCategory = (fsObject, categorized) => {
42+
console.log('getPostCategory fsObject.path', fsObject.path)
4243
const pathParts = fsObject.path.split(sep)
44+
console.log('getPostCategory pathParts', pathParts)
4345

4446
const categoryName = categorized ?
45-
pathParts[1] :
47+
pathParts.slice(-2, -1)[0] :
4648
(Dictionary.lookup('defaultCategoryName') || 'Unclassified')
4749

4850
const categoryPath = pathParts.slice(0, -1).join(sep)
51+
console.log('getPostCategory categoryPath', categoryPath)
4952

5053
const categoryPermalink = makePermalink({
5154
prefix: Settings.getSettings().permalinkPrefix,

0 commit comments

Comments
 (0)