entires renders in web page, but it's just a copy of contact for now; moved entires to root

small-nav
chimchooree 4 years ago
parent bd7742c51e
commit ace0c10f3c

@ -9,7 +9,7 @@ def file_to_string(f):
return text return text
def fill_text(f): def fill_text(f):
return file_to_string('res/head.txt') + file_to_string(f) + file_to_string('res/tail.txt') return file_to_string(f) #file_to_string('res/head.txt') + file_to_string(f) + file_to_string('res/tail.txt')
def create_files(files, directory): def create_files(files, directory):
for f in files: for f in files:

@ -1,8 +1,3 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>9 weekly roundup</h1> <h1>9 weekly roundup</h1>
august 4-8, 2020 august 4-8, 2020
css, html, php, server, website<br> css, html, php, server, website<br>
@ -38,6 +33,3 @@
<li>added images to live site <a href="200808.html">despite conflicts with Linux's security</a></li> <li>added images to live site <a href="200808.html">despite conflicts with Linux's security</a></li>
</ul> </ul>
<br> <br>
</div>
% include diary-boxes.tpl

@ -1,8 +1,3 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>8 what is blessfrey? </h1> <h1>8 what is blessfrey? </h1>
august 10, 2020<br> august 10, 2020<br>
<br> <br>
@ -19,6 +14,3 @@ Skills are gained through exploration of the game world. As you encounter enemie
Blessfrey has been lots of fun to work on. I hope you enjoy it once a demo and eventually a game drops. <br> Blessfrey has been lots of fun to work on. I hope you enjoy it once a demo and eventually a game drops. <br>
<br> <br>
chimchooree<br> chimchooree<br>
</div>
% include diary-boxes.tpl

