vscode opened to index.html

This Website

This is a Django website created on a DigitalOcean droplet.

This site is the culmination of my education so far. It is a Django site created on a DigitalOcean Droplet. The droplet was set up manually using an excellent tutorial. It required learning linux comand line interface, nginx, lets encrypt and gunicorn. The droplet is currently hosting two websites, a postgresql db and a subdomain for tylerday.net.

I've become much more comfortable using cli and am grateful that I used cli for Git rather than a visual ui since it translated so easily to using Git on ubuntu. I am also glad that I chose to set up the server manually. It's significantly improved my understanding of how the internet works.

Spider lurks in the middle of a web
published: 3/2/20 4:04 a.m.

Markdown

I spent the greater part of the day attempting to upgrade the blogging capability of this site with markdown.

I've been planning on making the change for ages and this morning I ran across this post

"I was building a tiny microservice which would let the client side application securely authenticate with GitHub. After writing the only required API, I wanted to render the README.md file on the index page."

The lack of any type of styling in the previous sentence indicates I need to add blockquotes to my css style list. It's a pretty simple implementation. I've used it in Wagtail, but I didn't feel like my site needs all that wagtail brings along with it. I didn't want to have to redo all my fields with wagtail stream fields.

import markdown
from django import template
from django.template.defaultfilters import stringfilter
from pygments.formatters import HtmlFormatter

register = template.Library()

@stringfilter
@register.filter(name='markdown', is_safe=True)
def markdown_to_html(value):
    md_template_string = markdown.markdown(value, extensions=['extra', 'codehilite'])
    return md_template_string
    # formatter = HtmlFormatter(style="tango",full=True,cssclass="codehilite")
    # css_string = formatter.get_style_defs()
    # md_css_string = "<style>" + css_string + "</style>"

    # md_template = md_css_string + md_template_string
    # return md_template


# register.filter('markdown', markdown_to_html)

Most of this code has been commented out. It was initially used to experiment with the various pygment formatters. I'm afraid I'm going to run into problems with this implementation but I'm happy with it so far. And it makes blogging significantly more enjoyable than it was before.