File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,19 @@ function KebabToTitle($text)
4747 return $words -join ' '
4848}
4949
50+ # helper function to convert github video links to HTML video embeds
51+ function Convert-GitHubVideos ($content ) {
52+ # regex to match github video links: [](https://github.com/...)
53+ $pattern = " \[\]\((https://github\.com/user-attachments/assets/[a-f0-9\-]+)\)"
54+
55+ # replace each match with HTML video embed
56+ return [regex ]::Replace($content , $pattern , {
57+ param ($match )
58+ $url = $match.Groups [1 ].Value
59+ return " <video width=`" 100%`" controls>`n <source src=`" $url `" >`n </video>"
60+ })
61+ }
62+
5063foreach ($url in $projectUrls )
5164{
5265 $weight = $projectUrls.IndexOf ($url ) + 1
@@ -98,6 +111,7 @@ weight: $weight
98111"@
99112
100113 # combine into final markdown page
114+ # $readmeContent = Convert-GitHubVideos $readmeContent
101115 $finalContent = $frontMatter + " `n " + $readmeContent
102116 $outputFile = Join-Path $outputDir " $repo .md"
103117 $finalContent | Out-File - FilePath $outputFile - Encoding UTF8
You can’t perform that action at this time.
0 commit comments