Title photo
frugal technology, simple living and guerrilla large-appliance repair
Sat, 21 Dec 2013

Proposal: How about a way to bring Twitter into Ode?

There's something about Twitter. It's so easy to tweet out links, to retweet, to have 140-character discussions ...

But it's a bit harder to bring those conversations into your own blog in a more permanent fashion.

What I'm thinking about doing doesn't seem all that hard. It could be a browser-based program -- maybe a Firefox add-in -- that takes a tweet and plows that text (with links to the original tweet) into an Ode post, so anything I write, retweet, or just want to offer up can appear in my own blog without a whole lot of trouble.

It could also be a Perl script (or Javascript, or Python, or Bash) that outputs HTML to paste into a file.

I'll be thinking about this ...

Once you start blogging by writing plain text files, you can't go back

One of the biggest things that keeps me using a system like Ode for blogging is the freedom to write entries on my local machine using any text editor I wish. Those text files turn into blog entries, and I never have to write in a web interface unless I want to (and for that we have the excellent EditEdit add-in).

I've written local files and pushed them via FTP, opened up my web-server space via sftp in my local Linux file manager (either Thunar with Xfce or Nautilus with GNOME) and now synced a local directory with my server via Unison.

I also love using Markdown. It eliminates much of the HTML-coding drudgery that's even part of mainstream blogging applications like WordPress.

But more than anything, when you can create a text file, write it in the editor of your choice, which for me is Gedit, and then have that file somehow make its way to the server and become part of a blog, it makes the process that much more enjoyable.

Thu, 05 Dec 2013

Social sharing buttons for Ode sites

I decided to add some social-sharing buttons to my Ode site. It's easy to do with code from the sites themselves and tags generated by the Ode script.

