mirror of
https://github.com/jessebot/tiny_personal_website.git
synced 2025-10-01 01:48:43 +00:00
updating profile blurb and fonts...
This commit is contained in:
parent
06c7f8997a
commit
a902078fb9
3 changed files with 91 additions and 11 deletions
30
config/config.yaml.sample
Normal file
30
config/config.yaml.sample
Normal file
|
@ -0,0 +1,30 @@
|
|||
Globals:
|
||||
# absolute path required
|
||||
web_root: '/var/www/html'
|
||||
# favicon, can take any image type
|
||||
favicon: 'favicon_smile.gif'
|
||||
# domain name, or whatever you want the tab in the browser to say
|
||||
website_title: 'example.com'
|
||||
# the default image shown at the front of the page
|
||||
profile_image: 'my_picture.png'
|
||||
# Your name
|
||||
profile_name: 'Bob Smith'
|
||||
# Quote of any sort you'd like
|
||||
profile_quote: "The internet is great. Please enjoy this sample webpage."
|
||||
# Full URL to your github
|
||||
github_URL: 'https://github.com/jessebot'
|
||||
# complete google doc sharing URL, assuming this is public
|
||||
resume_google_doc: 'https://docs.google.com/document/d/blahblahblah'
|
||||
# in your google doc, you can go to download as and right click copy that
|
||||
# URL, or you can host a live copy at another URL
|
||||
resume_pdf_download: 'https://docs.google.com/document/d/blahblahblah/export?format=pdf'
|
||||
resume_docx_download: 'https://docs.google.com/document/d/blahblahblah/export?format=docx'
|
||||
# setting to false will remove fork me corner banner
|
||||
fork_me: True
|
||||
# Boolean, if set to True, will generate new panel with below info
|
||||
optional_panel: True
|
||||
# this could be social media, other conent, whatever suits you!
|
||||
opt_panel_title: "Linux Newbie Class"
|
||||
opt_panel_image: "penguin_copy.png"
|
||||
opt_panel_button_text: "How To Unix/Linux"
|
||||
opt_panel_URL: "http://howtonix.info/"
|
50
config/example_apache_vhost.conf
Normal file
50
config/example_apache_vhost.conf
Normal file
|
@ -0,0 +1,50 @@
|
|||
<VirtualHost *:80>
|
||||
ServerName example.com
|
||||
ServerAdmin example_user@gmail.com
|
||||
WSGIDaemonProcess example_process_name user=example_user group=example_group processes=1 threads=5
|
||||
WSGIScriptAlias / /path/to/web/root/adapter.wsgi
|
||||
|
||||
<Directory /path/to/web/root>
|
||||
WSGIProcessGroup example_group
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
# comment out next two lines if getting "forbidden" errors
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
# uncomment if getting "forbidden" errors
|
||||
# Require all granted
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
|
||||
# If you need want an SSL, which I recommend, then delete the above content
|
||||
# and use the below as your starting point. You can use
|
||||
# https://letsencrypt.org/howitworks/ to get a free SSL. Thanks, EFF <3
|
||||
<VirtualHost *:80>
|
||||
ServerName example.com
|
||||
# rewriting things to force https traffic
|
||||
RewriteEngine on
|
||||
RewriteCond %{HTTPS} off
|
||||
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
|
||||
</VirtualHost>
|
||||
<VirtualHost *:443>
|
||||
ServerName example.com
|
||||
ServerAdmin example_user@gmail.com
|
||||
# ssl stuff, you can change these paths to where ever you keep your own SSL files
|
||||
SSLEngine on
|
||||
SSLProtocol all -SSLv2 -SSLv3
|
||||
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
|
||||
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
|
||||
# wsgi stuff
|
||||
WSGIDaemonProcess example_process_name user=example_user group=example_group processes=1 threads=5
|
||||
WSGIScriptAlias / /path/to/web/root/adapter.wsgi
|
||||
|
||||
<Directory /path/to/web/root>
|
||||
WSGIProcessGroup example_group
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
# comment out next two lines if getting "forbidden" errors
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
# uncomment if getting "forbidden" errors
|
||||
# Require all granted
|
||||
</Directory>
|
||||
</VirtualHost>
|
|
@ -6,24 +6,25 @@
|
|||
import bottle
|
||||
from bottle import redirect, request, response, route
|
||||
from bottle import run, static_file, template
|
||||
import logging
|
||||
import logging as log
|
||||
import os
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
|
||||
def get_global_variable(global_variable):
|
||||
""" gets global variable given string variable name"""
|
||||
with open('./.config/config.yaml', 'r') as f:
|
||||
with open('./config/config.yaml', 'r') as f:
|
||||
doc = yaml.load(f)
|
||||
txt = doc["Globals"][global_variable]
|
||||
return txt
|
||||
|
||||
|
||||
# set logging
|
||||
log.basicConfig(stream=sys.stderr, level=log.INFO)
|
||||
log.info("logging config loaded")
|
||||
# Grab site specific information
|
||||
WEB_ROOT = get_global_variable('web_root')
|
||||
# set logging
|
||||
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
|
||||
logging.info("logging config loaded")
|
||||
# full path to HTML templates
|
||||
bottle.TEMPLATE_PATH.insert(0,
|
||||
'{0}/front_end/html_templates/'.format(WEB_ROOT))
|
||||
|
@ -36,6 +37,7 @@ def index():
|
|||
main_pic = get_global_variable('profile_image')
|
||||
name = get_global_variable('profile_name')
|
||||
header_quotation = get_global_variable('profile_quote')
|
||||
blurb = get_global_variable('profile_blurb')
|
||||
GitHub_URL = get_global_variable('github_URL')
|
||||
gdoc_URL = get_global_variable('resume_google_doc')
|
||||
resume_pdf_download_URL = get_global_variable('resume_pdf_download')
|
||||
|
@ -57,7 +59,7 @@ def index():
|
|||
resume_docx_download_URL=resume_docx_download_URL,
|
||||
fork_me=fork_me, optional_panel=optional_panel,
|
||||
optional_panel_title=optional_panel_title,
|
||||
optional_panel_pic=optional_panel_pic,
|
||||
optional_panel_pic=optional_panel_pic, blurb=blurb,
|
||||
optional_panel_button_text=optional_panel_button_text,
|
||||
optional_panel_button_URL=optional_panel_button_URL)
|
||||
|
||||
|
@ -76,8 +78,6 @@ def js(filename):
|
|||
def css(filename):
|
||||
return static_file(filename, root='{0}/front_end/css'.format(WEB_ROOT))
|
||||
|
||||
|
||||
# example of how to create another route to something else
|
||||
@route('/hate')
|
||||
def hate():
|
||||
return template('hate')
|
||||
@route('/fonts/<filename>')
|
||||
def fonts(filename):
|
||||
return static_file(filename, root='{0}/front_end/fonts'.format(WEB_ROOT))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue