Initial commit
This commit is contained in:
75
app.py
Normal file
75
app.py
Normal file
@@ -0,0 +1,75 @@
|
||||
# /// script
|
||||
# dependencies = ["flask", "flask_cors", "waitress", "markdown"]
|
||||
# ///
|
||||
import os
|
||||
import json
|
||||
import markdown
|
||||
from flask import Flask, render_template, send_from_directory
|
||||
from flask_cors import CORS
|
||||
|
||||
app = Flask(__name__, template_folder='.', static_folder='static')
|
||||
|
||||
CORS(app)
|
||||
|
||||
@app.route("/favicon.ico")
|
||||
def favicon():
|
||||
return send_from_directory(
|
||||
os.path.join(app.root_path, 'static/assets/favicon.ico'),
|
||||
'favicon.ico', mimetype='image/x-icon'
|
||||
)
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def not_found(e):
|
||||
return render_template("./templates/not_found.html")
|
||||
|
||||
@app.route("/home")
|
||||
def home():
|
||||
return render_template("./templates/home.html")
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return render_template("./templates/home.html")
|
||||
|
||||
@app.route("/posts")
|
||||
def posts():
|
||||
posts = []
|
||||
for folder in os.listdir("./static/posts"):
|
||||
with open(os.path.join("./static/posts", folder, "metadata.json"), "r") as f:
|
||||
metadata = json.load(f)
|
||||
|
||||
post = {
|
||||
"post_id": folder,
|
||||
"metadata": metadata,
|
||||
}
|
||||
|
||||
posts.append(post)
|
||||
|
||||
return render_template("./templates/post_list.html", posts=posts)
|
||||
|
||||
|
||||
@app.route("/posts/<post_id>")
|
||||
def get_post(post_id):
|
||||
for folder in os.listdir("./static/posts"):
|
||||
if folder == post_id:
|
||||
with open(os.path.join("./static/posts", folder, "metadata.json"), "r") as f:
|
||||
metadata = json.load(f)
|
||||
with open(os.path.join("./static/posts", folder, "post.md"), "r") as f:
|
||||
post_md = f.read()
|
||||
post_html = markdown.markdown(post_md, extensions=["tables"])
|
||||
|
||||
post = {
|
||||
"post_id": post_id,
|
||||
"metadata": metadata,
|
||||
"post_md": post_html,
|
||||
}
|
||||
|
||||
return render_template("./templates/post.html", post=post)
|
||||
|
||||
return render_template("./templates/not_found.html")
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from waitress import serve
|
||||
serve(app, host="0.0.0.0", port=8080)
|
BIN
archive posts/MECC2024/images/arch.png
Normal file
BIN
archive posts/MECC2024/images/arch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
7
archive posts/MECC2024/metadata.json
Normal file
7
archive posts/MECC2024/metadata.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"title": "Using Graph attention to get graphs",
|
||||
"date": "05-30-2025",
|
||||
"description": "A little post to test stuff out",
|
||||
"image": "None",
|
||||
"tags": ["very", "gay"]
|
||||
}
|
12
archive posts/MECC2024/post.md
Normal file
12
archive posts/MECC2024/post.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Introduction
|
||||
|
||||
|
||||
|
||||
# Section 1
|
||||
|
||||
|
||||
|  |
|
||||
|:--:|
|
||||
| *Architecture of the Model* |
|
||||
|
||||
this is an image
|
BIN
static/assets/courier_prime/.DS_Store
vendored
Normal file
BIN
static/assets/courier_prime/.DS_Store
vendored
Normal file
Binary file not shown.
44
static/assets/courier_prime/Read me.txt
Normal file
44
static/assets/courier_prime/Read me.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
ABOUT COURIER PRIME
|
||||
===================
|
||||
|
||||
Courier Prime is a TrueType monospaced font designed specifically for screenplays. It was designed by Alan Dague-Greene for John August and released by Quote-Unquote Apps under the SIL Open Font License (OFL).
|
||||
|
||||
Visit http://quoteunquoteapps.com/courierprime for more information and the latest updates.
|
||||
|
||||
SIL Open Font License: http://scripts.sil.org/OFL
|
||||
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
Mac OS X:
|
||||
|
||||
Select all the font files and double-click the selected files. Then, click 'Install Font' at the bottom of the preview window.
|
||||
|
||||
Windows 7 & 8:
|
||||
|
||||
The easiest way to install a font is to double-click on a font file to open the font preview and select 'Install'.
|
||||
|
||||
Windows Vista:
|
||||
|
||||
To install a TrueType or OpenType font on Windows Vista, right-click on the font file and then select 'Install'. You can also drag or paste a font into the Fonts Control Panel.
|
||||
|
||||
Windows XP:
|
||||
|
||||
1. From the 'Start' menu select 'Control Panel', then select the 'Appearance and Themes' category.
|
||||
|
||||
2. Select 'Fonts' from the 'See Also' panel at the left of this screen.
|
||||
|
||||
3. On the 'File' menu, select 'Install New Font...'
|
||||
|
||||
4. Click the drive and folder that contain the fonts you want to add.
|
||||
|
||||
5. To select more than one font to add, press and hold down the CTRL key, click the fonts you want, then click on 'OK'.
|
||||
|
||||
For more information on installing fonts on Windows, visit this link: http://www.microsoft.com/typography/truetypeinstall.mspx
|
||||
|
||||
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
January 25, 2013 Courier Prime version 1.203
|
||||
- Initial release
|
BIN
static/assets/courier_prime/courer_prime_italic.ttf
Normal file
BIN
static/assets/courier_prime/courer_prime_italic.ttf
Normal file
Binary file not shown.
BIN
static/assets/courier_prime/courier_prime.ttf
Normal file
BIN
static/assets/courier_prime/courier_prime.ttf
Normal file
Binary file not shown.
BIN
static/assets/courier_prime/courier_prime_bold.ttf
Normal file
BIN
static/assets/courier_prime/courier_prime_bold.ttf
Normal file
Binary file not shown.
BIN
static/assets/courier_prime/courier_prime_bold_italic.ttf
Normal file
BIN
static/assets/courier_prime/courier_prime_bold_italic.ttf
Normal file
Binary file not shown.
BIN
static/assets/favicon.ico
Normal file
BIN
static/assets/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 318 B |
BIN
static/assets/images/dp.jpeg
Normal file
BIN
static/assets/images/dp.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
125
static/style.css
Normal file
125
static/style.css
Normal file
@@ -0,0 +1,125 @@
|
||||
@font-face {
|
||||
font-family: "typewriter";
|
||||
src: url("assets/courier_prime/courier_prime.ttf") format("truetype");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "typewriter";
|
||||
src: url("assets/courier_prime/courier_prime_bold.ttf") format("truetype");
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "typewriter";
|
||||
src: url("assets/courier_prime/courier_prime_italic.ttf") format("truetype");
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "typewriter";
|
||||
src: url("assets/courier_prime/courier_prime_bold_italic.ttf") format("truetype");
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
h1, h3, p {
|
||||
font-family: "typewriter";
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
text-decoration: none !important;
|
||||
color: inherit !important;
|
||||
font-family: 'typewriter';
|
||||
font-size: 20px;
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
.posts {
|
||||
display: block;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#posts-title {
|
||||
font-family: "typewriter";
|
||||
margin-bottom: 8rem;
|
||||
}
|
||||
|
||||
#post_listing {
|
||||
justify-items: left;
|
||||
text-align: left;
|
||||
margin-left: 100px;
|
||||
/* border: 2px solid black; */
|
||||
background-color: rgb(166, 156, 156, 0.1) ;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 1px;
|
||||
border-radius: 10px;
|
||||
margin-top: 0;
|
||||
padding-top: 4px;
|
||||
|
||||
}
|
||||
|
||||
#post_listing h1 {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
#post_listing h3 {
|
||||
margin-bottom: 4px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.post {
|
||||
justify-items: center;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
width: 50%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.post_meta {
|
||||
justify-items: center;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.post_body {
|
||||
width: 100%;
|
||||
justify-items: left;
|
||||
text-align: left;
|
||||
align-items: left;
|
||||
margin-bottom: 0;
|
||||
padding-left: 10%;
|
||||
/* padding-right: 20%; */
|
||||
font-family: "typewriter";
|
||||
}
|
||||
|
||||
.post_body h1 h2 h3 {
|
||||
font-family: "typewriter";
|
||||
}
|
||||
|
||||
table {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
33
templates/home.html
Normal file
33
templates/home.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Akshay Kolli</title>
|
||||
<link rel="icon" href="{{ url_for('static', filename='assets/favicon.ico') }}" type="image/x-icon" >
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" type="text/css" >
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<header><a class="header_link" href="/posts">Posts</a> <a class="header_link" href="/">Home</a>
|
||||
<a class="header_link" href="https://code.akshaykolli.net">Code</a>
|
||||
</header>
|
||||
|
||||
|
||||
<img src="static/assets/images/dp.jpeg" style="float: left; padding: 10px;"/>
|
||||
<h1>Akshay Kolli</h1>
|
||||
<h3>CS PhD candidate at UMass Lowell</h3>
|
||||
<p>
|
||||
Hello! I love ALMOST everything about machine learning, software engineering, physics, Jimi Hendrix and building stuff in general.
|
||||
I do stuff with CUDA (Nvidia please be nicer to people), Python and Rust. Always excited about new hardware and software. Do reach out to me if you
|
||||
you want to tell me about cool stuff.
|
||||
|
||||
|
||||
</p>
|
||||
<p>
|
||||
reach me at echo -n "YWtzaGF5a29sbGlAaG90bWFpbC5jb20=" | base64 --decode.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
32
templates/not_found.html
Normal file
32
templates/not_found.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Akshay Kolli</title>
|
||||
<link rel="icon" href="{{ url_for('static', filename='assets/favicon.ico') }}" type="image/x-icon" >
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='assets/style.css') }}" type="text/css" >
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "typewriter";
|
||||
src: url("{{ url_for('static', filename='assets/royal_quiet_deluxe.ttf') }}") format("truetype");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: "typewriter";
|
||||
}
|
||||
p {
|
||||
font-family: "typewriter";
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<h1>404 ERROR</h1>
|
||||
<button><a href="/">Go home</a></button>
|
||||
</body>
|
||||
</html>
|
32
templates/post.html
Normal file
32
templates/post.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Akshay Kolli</title>
|
||||
<link rel="icon" href="{{ url_for('static', filename='assets/favicon.ico') }}" type="image/x-icon" >
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" type="text/css" >
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<header><a href="/posts">Posts</a> <a href="/">Home</a></header>
|
||||
<div class="post">
|
||||
|
||||
<div class="post_meta">
|
||||
<h1>{{ post.metadata.title }}</h1>
|
||||
<h3>{{ post.metadata.date }}</h3>
|
||||
<h3>{{ post.metadata.description }}</h3>
|
||||
</div>
|
||||
|
||||
<div class="post_body">
|
||||
{{ post.post_md| safe }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
36
templates/post_list.html
Normal file
36
templates/post_list.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Akshay Kolli</title>
|
||||
<link rel="icon" href="{{ url_for('static', filename='assets/favicon.ico') }}" type="image/x-icon" >
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" type="text/css" >
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<header><a href="/posts">Posts</a> <a href="/">Home</a></header>
|
||||
|
||||
<span class="posts">
|
||||
<h1 id="posts-title">Posts</h1>
|
||||
{% if posts|length == 0 %}
|
||||
<h1>Well this is awkward, I swear I had some posts</h1>
|
||||
|
||||
{% endif %}
|
||||
{% for post in posts %}
|
||||
<a class="post_a" href="posts/{{ post.post_id}}">
|
||||
<div id="post_listing" >
|
||||
|
||||
<h1>{{ post.metadata.title }}</h1>
|
||||
<h3>{{ post.metadata.date }}</h3>
|
||||
<h3>{{ post.metadata.description }}</h3>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
</span>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user