Blog

Article Tags

Hua Paging Labels

By William Jeffrey Rankin, Thu July 4 2024

Hua now supports custom labels for paging. Labels are specified in the Hua configuration file:

next_label = Next Page
prev_label = Previous Page

Note: Spaces in labels are represented by  .

Related Articles

    Article Tags

    Halloween Countdown Script

    By William Jeffrey Rankin, Fri June 28 2024

    A little diversion: a Halloween countdown script written in PowerShell (and Rexx).

    Usage and Sample Output

    jeffr@Europa: ~/Halloween $ powershell ./halloween.ps1
    There are only 125 days until Halloween! This year, it falls on a Thursday.
    

    The Code

    # halloween - Display the number of days until Halloween and the day on which it falls
    
    # $Author: jeffr $
    # $Date: 2024-11-01 10:34:32 -0400 (Fri, 01 Nov 2024) $
    # $Revision: 9 $
    
    $c_date = Get-Date -Format 'MM/dd/yyyy'
    $c_year = ($c_date.Split('/'))[2]
    $c_month = ($c_date.Split('/'))[0]
    if ($c_month -ge 11) { $c_year = [int]$c_year + 1 }
    $h_date = "10/31/$c_year"
    
    $days   = (((New-TimeSpan -Start $c_date -End $h_date).ToString()).Split('.'))[0]
    $day    = (Get-Date $h_date).DayOfWeek
    $day_l = 'days'
    $are_is = 'are'
    
    if ($days -eq 1) {
        $day_l = 'day'
        $are_is = 'is'
    }
    
    if ($days -eq '00:00:00') {
        Write-Host 'TODAY is Halloween!'
    } else {
        Write-Host "There $are_is only $days $day_l until Halloween! This year, it falls on a $day."
    }
    

    The Same in Rexx

    /* halloween - Display the number of days until Halloween and the day on which it falls
    
    $Author: jeffr $
    $Date: 2024-11-02 08:20:36 -0400 (Sat, 02 Nov 2024) $
    $Revision: 10 $
    */
    
    c_date = DATE('B')
    parse value DATE('N', c_date, 'B') with dom ' ' month ' ' year
    if month = 'Nov' | month = 'Dec' then year = year + 1
    h = '31 Oct' year
    h_date = DATE('B', h)
    
    days = h_date - c_date
    day = DATE('W', h, 'N')
    day_l = 'days'
    are_is = 'are'
    
    if days = 1 then do
        day_l = 'day'
        are_is = 'is'
    end
    
    if days = 0 then
        say 'TODAY is Halloween!'
    else
        say 'There' are_is 'only' days day_l 'until Halloween! This year, it falls on a' day'.'
    

        Article Tags

        Hua Feature Completion

        By William Jeffrey Rankin, Sat Apr 6 2024

        With the inclusion of paging for tagged-with-* files (revision 140), Hua is now feature complete. There's still work to do: for example, I want to simplify some of the code and I'm very interested in how well Hua performs with a large number of articles. But, for now, the tool does everything I want it to do while retaining the flexibility and simplicity I envisioned from the beginning.

        Related Articles

            Article Tags

            Hua Paging Support

            By William Jeffrey Rankin, Tue Mar 26 2024

            Revision 99 of Hua supports paging. The number of entries appearing on the index page(s) is controlled using the entries_pp variable in the config file. Index file(s) are named using the index_file config variable, as before. Pages following the first are named *-2.html, *-3.html, etc.

            I'm considering implementing this for the tagged-with files as well.

            Related Articles

                Article Tags

                Hua Meta-information Support

                By William Jeffrey Rankin, Sun Feb 11 2024

                As of revision 63, released on Feb 10, 2024, Hua (my PowerShell-based static content generator) supports meta-information (description, keywords, and author) for individual articles. Meta information is maintained in a separate delimited file. Meta-info isn't required (but is certainly desirable) and Hua will provide defaults (the 000000 record in the meta database) if an individual article isn't represented in the file.

                Initially, I considered simply using article tags for keywords. But I believe keywords to be finer-grained than tags and should therefore be separated. There will be, no doubt, some common entries in both lists.

                Related Articles

                    Newer Articles Older Articles