Add title logic

This commit is contained in:
askiiart 2023-03-23 22:03:13 -05:00
parent 94a3fc09a8
commit 0e17bb34f2
4 changed files with 4 additions and 5 deletions

View file

@ -1,7 +1,6 @@
import os
from glob import glob
# pandoc --data-dir /big-stuff/files/websites/personal-site/html --template template.html -t html -o index.html index.md
os.chdir('/big-stuff/files/websites/personal-site/html')
md_files = glob('*.md')
md_files_no_ext = []
@ -10,4 +9,4 @@ for item in md_files:
md_files_no_ext.append(item[:-3])
for item in md_files_no_ext:
os.system(f'pandoc -f markdown-smart --data-dir /big-stuff/files/websites/personal-site/html --template template.html -t html -o {item}.html {item}.md')
os.system(f'pandoc -f markdown-smart --data-dir . --template template.html -t html -o {item}.html {item}.md --metadata title=\"$(grep -m 1 -oP \'(?<=^# ).*\' {item}.md | cat)\"')

View file

@ -2,7 +2,7 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="/askiiart.gif" type="image/icon">
<title>askiiart's site</title>
<title>Portfolio</title>
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>

View file

@ -2,7 +2,7 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="/askiiart.gif" type="image/icon">
<title>askiiart's site</title>
<title>Resume</title>
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>

View file

@ -2,7 +2,7 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="/askiiart.gif" type="image/icon">
<title>askiiart's site</title>
<title>$title$</title>
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>