calculate and print number of pages

This commit is contained in:
sejo 2022-03-27 18:09:27 -06:00
parent c5fe6f2833
commit 68f533e6c3
1 changed files with 5 additions and 3 deletions

View File

@ -348,6 +348,7 @@ function genIndex()
-- get gmo files in chronological order
local gmofiles = io.popen("ls -t src/*gmo")
local count = 0
for filename in gmofiles:lines() do
local basename = string.sub(filename, 5, -5) -- remove src/ and .gmo
local name = spacify(basename)
@ -358,10 +359,11 @@ function genIndex()
-- also initialize each name in the pages table
-- initialize page metadata
pages[ name ] = initPageMetadata( name )
count = count + 1
end
gmofiles:close()
index:close()
return count
end
function genLog()
@ -475,11 +477,11 @@ genLog()
-- generate index
print("generando índice de páginas...")
genIndex()
local n = genIndex()
-- start first pass
-- converting from gmo to gmi and html and calculating incoming links
print("convirtiendo páginas...")
print(string.format("convirtiendo %d páginas...",n))
firstPass()
-- second pass, write incoming links
print("escribiendo incoming links...")