Move headers and footers to includes

Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
Skylar "The Cobra" Widulski 2023-01-20 19:25:46 -05:00
parent ed64c10f47
commit 3d449aad0a
Signed by: cobra
GPG Key ID: 4FD8F812083FF6F9
12 changed files with 39 additions and 172 deletions

View File

@ -149,6 +149,7 @@ def news(path):
for a in article.select("p a:has(img)"):
a["href"] = re.sub(r"^(.*)$", r"/proxy/?url=\1", a["href"])
article = re.sub(r"(src=\")", r"\1/proxy/?url=", str(article))
article = article.replace("https://www.snopes.com", '')
# Author bio
author_bio = soup.select("div.author_bio p")[0].text
@ -195,10 +196,12 @@ def fact_check(path):
for a in article.select("p a:has(img)"):
a["href"] = re.sub(r"^(.*)$", r"/proxy/?url=\1", a["href"])
article = re.sub(r"(src=\")", r"\1/proxy/?url=", str(article))
article = article.replace("https://www.snopes.com", '')
if rating != None:
rating.find("svg").decompose()
rating.find("img").decompose()
rating = str(rating).replace("https://www.snopes.com", '')
else:
rating = ''

View File

@ -8,28 +8,11 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<center>
<h1 style="font-size:10em;line-height:0em;">400</h1>
<p>The request was malformed</p>
</center>
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
{% include "footer.html" %}
</body>
</html>

View File

@ -8,28 +8,10 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<center>
<h1 style="font-size:10em;line-height:0em;">404</h1>
<p>This resource cannot be found</p>
</center>
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
</body>
</html>

View File

@ -8,28 +8,11 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<center>
<h1 style="font-size:10em;line-height:0em;">429</h1>
<p>Too many requests</p>
</center>
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
{% include "footer.html" %}
</body>
</html>

View File

@ -8,23 +8,7 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<p>{{ data[0]|safe }}</p>
<h1>{{ data[1] }}</h1>
<p><b>{{ data[2] }}</b></p>
@ -50,7 +34,6 @@
<hr style="clear:left;">
{% endfor %}
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
{% include "footer.html" %}
</body>
</html>

View File

@ -8,23 +8,7 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<p>{{ data[0]|safe }}</p>
<h1>{{ data[1] }}</h1>
<p><b>{{ data[2] }}</b></p>
@ -39,7 +23,6 @@
<br>
<p>By <a href="{{ data[4] }}">{{ data[3] }}</a></p>
<p>{{ data[11] }}</p>
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
{% include "footer.html" %}
</body>
</html>

2
templates/footer.html Normal file
View File

@ -0,0 +1,2 @@
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>

17
templates/header.html Normal file
View File

@ -0,0 +1,17 @@
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>

View File

@ -8,24 +8,7 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<center>
<img src="{{ url_for('static', filename='img/logo.png') }}" height=400px>
<form style="align:right" action="/search/" method="get">
@ -33,7 +16,6 @@
<input type="submit" value="Go" style="font-size:18pt">
</form>
</center>
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
{% include "footer.html" %}
</body>
</html>

View File

@ -8,23 +8,7 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<span>#</span>
{% for tag in data[6] %}
<span><a href="{{ tag[0] }}">{{ tag[1] }}</a></span>
@ -50,7 +34,6 @@
{{ data[4]|safe }}
<p><small>{{ data[5] }}</small></p>
</center>
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
{% include "footer.html" %}
</body>
</html>

View File

@ -8,23 +8,7 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<p>{{ data[0]|safe }}</p>
<h1>{{ data[1] }}</h1>
<p><b>{{ data[2] }}</b></p>
@ -38,7 +22,6 @@
<p>By <a href="{{ data[4] }}">{{ data[3] }}</a></p>
<p>{{ data[10] }}</p>
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
{% include "footer.html" %}
</body>
</html>

View File

@ -8,23 +8,7 @@
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<ul style="display:flex;justify-content:space-between;list-style-type:none;padding-left:0px;align-items:center;">
<li><a href="/"><img style="display:inline" src="{{ url_for('static', filename='img/logo.png') }}" height=100px></a></li>
<li><a href="/latest/">Latest</a></li>
<li><a href="/top/">Top</a></li>
<li><a href="/fact-check/">Fact Checks</a></li>
<li><a href="/collections/">Collections</a></li>
<li><a href="/news/">News</a></li>
<li><a href="/sitemap/">Archives</a></li>
<li><a href="/random/">Random</a></li>
<li>
<form style="align:right" action="/search/" method="get">
<input type=text" name="q" placeholder="Search Suds">
<input type="submit" value="Go">
</form>
</li>
</ul>
<hr>
{% include "header.html" %}
<h1>{{ data[0] }}</h1>
{% for archive in data[1] %}
<b>{{ archive[0]|safe }}</b>
@ -34,7 +18,6 @@
{% endfor %}
</ul>
{% endfor %}
<hr>
<center><p><a href="http://git.vern.cc/cobra/suds">Source code</a></p></center>
{% include "footer.html" %}
</body>
</html>