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

@ -40,6 +40,10 @@ without it taking a butt-load of space and files while being Non-Javascript frie
</p></noscript> </p></noscript>
</div> </div>
<div id="blogtext" class="hiddenarea" > <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> </div>
</div> </div>

View File

@ -40,6 +40,10 @@ without it taking a butt-load of space and files while being Non-Javascript frie
</p></noscript> </p></noscript>
</div> </div>
<div id="blogtext" > <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> </div>
</div> </div>

View File

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

View File

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

View File

@ -40,6 +40,10 @@ without it taking a butt-load of space and files while being Non-Javascript frie
</p></noscript> </p></noscript>
</div> </div>
<div id="blogtext" class="hiddenarea" > <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> </div>
</div> </div>

View File

@ -40,6 +40,10 @@ without it taking a butt-load of space and files while being Non-Javascript frie
</p></noscript> </p></noscript>
</div> </div>
<div id="blogtext" class="hiddenarea" > <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> </div>
</div> </div>

View File

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

View File

@ -31,6 +31,10 @@
$blog_content$ $blog_content$
</div> </div>
<div id="blogtext" $blogtext_is_hidden$ > <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> </div>
</div> </div>