From 72b760dc17507a0dece27cdfda993b7b806c4c70 Mon Sep 17 00:00:00 2001 From: Mimi Momo Date: Sat, 26 Sep 2020 18:16:13 -0500 Subject: [PATCH] index page uses css and images; css and img are stored in static dir --- src/index.py | 20 +++++++++++++++--- src/res/img/ele/twitter-ribbon.png~ | Bin 2136 -> 0 bytes src/{res/styles => static/css}/diary.css | 0 src/{res/styles => static/css}/feature.css | 0 src/{res/styles => static/css}/game.css | 0 src/{res/styles => static/css}/index.css | 0 src/{res/styles => static/css}/presskit.css | 0 src/{res/styles => static/css}/style.css | 0 src/{res/styles => static/css}/weekly.css | 0 src/{res => static}/img/bg/homeBG.png | Bin src/{res => static}/img/bg/medallion.png | Bin src/{res => static}/img/bg/medallion_v2.png | Bin src/{res => static}/img/bg/yellow.png | Bin src/{res => static}/img/bg/yellow.png~ | Bin src/{res => static}/img/btn/skillblog.png | Bin .../img/btn/skillblog_pressed.png | Bin src/{res => static}/img/btn/skillchara.png | Bin .../img/btn/skillchara_hover.png | Bin .../img/btn/skillchara_pressed.png | Bin src/{res => static}/img/btn/skillgame.png | Bin .../img/btn/skillgame_hover.png | Bin .../img/btn/skillgame_pressed.png | Bin src/{res => static}/img/btn/skillhover.png | Bin src/{res => static}/img/btn/skillslot.png | Bin .../img/btn/skillslot_hover.png | Bin .../img/btn/skillslot_pressed.png | Bin src/{res => static}/img/btn/skillstory.png | Bin .../img/btn/skillstory_hover.png | Bin .../img/btn/skillstory_pressed.png | Bin src/{res => static}/img/dg/DGrails.gif | Bin src/{res => static}/img/dg/editor.png | Bin src/{res => static}/img/dg/girls.png | Bin src/{res => static}/img/dg/schoolyard.png | Bin src/{res => static}/img/ele/navbar.png | Bin .../img/ele/twitter-ribbon.png | Bin src/{res => static}/img/fav.ico | Bin src/{res => static}/img/icon.png | Bin src/views/feature.tpl | 0 src/views/header.tpl | 2 +- src/views/index.tpl | 2 +- 40 files changed, 19 insertions(+), 5 deletions(-) delete mode 100644 src/res/img/ele/twitter-ribbon.png~ rename src/{res/styles => static/css}/diary.css (100%) rename src/{res/styles => static/css}/feature.css (100%) rename src/{res/styles => static/css}/game.css (100%) rename src/{res/styles => static/css}/index.css (100%) rename src/{res/styles => static/css}/presskit.css (100%) rename src/{res/styles => static/css}/style.css (100%) rename src/{res/styles => static/css}/weekly.css (100%) rename src/{res => static}/img/bg/homeBG.png (100%) rename src/{res => static}/img/bg/medallion.png (100%) rename src/{res => static}/img/bg/medallion_v2.png (100%) rename src/{res => static}/img/bg/yellow.png (100%) rename src/{res => static}/img/bg/yellow.png~ (100%) rename src/{res => static}/img/btn/skillblog.png (100%) rename src/{res => static}/img/btn/skillblog_pressed.png (100%) rename src/{res => static}/img/btn/skillchara.png (100%) rename src/{res => static}/img/btn/skillchara_hover.png (100%) rename src/{res => static}/img/btn/skillchara_pressed.png (100%) rename src/{res => static}/img/btn/skillgame.png (100%) rename src/{res => static}/img/btn/skillgame_hover.png (100%) rename src/{res => static}/img/btn/skillgame_pressed.png (100%) rename src/{res => static}/img/btn/skillhover.png (100%) rename src/{res => static}/img/btn/skillslot.png (100%) rename src/{res => static}/img/btn/skillslot_hover.png (100%) rename src/{res => static}/img/btn/skillslot_pressed.png (100%) rename src/{res => static}/img/btn/skillstory.png (100%) rename src/{res => static}/img/btn/skillstory_hover.png (100%) rename src/{res => static}/img/btn/skillstory_pressed.png (100%) rename src/{res => static}/img/dg/DGrails.gif (100%) rename src/{res => static}/img/dg/editor.png (100%) rename src/{res => static}/img/dg/girls.png (100%) rename src/{res => static}/img/dg/schoolyard.png (100%) rename src/{res => static}/img/ele/navbar.png (100%) rename src/{res => static}/img/ele/twitter-ribbon.png (100%) rename src/{res => static}/img/fav.ico (100%) rename src/{res => static}/img/icon.png (100%) create mode 100644 src/views/feature.tpl diff --git a/src/index.py b/src/index.py index d9989bc..5aa47d5 100644 --- a/src/index.py +++ b/src/index.py @@ -1,5 +1,5 @@ import datetime, os -from bottle import route, run, template +from bottle import error, route, run, static_file, template # write diary @@ -64,12 +64,26 @@ def sort_files(files): def gather_files(): return os.listdir('entries/feature/') -# Webpages +# Static + +@route('/static/css/') +def serve_css(filename): + return static_file(filename, root='static/css') + +@route('/static/img/') +def serve_css(filename): + return static_file(filename, root='static/img') + +# Routes + +@error(404) +def error404(error): + return "unfortunately, a 404 error" @route('/') def index(): """home page""" - info = {'news': 'News goes here', 'title': 'chimchooree\'s dev space - blessfrey', 'year': datetime.datetime.now()} + info = {'css': 'index', 'news': 'News goes here', 'title': 'chimchooree\'s dev space - blessfrey', 'year': datetime.datetime.now()} return template('index.tpl', info) @route('/game') diff --git a/src/res/img/ele/twitter-ribbon.png~ b/src/res/img/ele/twitter-ribbon.png~ deleted file mode 100644 index db116fee54381bf1ad8aac92876f081fc3210c4e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2136 zcmV-e2&eanP)e=Qh-Lqj80ANe=^yr7^R2$7gpbDNcQ9(ZJKz13wtQSjQsfwYE`i43qb z?ys$eO}8zOXt(mnK?yWdNT&NIBI#pkq9+;~z=aADN+f`>7K}agkFI(I;&J%nx);v) z1Hj^xPKN{Lmbqbb<3gC>G!`BXdA%A8XPhI5XYqL}Ydug|QX&MX1r_n>g7(GY@Nq{s zbmF8b*%Ff8UK$I+GflU{(yCdi%fzSkIST#ZiLC2;I(y-V{_C)Q;XGJ@(pQ3@O~C#O zM^x9R58oJp4h3L=Jv<)AW&IGf_a6kWv?Rw1+ML93pl?t!(ELcsXDEH)MAEE(UX=LI z1buwOCjeA4nq)GWf-k#zA&8S^Bom$kCoW8zwFj$-xZpGeLVxZnexfS4ba*!-%_C@eaZ6aXetGRLdrE>G>q?!iqrhvT{V@kdQM%&OPFwxUQN&x$qDpJV$R5DB40Ev_~%c9 zHxRH7CeUq+elx$kOvs9o+%Xp9E(`SD-U0X>Q!51@y*-QBA;nKo$}1+8>|p;8e1{`t zGD*-~DNY282PV~yGSqMe=&n#0KDyeCG8elEjA5q0^V*UIVjW?{O3~*Z7G1+aUg@Sf zIs^23mpTMBU_`LI0Muq41=s|k)I>g+Hs~`D8N8Fm?QFRD1nX`O-#PnQZ*B5 z%-0DS?v~+xctC+pWKbd_X34i1m3yUPQEdYOHV# zPCb-6*>vGg6`s?WfUNG9K)2&qWtOeQGb-SX<;_AHwZCrwu8oHwiXFFXxG1%=K!eH?>~k$k2=F~tpHztvPaQRl1r=pbiats#j>QuK;3~Yn2D@#_w0>;c zPWb|Y{x@TCVXe8>H#p8HeY!Un{U!Du!c4cVsS#dV)(qR48wF;mOr=`p)#Xh>79>|X z=O4rFJZW``3u^8W$XEAGfp(v#8tO2xc3$a(Q=&edpuS$ zq9$m&MN>?nKKl^xZ{qj26e-w_Z~OH?hitOol=#Yn}U_ z1=)_LijHepyAkM=jZ%?<>P-avquvkjdPHoQtOntz5$K4?2g#S0mVT$n-x1sAExL){ z2sCd2G%wcRuOo{wGe5%nF5|~K#V(oAoLY*O{)4{R22QHlf_lrR0i1%pCm+R>Lof4a z1RjOEBzg3Je`TPlDcFF3cNeJPB^6q)s4p0W%q7)aL&@~8Sc6a!SdBORS*RAB zGAR!F+u&A(2r#n!j;ImS(*6grd=wwp3)5gY&pG_~R^?I`WNz2-YM^OZXiN1Vjvdpy zi*#5afpS&TWtwb1jxCD%U^DUx+Xc6vx2h)PW9 z{~(JO_~`~L14TXRS}_25$lU$s^S#%WSHmLgG5q)($8NFC0U4?3`~Cwokt+F(=p={$ O0000{{title or 'blessfrey.me'}} - + diff --git a/src/views/index.tpl b/src/views/index.tpl index abaa9da..6fb085e 100644 --- a/src/views/index.tpl +++ b/src/views/index.tpl @@ -1,7 +1,7 @@ % rebase('frame.tpl')