mirror of
https://github.com/jessebot/tiny_personal_website.git
synced 2025-10-01 01:48:43 +00:00
trying to fix globals
This commit is contained in:
parent
1707be11bc
commit
7d83233828
5 changed files with 41 additions and 7 deletions
11
css/bootstrap.min.css
vendored
Executable file
11
css/bootstrap.min.css
vendored
Executable file
File diff suppressed because one or more lines are too long
|
@ -6,6 +6,12 @@ body {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
.center {
|
||||
float: none;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
|
||||
.rotate90 {
|
||||
-webkit-transform: rotate(90deg);
|
||||
|
|
19
jessebot.py
19
jessebot.py
|
@ -1,51 +1,60 @@
|
|||
# production jessebot.com python file
|
||||
|
||||
import lib
|
||||
import logging
|
||||
from bottle import redirect, request, response, route
|
||||
from bottle import run, static_file, template
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
stream = open(config.yaml)
|
||||
WEB_ROOT = ""
|
||||
WEB_ROOT = get_global_variable(WEB_ROOT)
|
||||
|
||||
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
|
||||
|
||||
logging.info("logging config loaded")
|
||||
|
||||
|
||||
@route('/')
|
||||
def index():
|
||||
return template('index')
|
||||
|
||||
|
||||
@route('/contact')
|
||||
def contact():
|
||||
return template('contact')
|
||||
|
||||
|
||||
@route('/about')
|
||||
def about():
|
||||
return template('about')
|
||||
|
||||
|
||||
@route('/legacy')
|
||||
def legacy():
|
||||
redirect ("http://legacy.jessebot.com")
|
||||
|
||||
|
||||
@route('/hate')
|
||||
def hate():
|
||||
return template('hate')
|
||||
|
||||
|
||||
@route('/photo')
|
||||
@route('/photo/')
|
||||
def photo():
|
||||
redirect('http://photo.jessebot.com')
|
||||
|
||||
|
||||
@route('/images/<filename>')
|
||||
def images(filename):
|
||||
return static_file(filename, root='WEB_ROOT/{0}'.format(images))
|
||||
return static_file(filename, root='{0}/images'.format(WEB_ROOT))
|
||||
|
||||
|
||||
@route('/js/<filename>')
|
||||
def js(filename):
|
||||
return static_file(filename, root='WEB_ROOT/{0}'.format(js))
|
||||
return static_file(filename, root='{0}/js'.format(WEB_ROOT))
|
||||
|
||||
|
||||
@route('/css/<filename>')
|
||||
def css(filename):
|
||||
return static_file(filename, root='WEB_ROOT/{0}'.format(css))
|
||||
return static_file(filename, root='{0}/css'.format(WEB_ROOT))
|
||||
|
|
8
lib.py
Normal file
8
lib.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
import yaml
|
||||
|
||||
def get_global_variable(global_variable):
|
||||
""" gets global variable given string variable name"""
|
||||
with open('./config.yaml', 'r') as f:
|
||||
doc = yaml.load(f)
|
||||
txt = doc["Global"][global_variable]
|
||||
return txt
|
|
@ -11,10 +11,10 @@
|
|||
<title>JesseBot.com</title>
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
<link href="css/starter-template.css" rel="stylesheet">
|
||||
<!--<link href="css/starter-template.css" rel="stylesheet">-->
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="css/bootstrap_flatdark.min.css" rel="stylesheet">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
</head>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue