• I've been avoiding dynamic content and Javascript in Tanzawa for as long as possible. Today I spent installing webpack and configuring my first stimulus controller. The controller is quite simple: open a details tag on hover and close it when not.

    I think it still needs a little fine-tuning with the display timing. Seeing the toggle when a user goes to click New Status is jarring. Likewise closing immediately when no longer hovering is a source of frustration. So adding a shortΒ  delay before performing either action would likely make it a bit easier to use.

    The other side-benefit of starting to use stimulus is that it's helping me break up my templates into more reusable and logical components.

    Toggling the "New Post" menu
  • I kinda want to move my server to FreeBSD. Maybe once I get Tanzawa to the point where I can migrate my blog over from WP to Tanzawa.

  • I've started working articles with Tanzawa. Fundamentally they're the same as notes, except they have a name. Authoring an article looks much the same as a status.

    Authoring an article in Tanzawa


    Viewing an article on Tanzawa adds a title to the top. I also revisited the "byline" and made it italic. I've added light gray border to the footer of the post so you can visually tell when a post ends. The main post list view also has been updated to use this same color.

    An article in Tanzawa


    Once I add some tests to confirm that micropub is assigning post kinds properly I think I can ship article support. Once shipped, I may modify my publishing schedule from "at least one post a day everyday" to a weekly round upΒ  plus a status note or two as I have work to share.
  • Feeling a bit tired today but not wanting to break the chain of progress, I managed to get just a little bit done today.

    I implemented Stream RSS feeds. This allows readers to subscribe to just a specific stream, rather than the entire river. You could also use the stream feeds to selectively syndicate content elsewhere e.g. I want all my status and article posts to syndicate to micro.blog, but not my checkins.
  • When authoring a post you can now select which streams you'd like for them to appear in.Β  As each stream can have different visibility settings we show them along with the stream in understandable terms.

    Selecting streams with Tanzawa


    Next up is adding feeds for each stream type and setting the stream on micropub requests.
  • I started work on implementing streams this morning. This is what it's looking like on the public side with the default streams. Feels nice to be working on user-facing features again.

    Tanzawa with streams


  • No coding today. Planning and thinking about how to implement Streams, one of my core ideas behind Tanzawa.

    Streams will help you categorize and posts and blogs. You have a running stream, a status stream, a checkins steam. Each stream is independent of each other and each stream flows into the main Tanzawa stream.

    Posts of any kind can appear in any stream. Streams will be listed on the left and have their own feed.Β  In micropub parlance these would be tags or categories.Β 

    Some streams may be unlisted streams, entirely off the map, hiding all contents from anyone that isn’t logged in.Β 

    Once streams are working, I can start modeling checkin and address data requirements and add support to micropub.

    β€”β€”β€”

    The other thing I’m starting to think about is how other people could start using Tanzawa. Initial setup a little involvedΒ  as SQLite needs Geo extensions installed to work. A Docker container would be easiest to make it all work, but even that’s a hurdle to getting started.Β 

    I could provide hosting, but I’m not sure I want that kind of responsibility yet.Β  One step at a time.
  • After confirming that the <html> tag inside the <figure> tag was causing the errors with Feedly I went and fixed all posts. Below is the script I ran in the django shell.
    Happy to report that Tanzawa is once again producing valid rss.

    from bs4 import BeautifulSoup
    from post.models import TPost
    
    for t_post in TPost.objects.all():
        entry = t_post.ref_t_entry.first()
        soup = BeautifulSoup(entry.e_content, 'html.parser')
        for html in soup.find_all('html'):
            try:
                pic = html.find('picture').extract()
            except AttributeError:
                # no pic
                continue
            html.replace_with(pic)
        entry.e_content = str(soup)
        entry.save()

    Also being able to back up and restore your site's database with a simple "cp db.sqlite3 db.sqlite3.bak" is soooooooo nice.
  • As of today, Tanzawa officially supports IndieAuth and Micropub. Micropub is still a work-in-progress, but it works for basic note and articles with photos. I also pushed the RSS fix so _new_ posts with images should display properly for Feedly users. By the way - this post was made with Quill.
  • Figured out (I think) the issue with my Feedly feeds and images. I use BeautifulSoup and Django templates to rewrite the image tags generated by Trix to be lazy loading and offer optimized formats on the backend.

    picture = BeautifulSoup(
        render_to_string("trix/picture.html", context),"html5lib"
    )

    The issue is that the the "html5lib" causes my <figure> tag to be wrapped in <html> and <body> tags. Browsers are smart enough to filter this out. But these other parsers are not.

    Changing this line to use the "html.parser" prevents wrapping my template in html tags and should solve the issue.

    picture = BeautifulSoup(
        render_to_string("trix/picture.html", context), 'html.parser'
    )
Previous 48 of 60 Next