Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pcc 1752 article url from content structure #332

Merged
merged 38 commits into from
Feb 7, 2025
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3461eb8
Renjith | Add content structure to article path
renjithvwarrier Jan 15, 2025
ebb868b
Renjith
renjithvwarrier Jan 15, 2025
d25c69e
Renjith | Fix tests and add another test to test the ability to map c…
renjithvwarrier Jan 15, 2025
6d753f7
Renjith
renjithvwarrier Jan 17, 2025
728fa37
Renjith | Add content strucutre path to nextjs-starter-approuter-ts s…
renjithvwarrier Jan 20, 2025
b776b42
Renjith | Update comments on articles url
renjithvwarrier Jan 20, 2025
f36000b
Renjith | Update tests in nextjs-starter-ts
renjithvwarrier Jan 20, 2025
ce7ae8d
Refactor site fetching in Next.js starter to remove environment varia…
renjithvwarrier Jan 20, 2025
54c4120
Renjith | Simplify return statement
renjithvwarrier Jan 20, 2025
96d9989
Renjith | Reformat utils and command.js
renjithvwarrier Jan 20, 2025
9dced14
Renjith | Export getPanthonAPIOptions using a seperate statement
renjithvwarrier Jan 20, 2025
b39c49c
Renjith | Disable codacy unnecessary blocks
renjithvwarrier Jan 20, 2025
ad577a2
Renjith | Add the codacy disable line before return
renjithvwarrier Jan 20, 2025
29ab0a1
Renjith | Add the codacy disable line before return
renjithvwarrier Jan 20, 2025
41ca572
Renjith | Add the codacy disable line before return
renjithvwarrier Jan 20, 2025
8d74ecf
Merge branch 'main' into PCC-1752-article-url-from-contentStructure
renjithvwarrier Jan 20, 2025
f2a6005
Refactor API options in Pantheon Cloud handler to remove unused type …
renjithvwarrier Jan 20, 2025
96b2b7d
Renjith | Update pnpm-lock.yal
renjithvwarrier Jan 20, 2025
e9e4c5d
Renjith | Override next to 14.2.23
renjithvwarrier Jan 20, 2025
34c6d99
Renjith | Unify babael core
renjithvwarrier Jan 20, 2025
54cd966
Renjith | Update pnpm-lock.yaml
renjithvwarrier Jan 20, 2025
d087a9c
Renjith | Update path-to-regexp
renjithvwarrier Jan 20, 2025
296165c
Renjith | Change revalidate to revalidateSeconds as per PR suggestion
renjithvwarrier Jan 21, 2025
748088c
Fix function name typo from 'doesCHildContainArticle' to 'doesChildCo…
renjithvwarrier Jan 21, 2025
fec742e
Renjith | Update the core-sdk to have the function to get article URLs
renjithvwarrier Jan 21, 2025
2c58906
Renjith | Expose the new article URL functionality functions from cor…
renjithvwarrier Jan 21, 2025
23d2759
Renjith | Change the nextjs-starter-approuter to use the new article …
renjithvwarrier Jan 21, 2025
a649bd1
Renjith | Update nextjs-starter-ts to use the new content structure u…
renjithvwarrier Jan 21, 2025
2dcda26
Renjith | Move nextjs-starter to the updated sdk utility functions
renjithvwarrier Jan 21, 2025
fd57e45
Renjith | Change revalidateSeconds to revalidate
renjithvwarrier Jan 21, 2025
a407141
Renjith | Changeset
renjithvwarrier Jan 21, 2025
767028c
Renjith | Add Changeset
renjithvwarrier Jan 21, 2025
b982134
Renjith | Force running Wix
renjithvwarrier Jan 28, 2025
8430e4e
Renjith | Force running Wix
renjithvwarrier Jan 28, 2025
b9d140c
Renjith | Fix typo in getArticlePathComponentsFromContentStructure fu…
renjithvwarrier Feb 6, 2025
44c2d59
Renjith | Improve article path and slug validation in starters
renjithvwarrier Feb 6, 2025
b746436
Renjith | Update comments for article URL generation with maxDepth de…
renjithvwarrier Feb 7, 2025
f67c167
Merge branch 'main' into PCC-1752-article-url-from-contentStructure
kevinstubbs Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renjith | Add the codacy disable line before return
renjithvwarrier committed Jan 20, 2025
commit 41ca57248a9b061468b8c37bb4ab8d9c82c4733f
3 changes: 0 additions & 3 deletions starters/nextjs-starter/lib/utils.js
Original file line number Diff line number Diff line change
@@ -87,7 +87,6 @@
function doesChildContainArticle(child, article) {
let categoryTree = [];
let contains = false;

// If the child is an article, check if it matches the article
if (child.type === "article") {
if (child.id === article.id) {
@@ -96,7 +95,6 @@
// If the child is an article, but it doesn't match the article, return false
return { contains, categoryTree };
}

// Iterate over the category and its children
for (const childOfChild of child.children) {
// If the child is another category, we need to iterate over its children
@@ -122,8 +120,7 @@
}
}
}
// codacy-disable-next-line unnecessary-block
return { contains, categoryTree };

Check notice on line 123 in starters/nextjs-starter/lib/utils.js

Codacy Production / Codacy Static Code Analysis

starters/nextjs-starter/lib/utils.js#L123

Unnecessary block.
}

export function getArticlePathFromContentStructure(article, site) {