Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit f5b3a8b

Browse files
author
Peter Schmalfeldt
committed
Update to API Docs 24.3
1 parent 6a7156c commit f5b3a8b

File tree

8 files changed

+30
-22
lines changed

8 files changed

+30
-22
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ BUILD_ID="local"
22
NEXT_PUBLIC_GOOGLE_ANALYTICS="G-G1ER54K5N0"
33
NEXT_PUBLIC_SITE_URL="https://sfccdocs.com"
44
PORT=3000
5-
SELECTED_VERSION="23.9"
5+
SELECTED_VERSION="24.3"

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 SFCC DevOps
3+
Copyright (c) 2024 SFCC DevOps
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

bin/cmd/build-nav.mjs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ export default (cli) => {
3232
// First pass to create parents
3333
metaKeys.forEach((key) => {
3434
// Check for existing primary nav
35-
const idx = nav.findIndex((parent) => parent.title === meta[key]?.nav.parent)
35+
const idx = nav.findIndex((parent) => parent.title.trim() === meta[key]?.nav.parent.trim())
3636

3737
// Make new nav group if necessary
3838
if (idx < 0) {
3939
nav.push({
40-
title: meta[key].nav.parent,
41-
alt: `Choose a ${meta[key].nav.parent}`,
40+
title: meta[key].nav.parent.trim(),
41+
alt: `Choose a ${meta[key].nav.parent.trim()}`,
4242
href: '#',
4343
links: [],
4444
})
@@ -48,14 +48,14 @@ export default (cli) => {
4848
// Second Pass to create groups within parents
4949
metaKeys.forEach((key) => {
5050
// Check for existing primary nav
51-
const idx = nav.findIndex((parent) => parent.title === meta[key]?.nav.parent)
52-
const groupIdx = nav[idx].links.findIndex((group) => group.title === meta[key]?.nav.child)
51+
const idx = nav.findIndex((parent) => parent.title.trim() === meta[key]?.nav.parent.trim())
52+
const groupIdx = nav[idx].links.findIndex((group) => group.title.trim() === meta[key]?.nav.child.trim())
5353

5454
// Make new nav group if necessary
5555
if (groupIdx < 0) {
5656
nav[idx].links.push({
57-
title: meta[key].nav.child,
58-
alt: `${meta[key]?.nav.parent}${meta[key].nav.child}`,
57+
title: meta[key].nav.child.trim(),
58+
alt: `${meta[key]?.nav.parent.trim()}${meta[key].nav.child.trim()}`,
5959
href: '#',
6060
children: [],
6161
})
@@ -65,26 +65,26 @@ export default (cli) => {
6565
// Last pass to create links within groups
6666
metaKeys.forEach((key) => {
6767
// Check for existing primary nav
68-
const idx = nav.findIndex((parent) => parent.title === meta[key]?.nav.parent)
69-
const groupIdx = nav[idx].links.findIndex((group) => group.title === meta[key]?.nav.child)
68+
const idx = nav.findIndex((parent) => parent.title.trim() === meta[key]?.nav.parent.trim())
69+
const groupIdx = nav[idx].links.findIndex((group) => group.title.trim() === meta[key]?.nav.child.trim())
7070

7171
if (idx > -1 && groupIdx > -1) {
7272
nav[idx].links[groupIdx].children.push({
73-
title: meta[key].nav.title,
74-
alt: meta[key].nav.alt,
73+
title: meta[key].nav.title.trim(),
74+
alt: meta[key].nav.alt.trim(),
7575
href: meta[key].deprecated ? `/deprecated${key}` : key,
7676
deprecated: meta[key].deprecated,
7777
})
7878
}
7979
})
8080

8181
// Sort all the things
82-
nav.sort((a, b) => (a.title > b.title ? 1 : -1))
83-
nav.forEach((page) => page.links.sort((a, b) => (a.title > b.title ? 1 : -1)))
82+
nav.sort((a, b) => (a.title.trim() > b.title.trim() ? 1 : -1))
83+
nav.forEach((page) => page.links.sort((a, b) => (a.title.trim() > b.title.trim() ? 1 : -1)))
8484
nav.forEach((page) =>
8585
page.links.forEach((sub) => {
8686
if (sub.children) {
87-
sub.children.sort((a, b) => (a.title > b.title ? 1 : -1))
87+
sub.children.sort((a, b) => (a.title.trim() > b.title.trim() ? 1 : -1))
8888
}
8989
})
9090
)

bin/cmd/prep.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,12 @@ export default async (cli) => {
457457
description = meta[url].deprecated ? `[DEPRECATED] ${parent}: ${title}` : `${parent}: ${title}`
458458
}
459459

460+
// Trim Text
461+
parent = parent.trim()
462+
title = title.trim()
463+
description = description.trim()
464+
groupTitle = groupTitle.trim()
465+
460466
// Update Mapping
461467
meta[url].parent = parent
462468
meta[url].group = groupTitle
@@ -476,6 +482,7 @@ export default async (cli) => {
476482
navTitle = navTitle.replace(reParent, '')
477483
navTitle = navTitle.replace(reGroup, '')
478484
navTitle = navTitle.replace(reGroupAlt, '')
485+
navTitle = navTitle.trim()
479486

480487
meta[url].nav = {
481488
parent: parent,

bin/config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ if (fs.existsSync(SUPPORTED_VERSIONS_FILE)) {
3939

4040
// Export version information
4141
export const SUPPORTED_VERSIONS = supportedVersions
42-
export const UPCOMING_VERSION = supportedVersions ? supportedVersions.find((version) => version.release === 'upcoming').value : null
43-
export const CURRENT_VERSION = supportedVersions ? supportedVersions.find((version) => version.release === 'current').value : null
42+
export const UPCOMING_VERSION = supportedVersions ? supportedVersions.find((version) => version.release === 'upcoming')?.value : null
43+
export const CURRENT_VERSION = supportedVersions ? supportedVersions.find((version) => version.release === 'current')?.value : null
4444
export const SELECTED_VERSION = process.env.SELECTED_VERSION && supportedVersions ? supportedVersions.find((version) => version.value === process.env.SELECTED_VERSION.toString()).value : CURRENT_VERSION

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sfccdevops/sfcc-docs",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "Unofficial community edition of the Salesforce Commerce Cloud developer documentation.",
55
"license": "MIT",
66
"author": "Peter Schmalfeldt <[email protected]>",

src/components/Layout.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ export function Layout({ children, title, tableOfContents, isMarkdoc = false, is
167167
<Prose>{children}</Prose>
168168

169169
{/* Salesforce Copyright Added Back */}
170-
{!isHomePage && isEmbedded === false && <div className="mt-8 font-display text-sm font-medium text-slate-500 dark:text-slate-400">&copy; {new Date().getUTCFullYear()} salesforce.com, inc. All rights reserved.</div>}
170+
{!isHomePage && isEmbedded === false && <div className="mt-8 font-display text-sm font-medium text-slate-500 dark:text-slate-400">&copy; Copyright 2000-{new Date().getUTCFullYear()} salesforce.com inc. All rights reserved. Various
171+
trademarks held by their respective owners.</div>}
171172

172173
{/* GitHub Search Button */}
173174
{!isHomePage && isEmbedded === false && (

0 commit comments

Comments
 (0)