Skip to content

Commit 99e15ce

Browse files
committed
Relative paths support
1 parent 13039f6 commit 99e15ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CommunityToolkit.Tooling.SampleGen/ToolkitSampleMetadataGenerator.Documentation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private ImmutableArray<ToolkitFrontMatter> GatherDocumentFrontMatter(SourceProdu
156156

157157
// Get the filepath we need to be able to load the markdown file in sample app.
158158
var filepath = file.Path.Split(new string[] { @"\components\", "/components/", @"\tooling\", "/tooling/" }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault();
159-
var iconpath = filepath.Replace(Path.GetFileName(filepath), icon);
159+
var iconpath = (filepath.Split(new string[] { @"\samples\", "/samples/" }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault() + "\\samples\\" + icon).Replace('\\', '/');
160160

161161
// Look for sample id tags
162162
var matches = MarkdownRegexSampleTag.Matches(content);
@@ -211,7 +211,7 @@ private ImmutableArray<ToolkitFrontMatter> GatherDocumentFrontMatter(SourceProdu
211211
SampleIdReferences = sampleids.ToArray(),
212212
DiscussionId = discussionId,
213213
IssueId = issueId,
214-
Icon = iconpath.Replace('\\', '/'),
214+
Icon = iconpath,
215215
};
216216
}
217217
}).OfType<ToolkitFrontMatter>().ToImmutableArray();

0 commit comments

Comments
 (0)