Skip to content

Commit 9fe7744

Browse files
committed
Fix relative links
1 parent 9f2edda commit 9fe7744

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

functions/src/content.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ export class Content {
118118
const pageKeys = config.pages
119119
? config.pages.map(page => page.path)
120120
: [];
121+
122+
Logger.debug(repoId, `Relative link on page ${page}: ${href} --> ${repoRelative}`);
123+
el.attribs['href'] = repoRelative;
124+
121125
if (pageKeys.indexOf(repoRelative) >= 0) {
122126
Logger.debug(repoId, `Lowercasing relative link ${repoRelative}.`);
123127
that.lowercaseLink(el);

functions/src/project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export class Project {
300300
return content.processMarkdown(
301301
data,
302302
id,
303-
undefined,
303+
config.content,
304304
config,
305305
this.params.branch
306306
);
@@ -363,7 +363,7 @@ export class Project {
363363
page.path,
364364
this.params.branch
365365
);
366-
Logger.debug(id, `Rendering page: ${pageUrl}`);
366+
Logger.debug(id, `Rendering page name=${page.name}, path=${page.path}, url=${pageUrl}`);
367367

368368
const pagePromise = this.github
369369
.getRawContent(pageUrl)

functions/src/test/test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,20 @@ const ids = [
3434
"firebase::quickstart-js",
3535
"firebase::quickstart-cpp",
3636
"firebase::firebaseui-android",
37-
"firebase::firebaseui-ios",
3837
"firebase::angularfire",
3938
"firebase::functions-samples",
40-
"firebase::assistant-codelab",
39+
40+
// Interesting because:
41+
// * Is "blacklisted" from being featured
4142
"firebase::androiddrawing",
42-
"googlesamples::easypermissions",
4343

44+
// Interesting because:
45+
// * Uses a nested md file as it's "content" page.
4446
"firebase::firebase-android-sdk",
4547

4648
// Interesting because:
47-
// Non-Firebase
48-
// Has "old-style" pages config (no names)
49+
// * Non-Firebase
50+
// * Has "old-style" pages config (no names)
4951
"invertase::react-native-firebase"
5052
];
5153

0 commit comments

Comments
 (0)