I decided to do Twitter and Google Plus share (I could have chosen "+1" but thought "share" was better sine you don't have to "like" it to share it). I could have done Facebook, too, and I might, but for now it's just these two.

I placed the code in the post_footer section of my main Logic (i.e. html) theme's page.html file.

It goes below this part:

<div class="post_footer">
    <p>Posted:  ,  : </p>

And above the permalink/Disqus embed code:

<p><a href="">permalink</a> | <a href="http://stevenrosenberg.net/blog/ode/2013_1205_ode_social_buttons#disqus_thread" data-disqus-identifier="/ode/2013_1205_ode_social_buttons">comments</a></p>

Here is the code I'm putting between those two parts of page.html:

<p>
    <!-- Google Share button -->
    <script src="https://apis.google.com/js/plusone.js"></script>
    <div class="g-plus" data-action="share" data-annotation="bubble" data-href=""></div>

    <!-- Twitter share button -->
    <a href="https://twitter.com/share" class="twitter-share-button" data-url="" data-text="" data-lang="en">Tweet</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</p>

That generates the two social-sharing buttons you see at the bottom of this entry. Can you see how I used Ode-generated tags to specify the permalink for both embeds and the title text for Twitter?

Sat, 14 Sep 2013

This Ode site is responsive

There's still more to do, but I have enough hacks roughed in to flip the switch on the responsive version of my Ode site.

Thanks to Hans Fast who did most of the work on this here and here.

I'll detail what changes I made to my main Ode theme's HTML and CSS in a near-future post (which I'm already working on).

Responsive design is a big thing for me. It was easy to do in Ode -- and easier thanks to hints from Hans. I still have quite a few elements in Ode's main Logic theme to work on, and I'll knock them down as I get the time to do it.

Thanks once again to Hans Fast for his code, and to Rob Reed for shipping such good code to start with in Ode.

Recent changes:

I tried to code the CSS so the "desktop" layout is what you see in tablets as well. I continue to think that most web sites, including this one, look pretty good on the standard 10-inch tablet (like a full-size iPad), and having sidebars pushed to the bottom is unnecessary on those devices.

So I simplified part of the CSS to make the site stay "normal" until 400px in screen width instead of 800px.

I also made some changes in sidebar behavior. When the screen is small, the sidebar not only goes to the bottom of the page, its text goes from float: right to float: left, and the colored image overlay on the sidebar disappears.

Mon, 09 Sep 2013

I'm adding posts from my old FlatPress site to this Ode site

I've been meaning to roll the rest of the posts in my FlatPress blog centered on Debian into this Ode site.

In the past, I've moved quite a few of them in here, but there were about 30 or so from the early days of the FlatPress blog that I had yet to move.

I plowed through about 20 today and have 17 more to go. Rather than taking HTML source from FlatPress, I'm copy/pasting regular text from the FlatPress blog into text files and using Markdown to re-create the links and bolding.

Read the rest of this post

Sat, 07 Sep 2013

New (to me) Ode site: Codex 99 Annex

Through the Ode forum, I just found Jim's graphic design and history site, Codex 99 Annex.

It's nice to see what you can do with Ode when it comes to design. (hint: just about anything).

Sun, 01 Sep 2013

Proposal: Blog archive listings, either in Indexette or as a separate addin

Level of difficulty: Medium to high

Description

A utility that will crawl the Ode documents folder and create a list of links by year and month that can be used in the sidebar of the blog as an archive. Another possible archive listing (which I had in Movable Type and quite liked) is a single page with a list of every individual entry by title.

While this could be done with its own Ode addin, this functionality could be folded into the Indexette addin. In this case, the "reindex" call would also build the year/month and full-archive index HTML, which could then be inserted in the appropriate places in the theme file (for the year/month index) and a single "archive" page for the full archive.

Discussion and questions

Am I missing something, or is this an easy project? It's possible to reuse code from Blosxom, PyBlosxom, or just about any blogging system that offers this functionality.

Proposal: A caching addin for Ode

Updated: Question -- Should cached HTML be prioritized over dynamic CGI? (see Discussion and Questions below)

Level of difficulty: High

Description

Over the past few years, there has been a trend away from dynamically delivery blogging systems like WordPress and Ode to static-site generators like Pelican, Nikola, Jekyll/Octopress and others.

Everybody is worried that their potential web host won't support the technologies that create and deliver blogs, such as Perl, Python, Ruby on Rails, Node.js, etc., and that dynamic delivery is "costly" in terms of CPU time on the server and actual financial cost for those resources.

Feeding into this is the worry (real or imagined) that goes something like this:

What if my site is Slashdotted, or somehow gets wildly popular, or I become the toast of the Internet? Will Ode/whatever-I'm-using be able to keep up with my overwhelming popularity?

It's generally assumed that a static HTML site with no dynamic elements will hold up the best under this "I'm so popular, I have to wear shades" scenario.

But in the "real" world, we're not all so darn popular. But we want to be ready. For our moment.

WordPress, which features dynamic delivery via PHP, solves this problem with caching plugins. These plugins generally take PHP requests that have been made in the recent past and turns them into temporarily cached static HTML files on the server. In Ode's case, posts and indexes are delivered via Perl/CGI.

When a "popular" (aka recently requested) query is made for an entry or index, the plugin delivers the static file, potentially reducing overall CPU load for the system and better handling increased traffic for a few of the many entries in the filesystem/database. And since the likelihood of a "Slashdot"-style traffic onslaught being limited to a single entry (or very few entries) is very high, this sort of scenario (caching as HTML of recently popular entries) has a high likelihood of making the overall blog site much more efficient.

An Ode caching addin would probably always create cached versions of the main index page (i.e the Home page) and maybe the page that delivers the second 10 posts.

It would also cache any individual posts or category requests that are made in the course of the blog's operation over a given period of time (say a day, hour, week or ??). The addin would write these "popular" requests as static HTML.

With the caching addin active, a request for any Ode content would go "through" the addin. The addin would check a list of static files it has created. If the request matches, that file would be delivered. If the request does not match, the request would be processed via Perl/CGI, and that CGI output would be cached as HTML and added to the caching addin's list.

The caching addin would "flush" the cached HTML and the list on a periodic basis. This could be accomplished via HTML request with the addin flushing based on pre-set rules, or via a timed interval, with time determined by a request to the server.

Discussion and questions

  • Would a caching addin require more CGI overhead than it would save? (There would still be some CGI required to run the addin and determine whether a request could be delivered via static HTML.)

  • Maybe the caching code and the resulting static HTML files should be "baked in" to Ode a little more than a traditional addin. By this I mean that an initial request for an index or post could immediately check either a list, or the filesystem itself, for static HTML. If that file is not present, the CGI request would be initiated, and the page would be delivered dynamically and subsequently added to the cache. This way, Ode would "favor" the cached HTML and only initiate a "full" CGI request when necessary.

Sat, 31 Aug 2013

Ode proposals/wishlist

The posts below this one in the queue represent the notes I've made over the past few months on features I'm thinking about that could potentially be added to the Ode blogging system either as addins or core functions.

Some are simply calls for documentation that I would be very comfortable creating myself, in case you are wondering.

Others represent Perl development work.

These entries are here more to encourage discussion among current and potential users of Ode than anything else. So please do.

Proposal: Modify the main Ode HTML theme to be responsive

Level of difficulty: Medium

Description

Modify the HTML and CSS in the main Ode theme so it is fully "responsive" and scales on mobile devices.

Notes and questions

  • Hans Fast's Surfacemarkup.com Ode site has a responsive theme. The changes could be incorporated into the main Ode HTML theme, and perhaps Hans would allow his theme to be incorporated into the Ode files and/or offered as a downloadable theme.

  • This is a great Ode development project, as would be the creation or modification of any theme. It's one of many learning opportunities that involve working with HTML and CSS and don't require knowledge of Ode's core programming language, Perl.