snehesht / blog Goto Github PK
View Code? Open in Web Editor NEWMinimalist database less blog engine
Home Page: https://snehesh.me
Minimalist database less blog engine
Home Page: https://snehesh.me
finally
block below when no url is found data[bp['file']]
has no value.# app/views.py
def blog_post(url_slug):
data = DS.get_data()
metadata = DS.get_metadata()
bp = {}
try:
# ISSUE-1a: If below raises an exception
for item in metadata:
# Search for metadata of the blogpost with that url
if item['url'] == url_slug:
bp = item
except Exception as e:
# No such blogpost
return redirect(url_for('index_page'))
finally:
# ISSUE-1b: 'bp' is still and empty dict
raw_content = data[bp['file']]
processed_content = Markup(markdown.markdown(raw_content))
return render_template('blog_post.html', content=processed_content,metadata=bp)
def blog_post(url_slug):
data = DS.get_data()
metadata = DS.get_metadata()
bp = {}
# Search for metadata of the blogpost with that url
bp = [item for item in metadata if item['url'] == url_slug]
if not bp:
# No such blogpost
return redirect(url_for('blog_index_page'))
else:
# TODO: Decide how to handle multiple blog posts with the same title
# Idea: During data load/reload, throw an error if duplicate title is found
bp = bp.pop(0)
raw_content = data[bp['file']]
processed_content = Markup(markdown.markdown(raw_content))
return render_template('post.html', content=processed_content, metadata=bp)
When my account was compromised a spam issue was created in this repo. I sincerely apologize. Cleaning up such issues via script.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.