Technical post today. Wordpress.
I like doing write-ups of grammar, vocabulary, and kanji as doing a write-up often helps with learning. It also gives me something to look back on.
The problem is a lack of any way to easily compose the kind fo posts I like to write, examples from manga.
Here’s an example posting:
Here’s what the post looks like underneath:
<p><a href="/ones-house-with-〜んち/">Grammar Explanation</a></p>
<div class="example">
[caption id="attachment_3069" align="alignright" width="300"]<a href="http://japanese.kurifuri.com/wp-content/uploads/三ツ星カラーズ-volume-4-page-38-panel-1.jpg"><img class="size-medium wp-image-3069 border" src="http://japanese.kurifuri.com/wp-content/uploads/三ツ星カラーズ-volume-4-page-38-panel-1-300x147.jpg" alt="" width="300" height="147"></a> 三ツ星カラーズ » Volume 4 » Page 38[/caption]
<p> </p>
<p class="summary">Sacchan and her friends decide to make a movie about the district they live in. They stop by Sacchan's mother's shop to film a scene.</p>
<dl class="dialogue">
<dt class="noruby">さっちゃん:</dt>
<dd>「<ruby>次<rp>(</rp><rt>つぎ</rt><rp>)</rp></ruby>はうち<strong>んち</strong>!<ruby>黄瀬<rp>(</rp><rt>きせ</rt><rp>)</rp></ruby>フルーツ。これがかあちゃん」</dd>
<dd>"Next is my place! Kise Fruits. This is my mom."</dd>
<dt>お<ruby>母<rp>(</rp><rt>かあ</rt><rp>)</rp></ruby>さん:</dt>
<dd>「<ruby>黄瀬<rp>(</rp><rt>きせ</rt><rp>)</rp></ruby>フルーツへようこそー」</dd>
<dd>"Welcome to Kise Fruits."</dd>
</dl>
</div>
<p>「うちのうち」 is contracted into 「うんち」.</p>
And here’s a page I wrote to help write the “underneath”:
Fill out the values, click the button, and then copy and paste the HTML into Wordpress.
This all works well until I want to modify the structure of these pages.
For example, the summary is designed to only be one paragraph. What if I want a multi-paragraph summary? I can change the structure going forward, but not for older posts.
Another example, if I want to style content that doesn’t have anything I can reliably hook a style to, there’s no easy way to update older content for this.
I’ve been wanting to make use of custom fields for some time now, but the latest Wordpress theme (the one I’m using) doesn’t support the methods I’m familiar with for using custom fields in a post. The reasons make sense (old methods were theme-dependent), so I begrudgingly looked into how to make it work “the new way”.
This led to learning about the Lazy Blocks plugin. And with that, after the longest time resisting Wordpress’s new block-based editor in favor of the classic HTML editor, I’m finally making the switch to their new editor.
After designing my own “block” with Lazy Blocks, I’m able to keep the structure separate from the content for these types of posts:
This also makes it easier when I want to embed one of these postings into a longer page:
Since each instance of the block needs its own unique ID and I don’t know if unique IDs get stored anywhere, I don’t plan to go back and convert all my old content to use the block. At least, not all at once. (That would take forever for no benefit.)
But as I find I want to embed older grammar samples into grammar explanation posts, I can convert them at that time.