File tree Expand file tree Collapse file tree
src/Downpatch.Web/Components/Pages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9696 </div >
9797
9898 <footer class =" docs-footer" >
99- <p class =" muted" >Found an issue ? Edit the markdown and submit a PR .</p >
99+ <p class =" muted" >
100+ Found an issue ?
101+ <a href =" @GetEditUrl(Slug)" target =" _blank" rel =" noopener" >Edit the markdown </a > and submit a PR .
102+ </p >
100103 </footer >
101104 </main >
102105
@@ -291,4 +294,16 @@ else
291294
292295 return new string (buf [.. w ]);
293296 }
297+
298+ private static string GetEditUrl (string ? slug )
299+ {
300+ // Default to guide/index.md if no slug
301+ var baseUrl = " https://github.com/downpatch/content/blob/main/guide" ;
302+ if (string .IsNullOrWhiteSpace (slug ))
303+ return $" {baseUrl }/index.md" ;
304+
305+ // Sanitize and build path
306+ var path = slug .Trim ('/' ).Replace ('\\ ' , '/' );
307+ return $" {baseUrl }/{path }.md" ;
308+ }
294309}
You can’t perform that action at this time.
0 commit comments