-print('<!doctype html>',
- ($ARGV[0] and $ARGV[0] eq 'fa')
- ? '<html lang="fa" dir="rtl">'
- : '<html>',
- '<head>',
- '<meta
-http-equiv="Content-Type"
-content="text/html; charset=utf-8"
-/>',
- "<title>$title</title>",
- ($ARGV[0] and $ARGV[0] eq 'fa')
- ? "\n<style>\@font-face{font-family:sahel;font-weight:normal;
+print("<!doctype html>",
+ qq(<html lang="$opt_lang"),
+ $opt_lang eq 'fa' ? ' dir="rtl"' : '',
+ ">",
+ qq(<head>
+<meta http-equiv="Content-Type"
+content="text/html; charset=utf-8" />\n),
+ "<title>$title</title>\n",
+ $url ? qq(<link rel="alternate" href="$url"
+title="plain text" type="text/plain" />\n) : '',
+ ($opt_index and $opt_lang eq 'en')
+ ? qq(<link rel="alternate" href="https://bndl.org/fa/"
+hreflang="fa" title="persian" />\n)
+ : ($opt_index and $opt_lang eq 'fa')
+ ? qq(<link rel="alternate" href="https://bndl.org/"
+hreflang="en" title="english" />\n)
+ : '',
+ qq(<style>\@media(prefers-color-scheme:dark){
+body{background:#1c1c1c;color:white;}a:link{color:#acdeff;}
+a:visited{color:#f8f;}a:active{color:#e00;}}),
+ $opt_lang eq 'fa'
+ ? qq(\n\@font-face{font-family:sahel;font-weight:normal;