<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>My Old Ohio Home - python</title><link href="./" rel="alternate"></link><link href="./feeds/python.atom.xml" rel="self"></link><id>./</id><updated>2025-04-10T00:00:00-04:00</updated><subtitle>Family history</subtitle><entry><title>Adding an emoji to a post</title><link href="./adding-an-emoji-to-a-post.html" rel="alternate"></link><published>2019-08-13T00:00:00-04:00</published><updated>2025-04-10T00:00:00-04:00</updated><author><name>Ed Hamilton</name></author><id>tag:None,2019-08-13:./adding-an-emoji-to-a-post.html</id><summary type="html">&lt;div class="left_image"&gt;&lt;a href="../articles/adding-an-emoji-to-a-post.html"&gt;&lt;img src="../images/20190813.png" title="August 13, 2019" width="106" height ="70"&gt; &lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Today I learned, well not exactly today, more like yesterday. Anyway, I figured out how to put emojis on the website.&lt;/p&gt;</summary><content type="html">&lt;div class="left_image"&gt;
&lt;img src="../images/20190813.png" alt="calendar dated August 13, 2019" /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Today I learned&lt;/em&gt;&amp;#8230;well not exactly today, more like yesterday. Anyway, I figured out how to put emojis on the website. I was writing an article and wanted to end a sentence with a smiley face. I'm using Pelican to generate this site, so my first instinct was to Google "emojis in Pelican." I found source code for a plugin, then a blog explaining how to use it. Problem was, I wasn't doing it exactly the same way as the explanation&amp;mdash;I wasn't using a python virtual environment. So one thing and another, the files probably didn't end up where they belonged, or I didn't talk nice enough to Pelican to get it to find them. It didn't work.&lt;/p&gt;
&lt;p&gt;More Googling turned up "unicode" in the same result as "emoji." Aha! says I. Get the unicode number and just plug it into the article somehow. I was almost there, you have to convert Unicode numbers to their decimal equivalent for the browser to understand them. So I did and it worked!&lt;/p&gt;
&lt;p&gt;Now which is easier, cloning the source code for a plugin, downloading a dependency, python-setuptools, then hoping python will install it, then grabbing a list of emojis and their values, putting it where it belongs, telling Pelican about it in two different places, &lt;/p&gt;
&lt;p&gt;&lt;i&gt;or&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;look up the emoji online, get the hex code, run a 17 character command to convert it to decimal, and just add a $# and a ; when you paste it in the article? I ask you. &lt;/p&gt;
&lt;p&gt;For me, the second method. I'd never remember the markdown short codes from one time to the next&amp;ndash;I'd have to look online&amp;ndash;so I might as well look up the unicode number instead. I can't see the point of using markdown when it makes things harder. Along the way, though, I did grab the list of all emojis and their unicode numbers for myself, in case the site goes offline.&lt;/p&gt;
&lt;p&gt;So how many times will I ever use an emoji in a blog post? Maybe never again.&amp;#128578;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;September 15, 2021: And I haven't used one since.&lt;br&gt;
April 10, 2025: Emojis have come a long way since 2019 and you can probably insert one by throwing a dart at a chart on the wall behind your computer. Meanwhile I have learned to use Emacs which lets me insert an emoji with the perfectly easy key-combination of C-x 8 RETURN then start typing the description of the emoji you want. It works. Now I can spam my articles with emojis. 😊&lt;/p&gt;</content><category term="misc"></category><category term="python"></category><category term="pelican"></category><category term="tech-stuff"></category></entry><entry><title>How a non-Python-programmer survived a Pelican point upgrade</title><link href="./how-a-non-python-programmer-survived-a-pelican-point-upgrade.html" rel="alternate"></link><published>2019-02-18T00:00:00-05:00</published><updated>2021-08-18T00:00:00-04:00</updated><author><name>Ed Hamilton</name></author><id>tag:None,2019-02-18:./how-a-non-python-programmer-survived-a-pelican-point-upgrade.html</id><summary type="html">&lt;div class="left_image"&gt;&lt;a href="../articles/how-a-non-python-programmer-survived-a-pelican-point-upgrade.html"&gt;   &lt;img src="../images/typewriter.png" title="How a non-Python-programmer survived a Pelican point upgrade" width="51" height ="70"&gt; &lt;/a&gt;&lt;/div&gt;
&lt;p&gt;A while ago I decided I was tired of handcrafting an individual .php file every time I added an article to this website. So I decided to shop around again for a static site generator.&lt;/p&gt;</summary><content type="html">&lt;div class="left_image"&gt;
&lt;img src="../images/typewriter.png" alt="an old-fashioned typewriter" width="208" height="155"&gt;
&lt;/div&gt;

&lt;p&gt;A while ago I decided I was tired of handcrafting an individual .php file every time I added an article to this website. So I decided to shop around again for a static site generator. I had used Jekyll a few years ago so I thought I'd give it another try. This time it was broken on arrival&amp;ndash;I forget how&amp;ndash;so I swept up all the little rubies and gems in my home folder and went on with my search.&lt;/p&gt;
&lt;p&gt;Hugo was still as sparse as ever, so after a bit of looking I settled on Pelican, and found a beautiful theme called backdrop at &lt;a title="" href="https://github.com/getpelican/pelican-themes/tree/master/backdrop " target="_blank"&gt;backdrop pelican theme&lt;/a&gt;, which I modified using his updated css from his personal site, my colors, etc.&lt;/p&gt;
&lt;p&gt;Things went well until one day last December I started editing a new article and got an error message. My first thought was "Oh no! Why me? Why now?" I was using Debian Sid, so my second or third thought was "I wonder if there was a major upgrade? Let me go check." Sure enough, pelican 4.0 had been released November 13, 2018, and had just hit Debian's unstable repository without my noticing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Help!&lt;/strong&gt;&lt;/p&gt;
&lt;p data-pullquote= "By the way, are any of the pelican themes maintained?" &gt; &lt;/p&gt;

