Skip to content

Commit

Permalink
Moved meta tags up the page.
Browse files Browse the repository at this point in the history
  • Loading branch information
apaz-cli committed Sep 29, 2024
1 parent 65e14c1 commit a459bf1
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion blog/Cursed_Code_Collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="og:title" content="Cursed Code Collection">
<title>Cursed Code Collection</title>
<style>
html {
Expand Down Expand Up @@ -216,7 +217,6 @@
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<meta name="og:title" content="Cursed Code Collection">
<style type="text/css">
/* https://github.com/markdowncss/retro/blob/master/css/retro.css */

Expand Down
4 changes: 2 additions & 2 deletions blog/Descending_Into_The_Stack_And_Madness.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="og:title" content="Background">
<meta name="og:image" content="images/Samurai_Gate.jpg">
<title>Descending Into The Stack And Madness</title>
<style>
html {
Expand Down Expand Up @@ -216,8 +218,6 @@
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<meta name="og:title" content="Background">
<meta name="og:image" content="images/Samurai_Gate.jpg">
<style type="text/css">
/* https://github.com/markdowncss/retro/blob/master/css/retro.css */

Expand Down
4 changes: 2 additions & 2 deletions blog/Errors_and_Configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="og:title" content="Errors and Configuration">
<meta name="og:image" content="images/Snake_moriya_suwako.jpg">
<title>Errors and Configuration</title>
<style>
html {
Expand Down Expand Up @@ -216,8 +218,6 @@
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<meta name="og:title" content="Errors and Configuration">
<meta name="og:image" content="images/Snake_moriya_suwako.jpg">
<style type="text/css">
/* https://github.com/markdowncss/retro/blob/master/css/retro.css */

Expand Down
4 changes: 2 additions & 2 deletions blog/Grifters.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="og:title" content="Grifters">
<meta name="og:image" content="images/Thailand%20Countryside%20Pixel%203.png">
<title>Grifters</title>
<style>
html {
Expand Down Expand Up @@ -153,8 +155,6 @@
ul.task-list{list-style: none;}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<meta name="og:title" content="Grifters">
<meta name="og:image" content="images/Thailand%20Countryside%20Pixel%203.png">
<style type="text/css">
/* https://github.com/markdowncss/retro/blob/master/css/retro.css */

Expand Down
6 changes: 3 additions & 3 deletions blog/Java.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="og:title" content="My Experience with Java">
<meta name="og:description" content="Slow things not to do:">
<meta name="og:image" content="images/Java.png">
<title>Java</title>
<style>
html {
Expand Down Expand Up @@ -216,9 +219,6 @@
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<meta name="og:title" content="My Experience with Java">
<meta name="og:description" content="Slow things not to do:">
<meta name="og:image" content="images/Java.png">
<style type="text/css">
/* https://github.com/markdowncss/retro/blob/master/css/retro.css */

Expand Down
4 changes: 2 additions & 2 deletions blog/Safety_and_Correctness.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="og:title" content="Safety and Correctness">
<meta name="og:image" content="images/PlaneClouds_skyrick9413.jpg">
<title>Safety and Correctness</title>
<style>
html {
Expand Down Expand Up @@ -216,8 +218,6 @@
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<meta name="og:title" content="Safety and Correctness">
<meta name="og:image" content="images/PlaneClouds_skyrick9413.jpg">
<style type="text/css">
/* https://github.com/markdowncss/retro/blob/master/css/retro.css */

Expand Down
7 changes: 5 additions & 2 deletions blog/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
def generate_article(i, f):

def replace_meta_with_opengraph(html):
meta_rep = " <!-- meta -->\n"
rep_str = " <title>"

# Use content to generate opengraph meta tags.
titlegroup = re.search("<h1.*>(.*?)</h1>", html)
subtitlegroup = re.search("<h4.*>(.*?)</h4>", html)
first_image = re.search('<img.*src="(.*?)".*>', html)
Expand All @@ -36,7 +38,8 @@ def replace_meta_with_opengraph(html):
meta_with += f" <meta name=\"og:description\" content=\"{subtitlegroup.group(1) if subtitlegroup else ''}\">\n"
if first_image:
meta_with += f" <meta name=\"og:image\" content=\"{first_image.group(1) if first_image else ''}\">\n"
return html.replace(meta_rep, meta_with)
meta_with += rep_str
return html.replace(rep_str, meta_with)

title = splitext(f)[0]
to = title + ".html"
Expand Down
2 changes: 1 addition & 1 deletion generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def makeDoc(data):
<meta name="og:title" content="apaz's Website">
<meta name="og:description" content="My blog and projects.">
<meta name="og:image" content="https://apaz-cli.github.io/resources/images/sip.png">
<meta name="og:image" content="resources/images/sip.png">
<title>apaz's Website</title>
<link rel="stylesheet" href="main.css">
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="og:title" content="apaz's Website">
<meta name="og:description" content="My blog and projects.">
<meta name="og:image" content="https://apaz-cli.github.io/resources/images/sip.png">
<meta name="og:image" content="resources/images/sip.png">

<title>apaz's Website</title>
<link rel="stylesheet" href="main.css">
Expand Down
1 change: 0 additions & 1 deletion resources/style/pandoc.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- meta -->
<style type="text/css">
/* https://github.com/markdowncss/retro/blob/master/css/retro.css */

Expand Down

0 comments on commit a459bf1

Please sign in to comment.