@ -1,8 +1,3 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>7 all weekly updates</h1> <h1>7 all weekly updates</h1>
august 13, 2020<br> august 13, 2020<br>
<br> <br>
@ -48,6 +43,3 @@ function gather_files() {
convert_files(gather_files()); convert_files(gather_files());
?> ?>
<br><br> <br><br>
</div>
% include diary-boxes.tpl

@ -1,8 +1,3 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>6 weekly roundup</h1> <h1>6 weekly roundup</h1>
august 9-15, 2020 august 9-15, 2020
apache, automation, css, html, jenkins, nginx, php, server, website<br> apache, automation, css, html, jenkins, nginx, php, server, website<br>
@ -39,6 +34,3 @@ apache, automation, css, html, jenkins, nginx, php, server, website<br>
</ul> </ul>
<br> <br>
</div>
% include diary-boxes.tpl

@ -1,14 +1,6 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>5 my favorite GDC talks </h1> <h1>5 my favorite GDC talks </h1>
september 18, 2020<br> september 18, 2020<br>
<br> <br>
I really should be keeping a list of these with descriptions, so why not keep them in an article?<br> I really should be keeping a list of these with descriptions, so why not keep them in an article?<br>
<br> <br>
Work on it later.<br> Work on it later.<br>
</div>
% include diary-boxes.tpl

@ -1,8 +1,3 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>4 weekly roundup</h1> <h1>4 weekly roundup</h1>
september 13-19, 2020 september 13-19, 2020
bottle<br> bottle<br>
@ -16,6 +11,3 @@ bottle<br>
<li>Used Bottle to avoid repeating html code in navigation pane, header, and footer</li> <li>Used Bottle to avoid repeating html code in navigation pane, header, and footer</li>
</ul> </ul>
<br> <br>
</div>
% include diary-boxes.tpl

@ -1,8 +1,3 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>3 weekly roundup</h1> <h1>3 weekly roundup</h1>
september 20-26, 2020 september 20-26, 2020
bottle<br> bottle<br>
@ -17,6 +12,3 @@ bottle<br>
<li>Updated the blessfrey.me script to serve static content like CSS stylesheets + images. Now the pages are actually styled.</li> <li>Updated the blessfrey.me script to serve static content like CSS stylesheets + images. Now the pages are actually styled.</li>
</ul> </ul>
<br> <br>
</div>
% include diary-boxes.tpl

@ -1,8 +1,3 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>2 why bottle over php? </h1> <h1>2 why bottle over php? </h1>
october 1, 2020<br> october 1, 2020<br>
<br> <br>
@ -14,6 +9,3 @@ It's useful because it lets you reuse code for HTML, supports simple HTML templa
<br> <br>
It's still good to practice with, since it's a widely used web development language, and I feel like understanding it brings me closer to the PHP petsites of the mid-2000s which I dearly love.<br> It's still good to practice with, since it's a widely used web development language, and I feel like understanding it brings me closer to the PHP petsites of the mid-2000s which I dearly love.<br>
<br> <br>
</div>
% include diary-boxes.tpl

@ -1,8 +1,3 @@
% rebase('feature.tpl')
<div class="body-row"> </div>
<div class="diary-entry">
<h1>1 this week</h1> <h1>1 this week</h1>
september 27-october 3, 2020 september 27-october 3, 2020
bottle, css, git, html, regex, regular expressions, website<br> bottle, css, git, html, regex, regular expressions, website<br>
@ -22,6 +17,3 @@ bottle, css, git, html, regex, regular expressions, website<br>
</ul> </ul>
<br> <br>
<br> <br>
</div>
% include diary-boxes.tpl

@ -1,10 +1,9 @@
import datetime, os, re import datetime, os, re
from bottle import error, route, run, static_file, template from bottle import error, route, run, static_file, template, TEMPLATE_PATH
loc = 'diary/entries/' loc = 'entries/'
def list_headlines(articles): def list_headlines(articles):
head = count_lines(loc + 'raw/res/head.txt')
result = [] result = []
text = [] text = []
@ -16,15 +15,19 @@ def list_headlines(articles):
b = [] b = []
b.append(path) b.append(path)
b.append(clean(text[head].replace('<br>',''))) b.append(clean(text[0].replace('<br>','')))
result.append(b) result.append(b)
return result return result
def retrieve_article(page):
text = []
with open(loc + page) as f:
text = f.readlines()
return text
def list_snippets(articles): def list_snippets(articles):
limit = 4 limit = 4
total = len(articles) total = len(articles)
head = count_lines(loc + 'raw/res/head.txt')
tail = count_lines(loc + 'raw/res/tail.txt')
result = [] result = []
for article in articles: for article in articles:
@ -35,15 +38,15 @@ def list_snippets(articles):
with open(loc + article) as f: with open(loc + article) as f:
text = f.readlines() text = f.readlines()
length = len(text) length = len(text)
a.append(clean(text[head])) # title a.append(clean(text[0])) # title
content = snip_article(find_content(article, length, head, tail), path) content = snip_article(find_content(article, length), path)
if content.count('<ul>') > content.count('</ul>'): if content.count('<ul>') > content.count('</ul>'):
content += '</ul>' content += '</ul>'
a.append(content) # snippet a.append(content) # snippet
a.append(text[head + 1].replace('<br>','')) # timestamp a.append(text[1].replace('<br>','')) # timestamp
a.append('/' + path.replace('.tpl','')) # URL a.append('/' + path.replace('.tpl','')) # URL
a.append(clean(text[head]).replace(' ','+')) # social media title a.append(clean(text[0]).replace(' ','+')) # social media title
result.append(a) result.append(a)
return result return result
@ -53,11 +56,11 @@ def count_lines(fname):
pass pass
return linenum return linenum
def find_content(article, length, head, tail): def find_content(article, length):
content = "" content = ""
with open(loc + article) as f: with open(loc + article) as f:
for pos, line in enumerate(f): for pos, line in enumerate(f):
if pos > head + 1 and pos < length - tail: if pos > 1 and pos < length:
content += line content += line
return content return content
@ -131,11 +134,16 @@ def diary(page):
info = {'css': 'diary', 'title': 'blessfrey - developer diary', 'year': datetime.datetime.now(), 'snippets': list_snippets(sort_files(gather_files())), 'latest': list_headlines(sort_files(gather_files())[0:5]), 'total': len(gather_files()), 'limit': 4, 'cluster': 3, 'page': page} info = {'css': 'diary', 'title': 'blessfrey - developer diary', 'year': datetime.datetime.now(), 'snippets': list_snippets(sort_files(gather_files())), 'latest': list_headlines(sort_files(gather_files())[0:5]), 'total': len(gather_files()), 'limit': 4, 'cluster': 3, 'page': page}
return template('diary.tpl', info) return template('diary.tpl', info)
@route('diary/entries/<page>') @route('/entries/<page:int>')
def entry(page): def entry(page):
"""diary entry""" info = {'css': 'box', 'title': 'blessfrey - credits', 'year': datetime.datetime.now()}
info = {'css': 'diary', 'title': 'blessfrey - developer diary', 'year': datetime.datetime.now(), 'latest': list_headlines(sort_files(gather_files())[0:5]), 'page': page} abs_app_dir_path = os.path.dirname(os.path.realpath(__file__))
return template('feature.tpl', info) abs_views_path = os.path.join(abs_app_dir_path, 'views')
TEMPLATE_PATH.insert(0, abs_views_path )
return template(os.path.join(abs_views_path,'contact.tpl'), info)
# """diary entry"""
# info = {'css': 'diary', 'title': 'blessfrey - developer diary', 'year': datetime.datetime.now(), 'entry': retrieve_article(page), 'latest': list_headlines(sort_files(gather_files())[0:5]), 'page': page}
# return template('feature.tpl', info)
@route('/box') @route('/box')
def box(): def box():

@ -15,6 +15,15 @@
<h1>Web Design</h1> <h1>Web Design</h1>
<ul> <ul>
<li>https://www.otomate.jp/home/game/ - any of their games. so pretty</li> <li>https://www.otomate.jp/home/game/ - any of their games. so pretty</li>
<li>https://www.otomate.jp/amnesia/switch/</li>
<li>https://www.otomate.jp/varibarri/</li>
<li>https://www.otomate.jp/tierblade/fd/</li>
<li>https://www.otomate.jp/chouchoujiken/</li>
<li>https://www.otomate.jp/bw_alice/</li>
<li>https://www.otomate.jp/psychedelica/aa-nisus/</li>
<li>https://www.otomate.jp/collar_malice/</li>
<li>https://www.otomate.jp/bw_alice/twilight/</li>
<li>https://www.nintendo.co.jp/n08/agfj/index.html</li>
</ul> </ul>
<br> <br>
<div class="footer-row"> </div> <div class="footer-row"> </div>

@ -1,11 +1,12 @@
% rebase('frame.tpl') % rebase('frame.tpl')
<!--left column--> <div class="body-row"> </div>
<div class="entry">
{{!base}}
<!--left column-->
<div class="diary-entry">
{{entry}}
<br>
</div> </div>
% include diary-boxes.tpl % include diary-boxes.tpl

Loading…
Cancel
Save