Added noscript message to blogtext

This commit is contained in:
Allexit 2016-11-03 11:54:57 +02:00
parent 16ff1432c7
commit a7c1dcef83
8 changed files with 47 additions and 17 deletions

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Teascade | blog</title>
<title>Teascade | blog</title>
</head>
<body onload="main('blog')">
<div class="cont">
@ -40,6 +40,10 @@ without it taking a butt-load of space and files while being Non-Javascript frie
</p></noscript>
</div>
<div id="blogtext" class="hiddenarea" >
<noscript>
<p>Oh sorry, it looks like someone sent you a link to a blogtext (or something), but you don't have javascript enabled!</p>
<p>Sorry to be the one to break the bad news for you, but we don't take javascript-absolutists kindly this 'round 'o town. So if you could kindly just press that "About" button and forget this ever happened, yeah?</p>
</noscript>
</div>
</div>
</div>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Teascade | blogtext</title>
<title>Teascade | blogtext</title>
</head>
<body onload="main('blogtext')">
<div class="cont">
@ -40,6 +40,10 @@ without it taking a butt-load of space and files while being Non-Javascript frie
</p></noscript>
</div>
<div id="blogtext" >
<noscript>
<p>Oh sorry, it looks like someone sent you a link to a blogtext (or something), but you don't have javascript enabled!</p>
<p>Sorry to be the one to break the bad news for you, but we don't take javascript-absolutists kindly this 'round 'o town. So if you could kindly just press that "About" button and forget this ever happened, yeah?</p>
</noscript>
</div>
</div>
</div>

View File

@ -1,21 +1,23 @@
# -*- coding: utf-8 -*-
import markdown
import glob
def generate_template():
content_file = open('src/template.html', 'r')
content_file = open('src/template.html', 'r', encoding="utf-8")
content = content_file.read()
content_file.close()
about_file = open('src/about.md', 'r')
about_file = open('src/about.md', 'r', encoding="utf-8")
about = about_file.read()
about_file.close()
games_file = open('src/games.md', 'r')
games_file = open('src/games.md', 'r', encoding="utf-8")
games = games_file.read()
games_file.close()
blog_file = open('src/blog.md', 'r')
blog_file = open('src/blog.md', 'r', encoding="utf-8")
blog = blog_file.read()
blog_file.close()
@ -63,12 +65,12 @@ def generate_page(template, page):
def build_blogposts():
blogposts = glob.glob("blogposts-md/*.md")
for path in blogposts:
with open(path, "r") as f:
with open(path.replace("blogposts-md", "blogposts").replace(".md", ".html"), "w+") as f2:
with open(path, "r", encoding="utf-8") as f:
with open(path.replace("blogposts-md", "blogposts").replace(".md", ".html"), "w+", encoding="utf-8") as f2:
f2.write(markdown.markdown(f.read(), output_format="html5"))
with open("blogposts-md/blogposts.json", "r") as f:
with open("blogposts/blogposts.json", "w+") as f2:
with open("blogposts-md/blogposts.json", "r", encoding="utf-8") as f:
with open("blogposts/blogposts.json", "w+", encoding="utf-8") as f2:
f2.write("window.blogpostDataStr = '" + f.read().replace("\n", "") + "';")
def generate():
@ -82,16 +84,16 @@ def generate():
print("Done!\n")
print("Generating pages..")
with open('index.html', 'w+') as f:
with open('index.html', 'w+', encoding="utf-8") as f:
f.write(generate_page(template, "about"))
print("About (index.html) done!")
with open('games/index.html', 'w+') as f:
with open('games/index.html', 'w+', encoding="utf-8") as f:
f.write(generate_page(template, "games"))
print("Games done!")
with open('blog/index.html', 'w+') as f:
with open('blog/index.html', 'w+', encoding="utf-8") as f:
f.write(generate_page(template, "blog"))
print("Blog done!")
with open('blogtext/index.html', 'w+') as f:
with open('blogtext/index.html', 'w+', encoding="utf-8") as f:
f.write(generate_page(template, "blogtext"))
print("Blogtext done!")

View File

@ -109,4 +109,8 @@ body, html {
transition: 0.2s;
cursor: pointer; }
noscript {
color: #fff;
}
/*# sourceMappingURL=main.css.map */

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Teascade | games</title>
<title>Teascade | games</title>
</head>
<body onload="main('games')">
<div class="cont">
@ -40,6 +40,10 @@ without it taking a butt-load of space and files while being Non-Javascript frie
</p></noscript>
</div>
<div id="blogtext" class="hiddenarea" >
<noscript>
<p>Oh sorry, it looks like someone sent you a link to a blogtext (or something), but you don't have javascript enabled!</p>
<p>Sorry to be the one to break the bad news for you, but we don't take javascript-absolutists kindly this 'round 'o town. So if you could kindly just press that "About" button and forget this ever happened, yeah?</p>
</noscript>
</div>
</div>
</div>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Teascade | about</title>
<title>Teascade | about</title>
</head>
<body onload="main('about')">
<div class="cont">
@ -40,6 +40,10 @@ without it taking a butt-load of space and files while being Non-Javascript frie
</p></noscript>
</div>
<div id="blogtext" class="hiddenarea" >
<noscript>
<p>Oh sorry, it looks like someone sent you a link to a blogtext (or something), but you don't have javascript enabled!</p>
<p>Sorry to be the one to break the bad news for you, but we don't take javascript-absolutists kindly this 'round 'o town. So if you could kindly just press that "About" button and forget this ever happened, yeah?</p>
</noscript>
</div>
</div>
</div>

View File

@ -165,3 +165,7 @@ body, html {
}
}
}
noscript {
color: $regular;
}

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Teascade | $page$</title>
<title>Teascade | $page$</title>
</head>
<body onload="main('$page$')">
<div class="cont">
@ -31,6 +31,10 @@
$blog_content$
</div>
<div id="blogtext" $blogtext_is_hidden$ >
<noscript>
<p>Oh sorry, it looks like someone sent you a link to a blogtext (or something), but you don't have javascript enabled!</p>
<p>Sorry to be the one to break the bad news for you, but we don't take javascript-absolutists kindly this 'round 'o town. So if you could kindly just press that "About" button and forget this ever happened, yeah?</p>
</noscript>
</div>
</div>
</div>