def projects(request): """ 1. Convert the markdown strings on the top of the page to html 2. Render the response """ heading_html = Post.md_to_html(HEADING) projects = Project.objects.filter(is_published=True).order_by('-created').prefetch_related('tags') for p in projects: p.tag_names = [tag.name for tag in p.tags.all()] return render(request, 'projects.html', { "heading": heading_html, "projects": projects })
def html_description(self): return Post.md_to_html(self.description)
def about(request): about_html = Post.md_to_html(ABOUT_ME) print(about_html) return render(request, "about.html", {"about": about_html})