&lt;p&gt;The logical place to look for help seemed to be the theme repository on github. In fact, Googling one of the error messages turned it up as a top hit. But the theme doesn't seem to be currently maintained, as the writer has gone on to bigger and better things. I mean that sincerely, without saying more about him than is required for this context. By the way, are &lt;em&gt;any&lt;/em&gt; of the pelican themes maintained?&lt;/p&gt;
&lt;p&gt;It looked like I was on my own. Welcome to the world of code hacking. Well not quite, I'd adjusted a few files in Gramps, article to follow someday. But this was more serious. Without a working site generator I'd be going back to writing each file by hand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Slugs&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The first error message had something to do with slugs. Besides being slimy creatures that get run over by cars, slugs have something to do with naming your files, don't ask me what. I found the 4.0 docs, even though Google still insists on listing 3.x higher, and fixed the slug format. Not too hard.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configuration&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next was a message to the effect that PAGINATED_DIRECT_TEMPLATES are removed in favor of PAGINATED_TEMPLATES. OK, I'll just change the name of the setting in pelicanconf.py. Nice try. Pelican said "not so fast" and gave me the message "articles_paginator not defined."&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Real code problems&lt;/strong&gt;&lt;/p&gt;
&lt;div class="right_image"&gt;
&lt;img src="../images/pythonCode.png" alt="computer screen filled with python code" width="320" height="413"&gt;
&lt;/div&gt;

&lt;p&gt;Big trouble now, since that looks like some deep code thing, either a variable, object, inductor, conductor, or some other abstract noun way beyond my expertise.&lt;/p&gt;
&lt;p&gt;I turned on debug mode, and was either further confused or able to trace the error to a specific file in the theme. Probably the first, since I think I found the file by just searching for "articles_paginator" in the theme folder. I couldn't for the life of me figure out what it was doing and how to get it to stop. Or, in programmer speak, what values it took and how to feed them to it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A tactical retreat&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I gave up, downloaded pelican 3.7 from the Debian Stretch repository, put a hold on pelican in the package manager, and went back to the .php format anyway. But that gets tired quick. If you want to delete a file, you have to delete all references to it in your tags, categories, and archives files as well. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;'It was pagination, my love'&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So last weekend I worked up the nerve to take another run at pelican 4.0. I looked again at the error messages and realized that the ones that were causing the trouble all had to do with pagination. Now I didn't use, need, or want pagination. Could I take it out of the theme on my own and make things work? Not a chance. &lt;/p&gt;
&lt;div class="left_image"&gt;
&lt;img src="../images/noLoosePapers.jpg"  alt="loose papers with a accessible negative symbol stamped over them" width="145" height="160"&gt;
&lt;/div&gt;

&lt;p&gt;So I went through the pelican themes on github and found someone who felt the same way toward paginating as I did, namely "We don't do pages." I grabbed the category.html file from the &lt;a href="https://github.com/getpelican/pelican-themes/tree/master/Just-Read" target="_blank"&gt;Just-Read&lt;/a&gt; theme and dropped it into my theme folder. It worked! I modified it for the tags and archives pages and they worked too!&lt;/p&gt;
&lt;p&gt;I didn't like everything about it though, so I cut out the unordered lists and the date stamp. And I really liked having a summary of each article on the category and tag pages. So I grafted back the code from the backdrop theme for summaries, and Voila! things were just the way I wanted them. The results are what you see on the main part of this website. If you like the theme, you are welcome to it. You will find it in &lt;a  href="https://myoldohiohome.com/theme/" target="_blank"&gt;https://myoldohiohome.com/theme/&lt;/a&gt;. The background picture is mine though&amp;mdash;I'd prefer you didn't use that, at least not without asking.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So I changed a few configurations, removed a couple of settings, and swapped out some code for some other code. Do I understand eveything I did? Not really. Do I know &lt;em&gt;how&lt;/em&gt; it works? No, but I know it &lt;em&gt;works.&lt;/em&gt;  Do I have to understand it to use it? I hope not. Besides, how many Python programmers know what Griffith's Valuation is? Hint: it's not an algorithm.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Credits&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The picture of the typewriter is from &lt;a  href="https://www.flickr.com/photos/mikefats/5387523221/" target="_blank"&gt;Typewriter by Michael&lt;/a&gt;, at flickr, and is used under the &lt;a   href="https://creativecommons.org/licenses/by/2.0/legalcode" target="_blank"&gt;Attribution 2.0 Generic Creative Commons license&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The picture of Python code is from 
&lt;a  href="https://commons.wikimedia.org/wiki/File:General6545.gif" target="_blank"&gt;File:General6545.gif&lt;/a&gt; at wikimedia, uploaded by Sagaru9535, and used under the &lt;a href="https://creativecommons.org/licenses/by-sa/4.0" target="_blank"&gt; Creative Commons CC BY-SA 4.0 license&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The drawing of the blank pages came from &lt;a  href="https://pixabay.com/en/papers-notes-sheets-white-office-308366/" target="_blank"&gt;pixabay&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The "No" sign came from &lt;a href="https://en.wikipedia.org/wiki/File:No_sign.png" target="_blank"&gt;Wikipedia&lt;/a&gt; and is used under the terms of the &lt;a  href="https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License" target="_blank"&gt;GNU Free Documentation License&lt;/a&gt;. &lt;/p&gt;</content><category term="misc"></category><category term="python"></category><category term="pelican"></category><category term="tech-stuff"></category></entry></feed>