Skip to content

Commit e43d721

Browse files
committed
patch remove deprecated logic
1 parent 07d4360 commit e43d721

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

js/copy-to-llm.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,6 @@
1313
if (typeof window === 'undefined') {
1414
return;
1515
}
16-
// Called by getPageSlug() to decode slightly different permutations of a path.
17-
function normalizePathname(pathname) {
18-
let path = decodeURIComponent(pathname || '/');
19-
20-
// Support browsing the statically-built site using *.html files.
21-
path = path.replace(/index\.html$/i, '');
22-
// Collapse any accidental duplicate slashes.
23-
path = path.replace(/\/+/g, '/');
24-
25-
if (path.length > 1 && path.endsWith('/')) {
26-
path = path.slice(0, -1);
27-
}
28-
29-
return path || '/';
30-
}
31-
// Called by getPageSlug() after normalizePathname() to build and return the slug.
3216
function buildSlugFromPath(pathname) {
3317
if (!pathname || pathname === '/') {
3418
return 'index';
@@ -53,8 +37,6 @@
5337
if (segments[1] === 'pages' || segments[1] === 'categories') {
5438
segments.splice(0, 2);
5539
}
56-
} else if (segments[0] === 'ai-pages' || segments[0] === 'ai-categories') {
57-
segments.splice(0, 1);
5840
}
5941

6042
const slug = segments
@@ -71,8 +53,7 @@
7153
}
7254

7355
function getPageSlug() {
74-
const normalized = normalizePathname(window.location.pathname);
75-
return buildSlugFromPath(normalized);
56+
return buildSlugFromPath(window.location.pathname);
7657
}
7758

7859
function getMarkdownUrl(slug) {

0 commit comments

Comments
 (0)