From a98d4652c65d8cdfead83d165514e1ba450836d0 Mon Sep 17 00:00:00 2001 From: "Martin Hinshelwood nkdAgility.com" Date: Tue, 25 Feb 2025 09:28:26 +0000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(captions):=20rename=20cap?= =?UTF-8?q?tion=20files=20for=20consistency=20and=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename caption files from "index.captions.*.md" to "captions.*.md" across various scripts and templates. This change improves file naming consistency and clarity, making it easier to manage and understand the purpose of these files. It also simplifies the file structure by removing the unnecessary "index" prefix, aligning with common naming conventions. --- .../build/Generate-CombinedCaptions.ps1 | 2 +- .../Update-YoutubeTranscriptMarkdown.ps1 | 2 +- .../resources/Update-ReourcesFrontMatter.ps1 | 6 +- site/layouts/resources/video.html | 80 +++++++++---------- 4 files changed, 41 insertions(+), 49 deletions(-) diff --git a/.powershell/build/Generate-CombinedCaptions.ps1 b/.powershell/build/Generate-CombinedCaptions.ps1 index 10da6f705..614564d88 100644 --- a/.powershell/build/Generate-CombinedCaptions.ps1 +++ b/.powershell/build/Generate-CombinedCaptions.ps1 @@ -94,7 +94,7 @@ function Generate-CombinedCaptions { return } - $captionsFile = "$videoDir\index.captions.en.md" + $captionsFile = "$videoDir\captions.en.md" if (Test-Path $captionsFile) { $videoCaptions = Get-Content -Path $captionsFile -Raw Write-Host "Loaded captions for $videoId" diff --git a/.powershell/build/Update-YoutubeTranscriptMarkdown.ps1 b/.powershell/build/Update-YoutubeTranscriptMarkdown.ps1 index 6e119dce5..0aeefd072 100644 --- a/.powershell/build/Update-YoutubeTranscriptMarkdown.ps1 +++ b/.powershell/build/Update-YoutubeTranscriptMarkdown.ps1 @@ -35,7 +35,7 @@ function Update-YoutubeTranscriptMarkdown { # Perform operations using the extracted part Write-InfoLog $matchPart - $markdownFile = Join-Path $videoDir "index.captions.$matchPart.md" + $markdownFile = Join-Path $videoDir "captions.$matchPart.md" $captionPath = Join-Path $videoDir "data.captions.$matchPart.srt" # Load the video data from data.json if available diff --git a/.powershell/single-use/resources/Update-ReourcesFrontMatter.ps1 b/.powershell/single-use/resources/Update-ReourcesFrontMatter.ps1 index 37c5e350d..c39227780 100644 --- a/.powershell/single-use/resources/Update-ReourcesFrontMatter.ps1 +++ b/.powershell/single-use/resources/Update-ReourcesFrontMatter.ps1 @@ -194,7 +194,7 @@ while ($hugoMarkdownQueue.Count -gt 0 -or $hugoMarkdownBatchQueue.Count -gt 0) { #================Themes, Categories, & TAGS========================== $BodyContent = $hugoMarkdown.BodyContent If ($hugoMarkdown.FrontMatter.ResourceType -eq "videos") { - $captionsPath = Join-Path $hugoMarkdown.FolderPath "index.captions.en.md" + $captionsPath = Join-Path $hugoMarkdown.FolderPath "captions.en.md" if (Test-Path ($captionsPath )) { $BodyContent = Get-Content $captionsPath -Raw } @@ -234,8 +234,8 @@ while ($hugoMarkdownQueue.Count -gt 0 -or $hugoMarkdownBatchQueue.Count -gt 0) { } "videos" { if ($hugoMarkdown.FrontMatter.Contains('canonicalURL')) { - if ( (Test-Path (Join-Path $hugoMarkdown.FolderPath "index.captions.en.md" ))) { - $transcript = Get-Content -Path (Join-Path $hugoMarkdown.FolderPath "index.captions.en.md" ) -Raw + if ( (Test-Path (Join-Path $hugoMarkdown.FolderPath "captions.en.md" ))) { + $transcript = Get-Content -Path (Join-Path $hugoMarkdown.FolderPath "captions.en.md" ) -Raw $content = Get-NewPostBasedOnTranscript -ResourceTranscript $transcript $newTitle = Get-NewTitleBasedOnContent -Content $content $newDescription = Get-NewDescriptionBasedOnContent -Content $content diff --git a/site/layouts/resources/video.html b/site/layouts/resources/video.html index 4da751614..7c55385a5 100644 --- a/site/layouts/resources/video.html +++ b/site/layouts/resources/video.html @@ -14,57 +14,49 @@

{{- .Params.subtitle | markdownify }} {{- end }} {{- define "main" }} -
-
- -
+
+
+ +
- {{ $resource := .Resources.GetMatch "index.captions.md" }} + {{ $resource := .Resources.GetMatch "captions.md" }} - -
-
- {{- .Content }} -
- {{ with $resource }} -
+
+
{{- .Content }}
- {{ end }} - {{ range $resources }} - {{ $langCode := replace .File.BaseFileName "index.captions." "" }} -
- {{- .Content }} -
- {{ end }} -
- - -
- - + {{ with $resource }} +
+ {{- .Content }} +
+ {{ end }} + {{ range $resources }} + {{ $langCode := replace .File.BaseFileName "captions." "" }} +
+ {{- .Content }} +
+ {{ end }} + +
{{- partial "publications/tag-cloud.html" . }}