Hugo again

A quick update

Having (mostly) successfully updated my professional site using Hugo I decided to take a swing at L’s. It was more of a blog format so it gave me some insight into how that kind of functionality could be used.

I also learned I was a dinosaur who still used floats and ended up updating both it and my own site to use flexbox. Learn something new every day! That in itself is worth a post or two.

Netlify

Under the category of learning and things I need to go into greater detail about later, I also switched the hosting of readingwithapencil.com from wordpress.com to Netlify. As a result I have a more flexible site without actually having to pay for anything (WordPress charged for the use of a custom domain).

The workflow works off of Github which I have been using more and more with the Standard Ebooks project so it is pretty smooth. All in all it is really worth of a post of its own but there are so many videos out there it might just serve you (the reader) better to  go watch a couple of them.

But I will eventually jot down my thoughts here…at least so I can figure out what I did when I inevitably break it—that being, originally, the whole purpose of this site.

Hugo!

While I was looking into linux, I came across a vlog that recommended using Hugo and Netlify as a way to maintain a free web presence. I’ve found a lot of these sorts of things (“free”) and even went so far as to set up a small site using the free parts of Google Cloud to get my Python project up and running.

But what struck me about Hugo was that it was a static website and therefore faster and more secure than the typical WordPress install. And it was an intriguing concept that you could mimic the  flexibility of a dynamic site using static pages. So I decided to give it a go.

I deiced to leave Netlify as an experiment for a future project and set about rebuilding the site using Hugo. As a result my old, much ignored portfolio site astart.ca is now refreshed and way more speedy even though I didn’t change the content or the host.

So what is it?

I will get into more it in a later post. But basically it’s a framework that allows you to build the website using templates and pseudo-dynamic techniques and when you are ready to go, you just “publish” the project and it exports the whole website as static pages. It supports a ton of themes like WordPress, although again I decided to build my own from scratch.

Pages are built using markdown. It’s a versatile markup language and one I keep trying to use so one of the side benefits of this is I have become much more facile using it. The gist is that now the site is built all you have to do is open a text file, add content using markdown formatting, link to accompanying pictures and then  just run a short “deploy” script to automatically rebuild the site and upload to your host. Simple.

It’s perfect for a site like the portfolio that doesn’t change much, but now I am going to try it on a more blog-oriented site to see it it will stand up to more frequent posting. I will let you know.

As for astart.ca, well it’s  up and running and  has a fresh new design. Check it out. Now all I have to do is dig up more current material to post. And that’s the hard part 😉

Books Read & Calibre Web Update

Previously (Making A “Books Read” Page) I had posted how I added info to the default Calibre Web templates to add the Series and Pub date information so I could scrape it. Well, it’s gotten a bit more complex since then. Someone added a similar mod to the Github repository which has not yet been incorporated. They didn’t add the pub dates, but did add the series to a few more pages so I thought I would restate my changes here for future reference.

/templates/shelf.html

Add both series info and pub date for the python web scraping program to access:

{% if entry.series|length > 0 %}
    <p class="series">
        {{_('Book')}} {{entry.series_index}} {{_('of')}} <a href="{{url_for('web.books_list', data='series',sort='abc', book_id=entry.series[0].id)}}">{{entry.series[0].name}}</a>
    </p>
{% endif %}


{% if entry.pubdate[:10] != '0101-01-01' %}
    <p class="publishing-date">{{entry.pubdate|formatdate}} </p>
{% endif %}

Added around line 45 (just after the {% endif  %} for the author section). 

/templates/index.html

Add only series info just for aesthetics (note the code is from the proposed mod and is slightly different):

        {% if entry.series.__len__() > 0 %}
        <p class="series">
          <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}">
            {{entry.series[0].name}}
          </a> 
          ({{entry.series_index}})
        </p>
        {% endif %}

Added around line 193 111 (just after the {% endif  %} for the author section). (This might be 36… there seems to have been a change…)

/templates/discover.html

        {% if entry.series.__len__() > 0 %}
        <p class="series">
          <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}">
            {{entry.series[0].name}}
          </a> 
          ({{entry.series_index}})
        </p>
        {% endif %}

Added around line 36 (just after the {% endif  %} for the author section).


I am trying to figure out a way to automate the mods if the main repository doesn’t decide to incorporate the changes but so far an elegant solution eludes me.

Not stupid exactly but…

I’m filing this under Stupid Human Tricks but it’s not exactly stupid. I  am on the fence about gun control (although I agree that some guns really have no place in the marketplace). But this exchange from CBC.ca’s comments really exemplifies one of the core issues. It’s not about the gun, it’s about the social philosophy that states we should all have what we “want” if we manage to work hard enough or have enough money/privilege/connections. Spoiler alert: No, no we can’t always get what we want.

XXXXXX posted 18 minutes ago
Yeah, ’cause I need an assault rifle to wipe out gophers and covid on my property.

 
Reply to @XXXXXX: Do you “need” a 10k Rolex? Or a car that does double the speed limit? This isn’t about need, it’s about want, and how every law abiding taxpaying citizen is entitled to want and subsequently own whatever property they desire.

Instagram This Week

Of course there is this image, also called “Working” from almost exactly a year ago. Much better scenery! Sigh. #workingremotely @nanaimoyachtcharters #DesolationSound #2019
Of course there is this image, also called “Working” from almost exactly a year ago. Much better scenery! Sigh.
#workingremotely @nanaimoyachtcharters #DesolationSound #2019
I like to call this Working from Home. Notice the discrepancy in the definitions of “working.”
I like to call this Working from Home. Notice the discrepancy in the definitions of “working.”

Stupid Human Tricks revisited

It’s been a while since I posted one of these.

An article on the CBC about an 18-year old kid caught doing 308 km/hr in a 100 zone.
https://www.cbc.ca/news/canada/hamilton/burlington-qew-stunt-driving-308-1.5564486

This was one of the comments. I can’t even…

Reuben Danko 8 minutes ago
Nothing wrong with speeding as long as one know how to handle a vehicle at that speed , what is dangerous is those who can not handle a vehicle within or below the ridicule speed limits. It is quite feasible to drive on a 3 lane hiwghay at 140 Km/H to 16 Km/h, the Europeans do, with narrower lanes, and have less accidents than drivers in the US and CAN, because they know how to drive,m most drive 5 speeds, not that girl sort of nonsense of automatic (works to sell cars and place more inept behind the wheel, mostly women and mentally slow men). Driving needs to be reserved for those who can handle a foot cluctch, 5-6 sped manual on a rear wheel traction, try texting, put on make up (CAN and US women are known to do dirty things to) eat (that is something utterly abhorrent eat in a car). In life there are drivers and there are commuters, most CAN and US are commuters, and they proved it, more safety toolls in cars today than ever and the number of accidents and dead has not dropped significantly.

It was deleted about 30 minutes later (thank god). The number of people defending the kid blew me away (200 km/hr OVER people!) but this guy doubled down big time.

Instagram This Week

My mom. In her 80s and still doing cool shit. #AlwaysMyHero
My mom. In her 80s and still doing cool shit.
#AlwaysMyHero
I had some glass I had picked up at a garage sale that I didn’t particularly like so I thought I would try out a few glass “sketches.” A few really quick experiments... #stainedglass #quickart
I had some glass I had picked up at a garage sale that I didn’t particularly like so I thought I would try out a few glass “sketches.” A few really quick experiments…
#stainedglass #quickart