Django website update, Feb-Mar
I've been migrating to a new website structure over the past month and a half, built on the foundation of Django. This has given me the opportunity to learn about Django, but also to begin the process of documenting my own work in such a way that I can share it with others in a more formalized way and test new ways of teaching online. I know it's gotten a little quiet over in my corner, but I've been heads down, finishing up some of the niggling issues that have kept me from feeling like it's ready to share. At this point, however, I think I can share some of that functionality with you.
Here is a summary of my work on the website, with more updates on the way related to robotics, teaching, etc.
In the past, if there was a note to myself, I just threw it on my website, which was statically generated. Any functionality that it included was part of the static site generator or some sort of external third-party cloud-based service that had a free tier. The purpose of this redevelopment has been to onboard some of that functionality into my own site, make that website more easily managed, all while not breaking the basic utility that Markdown has brought me in my daily writing activities.
So I've been documenting my progress, from zero up to a fully functioning site. I start with a bare bones example of getting markdown integrated into a web framework like Django. Most recently coming from Hugo as a static site generator, I spent some time re-implementing some of my favorite functionality from that project, most importantly, the ability to generate a website structure from a file folder hierarchy.
Search. I implemented a full text search using Django's requests functionality, adding a form on the top nav bar to allow you to search for text within posts from any page.
Images. I added glightbox functionality to my site which converts any image in my markdown to a G. Lightbox gallery on the final rendered webpage. Even cooler, the original alt text from my markdown renders as a caption.
Static files handling. One of the challenges of working with a pre-existing file structure is that I don't want to spend my life restructuring it just to get my website to work. How do you read in Markdown files into Django's database while keeping the links to static files working? Well, through a mix of Python markdown extensions and some of the internal machinery of Django, I now have that working.
Contact. Recently I just finished a new contact form that allows you to send me a message without opening another email client or messaging app. This is a great basis for me to start working on email based verification as well for other purposes.
Tags. One of my earliest features, this connects to the YAML preamble data at the front of every markdown file. inside this header information includes tags that I had previously used on my last static site generator. I've re-implemented it on my current website so that you can now find posts by tag.
Pages. I created a cool new kind of container for several posts at a time that I call a page. The the front page of my website is an instance of this, though I plan to use it in other places in the future. It allows me to select and organize specific posts that are thematically related, while specifying a custom template if need be.
Web host configuration and setup. I've been using Docker to run various containers that run the various parts of my hosting project, including web proxies, databases, web servers, and file servers. The design of these relationships has required a little bit more nuance than I'm used to, as I want to minimize any interruptions if I restart one component, while still keeping some of the manageability that I'm used to as a developer.
Style and formatting. I know it's a bit old school, but I've been using Bootstrap framework for all of my styling. I chose Bootstrap simply because I've used it for over 10 years on other projects, and though I had to migrate to Bootstrap 5, it seemed like a natural extension that I didn't have to fully relearn.
Automated import. I don't believe this is a finished feature yet, but I created an import tool that allows me to bring in my entire old static markdown file structure in one go.
Navigation through my file structure. I already structured my website once, through the way I put markdown files in the file folder structure of my source. I wanted my website to reflect that. It took a little bit of work and I think I could do it better now, but you can navigate through the website in the same way that the files are laid out on disk. This keeps it simple to manage the relationships on my site because it just reflects the structure that's already there.
Archives. I made it possible to browse through posts with dates by month.
I'll have more too share soon on the other things, but take a look around, and give me feedback!