@@ -8,7 +8,7 @@ func shouldProcessFile(path: string): bool =
8
8
return false
9
9
10
10
let ext = path.splitFile ().ext.toLowerAscii ()
11
- return ext notin [" .webp" , " .png" , " .jpeg" , " .jpg" , " .svg" ]
11
+ return ext notin [" .avif " , " . webp" , " .png" , " .jpeg" , " .jpg" , " .svg" ]
12
12
13
13
proc parseTemplate (content: string , compName: string , compContent: string ): string =
14
14
var newContent = content
@@ -75,10 +75,6 @@ proc processDirectory(dir: string) =
75
75
# ###############################
76
76
77
77
type
78
- PragmaKind = enum
79
- normalType,
80
- blogType,
81
-
82
78
TokenKind = enum
83
79
tkBar,
84
80
keyval,
@@ -529,12 +525,10 @@ func paintPalet(v: string): string =
529
525
i += 1
530
526
531
527
532
- proc convert (pragma: PragmaKind , file: string , path: string ) =
528
+ proc convert (file: string , path: string ) =
533
529
let text = readFile (file)
534
530
var
535
531
lexer = initLexer (file, text)
536
- author = " "
537
- date = " "
538
532
desc = " "
539
533
540
534
if getNextToken (lexer).kind != tkBar:
@@ -556,11 +550,6 @@ proc convert(pragma: PragmaKind, file: string, path: string) =
556
550
557
551
let title = parse_keyval (" title" )
558
552
559
- if pragma == blogType:
560
- author = parse_keyval (" author" )
561
- date = parse_keyval (" date" )
562
- desc = parse_keyval (" desc" )
563
-
564
553
if getNextToken (lexer).kind != tkBar:
565
554
lexer.error (" head: expected end ---" )
566
555
@@ -609,12 +598,6 @@ proc convert(pragma: PragmaKind, file: string, path: string) =
609
598
<div class="container">
610
599
""" )
611
600
612
- if pragma == blogType:
613
- f.write (& """
614
- <h1>{ title} </h1>
615
- <p class="author-date">{ author} { date} </p>
616
- """ )
617
-
618
601
let blocks: seq [TokenKind ] = @ [tkText, tkH1, tkH2, tkH3, tkList, tkUl]
619
602
620
603
proc toTag (t: TokenKind ): string =
@@ -727,16 +710,11 @@ proc convert(pragma: PragmaKind, file: string, path: string) =
727
710
728
711
729
712
proc main () =
730
- convert (normalType, " public/blog/index.md" , " public/blog/index.html" )
731
- convert (normalType, " public/ref/index.md" , " public/ref/index.html" )
732
- for file in walkFiles (" public/blog/*.md" ):
733
- convert (blogType, file, file.changeFileExt (" html" ))
734
-
713
+ convert (" public/ref/index.md" , " public/ref/index.html" )
735
714
for file in walkFiles (" public/docs/*.md" ):
736
- convert (normalType, file, file.changeFileExt (" html" ))
737
-
715
+ convert (file, file.changeFileExt (" html" ))
738
716
for file in walkFiles (" public/docs/subcommands/*.md" ):
739
- convert (normalType, file, file.changeFileExt (" html" ))
717
+ convert (file, file.changeFileExt (" html" ))
740
718
741
719
processDirectory (" public" )
742
720
echo " done building"
0 commit comments