########################################################### # Erzeugung der Fotogalerie-Seiten und der Seite für die # Stichwortsuche ########################################################### . .\MyHTML.ps1 $HtmlPath = $env:Work + '\HTML' $PageSize = 48 # Anzahl Einträge pro Seite Remove-Item -path ($env:Work + '\Gallery*.html') $StwList = @{} $Index = 0 $Page = 0 Get-ChildItem $HtmlPath -File | Where-Object { $_.FullName -match '\.htm$|\.html$' } | ` ForEach-Object { if ($Index -eq $PageSize) { $Html = Write-MyGalleryEnd -Page $Page -End $False $Html | Add-Content -Path $GalleryFile $Page = $Page + 1 $Index = 0; } if ($Index -eq 0) { $GalleryFile = $env:Work + '\Gallery' + $Page.ToString() + '.html' New-Item -Path $GalleryFile -ItemType File | Out-Null $Html = Write-MyStart -Description 'Bildergalerie Museumsdorf Volksdorf' -StyleDir '' -Stylesheet 'Gallery.css' -Title 'Fotogalerie Museumsdorf Volksdorf' -BaseDir '' -Header 'Fotogalerie' $Html | Add-Content -Path $GalleryFile } $FullName = $_.FullName Write-Host "Processing: $FullName" $Content = get-content $FullName -raw $Leaf = Split-Path -path $FullName -leaf $Html = Write-MyGallery -Leaf $Leaf -Content $Content $Html | Add-Content -Path $GalleryFile #Stichwort $Content = ($Content -split 'id="STW">', 2, 'simplematch')[1] $Stw = ($Content -split '', 2, 'simplematch')[0] # Stichwortliste updaten $Stw.split(";") | ForEach-Object -process { $TMP = $_.Trim() if ($TMP.Length -gt 0) { if ($StwList.ContainsKey($TMP)) { $StwList[$TMP] = $StwList[$TMP] + 1 } else { $StwList.Add($TMP, 1) } } } $Index = $Index + 1 } $Html = Write-MyGalleryEnd -BaseDir '' -Page $Page -End $true $Html | Add-Content -Path $GalleryFile # New File for Keywords $KeywordsFile = $env:Work + '\Keywords.html' if (Test-Path -Path $KeywordsFile) { Remove-Item -path $KeywordsFile } New-Item -Path $KeywordsFile -ItemType File | Out-Null Write-MyKeywords -stwlist $StwList | Out-File $KeywordsFile Pause