Add title logic
This commit is contained in:
parent
94a3fc09a8
commit
0e17bb34f2
4 changed files with 4 additions and 5 deletions
|
@ -1,7 +1,6 @@
|
||||||
import os
|
import os
|
||||||
from glob import glob
|
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')
|
os.chdir('/big-stuff/files/websites/personal-site/html')
|
||||||
md_files = glob('*.md')
|
md_files = glob('*.md')
|
||||||
md_files_no_ext = []
|
md_files_no_ext = []
|
||||||
|
@ -10,4 +9,4 @@ for item in md_files:
|
||||||
md_files_no_ext.append(item[:-3])
|
md_files_no_ext.append(item[:-3])
|
||||||
|
|
||||||
for item in md_files_no_ext:
|
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)\"')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="/askiiart.gif" type="image/icon">
|
<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" />
|
<link href="style.css" type="text/css" rel="stylesheet" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="/askiiart.gif" type="image/icon">
|
<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" />
|
<link href="style.css" type="text/css" rel="stylesheet" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="/askiiart.gif" type="image/icon">
|
<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" />
|
<link href="style.css" type="text/css" rel="stylesheet" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in a new issue