From 0e17bb34f2ca91a47b204dfcec6ba2101f6cc658 Mon Sep 17 00:00:00 2001 From: askiiart Date: Thu, 23 Mar 2023 22:03:13 -0500 Subject: [PATCH] Add title logic --- md2html.py | 3 +-- portfolio.html | 2 +- resume.html | 2 +- template.html | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/md2html.py b/md2html.py index 4701b8a..c7ce14f 100755 --- a/md2html.py +++ b/md2html.py @@ -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)\"') diff --git a/portfolio.html b/portfolio.html index 98bbdf4..d3e6223 100644 --- a/portfolio.html +++ b/portfolio.html @@ -2,7 +2,7 @@ - askiiart's site + Portfolio diff --git a/resume.html b/resume.html index 16dd9b9..840f2ad 100644 --- a/resume.html +++ b/resume.html @@ -2,7 +2,7 @@ - askiiart's site + Resume diff --git a/template.html b/template.html index e7a7552..530580a 100755 --- a/template.html +++ b/template.html @@ -2,7 +2,7 @@ - askiiart's site + $title$