53 lines
2.1 KiB
PowerShell
53 lines
2.1 KiB
PowerShell
# Rebuild the line-level source ledger for the static public-content files.
|
|
# Run from any directory: pwsh -File tasks/build-content-line-ledger.ps1
|
|
$frontend = (Resolve-Path (Join-Path $PSScriptRoot '../../guilan-ace-frontend')).Path
|
|
$sources = @(
|
|
'src/views/Home.tsx',
|
|
'src/views/AboutUs.tsx',
|
|
'src/components/Navbar.tsx',
|
|
'src/components/Footer.tsx',
|
|
'src/components/MobileBottomNav.tsx',
|
|
'src/app/page.tsx',
|
|
'src/app/about/page.tsx',
|
|
'src/app/layout.tsx',
|
|
'src/app/events/page.tsx',
|
|
'src/app/blog/page.tsx'
|
|
)
|
|
|
|
$rows = foreach ($source in $sources) {
|
|
$lineNumber = 0
|
|
foreach ($line in [System.IO.File]::ReadAllLines((Join-Path $frontend $source))) {
|
|
$lineNumber++
|
|
if ($line -notmatch '[\u0600-\u06FF]|https?://|favicon\.ico|enamad\.png') { continue }
|
|
|
|
$category = 'CMS editorial'
|
|
$note = ''
|
|
if ($line -match 'schema\.org|contactType|availableLanguage') {
|
|
$category = 'code-owned UI'
|
|
$note = 'Schema structure or vocabulary; referenced identity values remain editorial.'
|
|
} elseif ($source -match 'Navbar|MobileBottomNav') {
|
|
if ($line -match 'auth|profile|reset-password|logout|admin|ورود|ثبتنام|حساب|داشبورد|پروفایل|رمز|خروج|منوی') {
|
|
$category = 'code-owned UI'
|
|
}
|
|
} elseif ($source -eq 'src/views/Home.tsx') {
|
|
if ($line -match 'aria-label|<Button|<Link' -or $lineNumber -in @(55, 60, 121, 122)) { $category = 'code-owned UI' }
|
|
} elseif ($source -match 'src/app/(events|blog)/page.tsx') {
|
|
if ($line -match 'search|جست|robots') {
|
|
$category = 'code-owned UI'
|
|
$note = 'Query-specific title/description or search behavior; default listing introduction remains editorial.'
|
|
}
|
|
}
|
|
[pscustomobject]@{
|
|
source = $source
|
|
line = $lineNumber
|
|
category = $category
|
|
source_text = $line.Trim()
|
|
note = $note
|
|
}
|
|
}
|
|
}
|
|
|
|
$output = Join-Path $PSScriptRoot 'content-source-lines.csv'
|
|
$rows | Export-Csv -LiteralPath $output -NoTypeInformation -Encoding utf8
|
|
Write-Output "$($rows.Count) source lines written to $output"
|