Open mkmoisen opened 7 years ago
Ok, I standardized it.
I took the make_url
out of /blog/category/<url_name>/
and renamed it to make_post_url
. I also added a make_category_url
.
Everything now calls these, and the URLs are created on the backend. All the url logic in the front end has been removed.
The only exception is get_project_table_of_contents
. Since this gets all of the related project posts for a single post anyways, there is no need to call out to make_post_url
.
Where do I create URLs? I seem to mix and match between the python code and the templates.
For example, the
/
url logic is mixed is in the template, and the backend. The backend sends a flag of "is_project" if the post is the intro post to a project, and then the front end determines the URL as /project/./blog/category/
is similar to/
, except this is for category urls, not post urls./projects/
is similar to/
and/blog/category/
except it only returns projects (is_project is always true)/blog/category/url_name/
does it better. It has its ownmake_url
function that sets the proper url. The templatecategory-posts.html
simply prints it out.get_project_table_of_contents
method looks similar to/blog/category/
except it doesn't handle resume. It is used bypost
to find the TOC if this post is within a project.