Skip to content

honzajavorek/honzajavorek.cz

Repository files navigation

honzajavorek.cz

Honza Javorek's personal website and blog. Powered by Pelican, a static site generator written in Python.

👩‍💻 Installation & Usage

For installation, see the CI configuration in .github/workflows/build.yml. For usage, see the Pelican docs.

📒 Content

Most of the project consists of my blog. The content (articles, images…) can be found in the content directory. The blog uses Markdown with a few extensions. The basic Pelican structure is a bit altered. Many pages generated by Pelican by default are disabled in the configuration. There are no categories, author pages, tags. Only three pages are in use: index, archives, article.

🎨 Theme

There is a custom theme in the theme directory. There's no intention to use the theme anywhere else, thus with a lot of things hardcoded.

It turns the index page into my personal site, and the archives page (saved as ./blog/index.html) into something one could call a true index page for the blog. Then there are individual article pages and that's it. The article template is in Czech for Czech articles, otherwise in English. The rest is in English exclusively.

The theme uses standard CSS and ECMAScript 5 for simplicity and resiliency.

⚙️ Plugins

For the personal site (the index template) to work properly, there is a plugin appearances. It picks up static data from content/data or fetches it from the internet by external HTTP requests, and then injects additional information to Pelican's context.

The alternates plugin looks for meta data ending with -url in the articles and provides a list of alternate places where the article has been published. As an example, Zdrojak-URL: https://zdrojak.cz/my-article would appear as an alternate in the article's meta data.

The readtime plugin calculates estimated reading time for each article. The seealso plugin generates other recommended articles for each article.

The comments plugin looks for meta data ending with -comments in the articles and provides a list of places where the article has been shared and where people can discuss it. As an example, Twitter-Comments: https://twitter.com/honzajavorek/status/1a2b3c4d5 would appear in the comments list in the article's meta data.

The custom_feed_meta overwrites Atom feed's top-level meta data with values from configuration.

The custom_translation_id plugin and related settings for translation URLs allow for translations of articles with backward-compatible URLs (independent slugs with no implicit language identifier in the URL).

The rest of the plugins are mostly minor automatic tweaks to the generated article markup.

📸 Adding Images

Drop them into the content/images directory and let the blog reload. If it's too large, it'll error with details. Resize large images to fit the constraints reported by the error messages.

🇨🇿 Translations

To connect translations, add Translation-ID to their meta data with the same value, and set their Lang properly. The default language is en.

📚 Alternates

To document where the article has been re-published, add the URLs to the meta data as <whatever>-URL properties. E.g. Zdrojak-URL, Medium-URL, or DevTo-URL.

💬 Comments

To document where on social networks the article has been shared, add the URLs to the meta data as <whatever>-Comments properties. E.g. Twitter-Comments, LinkedIn-Comments, or Facebook-Comments. Links should appear under the article.

🖼 Open Graph Image

By default, the Open Graph image is set to my photo. To set a different image, add it to the content/images directory and set the Image meta data property in the article to the path to the image, e.g. Image: images/foo.jpg.

🗓 Weeknotes

Inspired by Simon Willison’s Weblog, I decided to write regular weeknotes. To make the job easier, there is a script weeknotes.py, which generates a template article for the current week. It accepts the main topic as arguments (joins them with whitespace) or prompts for the topic interactively if not provided:

$ python weeknotes.py Dovolená

The script downloads some data from Strava. Their guidelines require me to have their logo here:

📦 Dependencies

The npm dependencies of the theme are managed in a standard way, but the package.json is inside the theme directory and the dependencies are saved as exact versions (see .npmrc) as @dependabot takes care of upgrading (see .github/dependabot.yml). Python dependencies use Poetry. Again, @dependabot takes care of upgrading.

🚀 Deployment

Each commit to main runs a GitHub Actions build which automatically deploys the site to GitHub Pages. The configuration is in .github/workflows/build.yml.

As certain content on the homepage is dynamic, the site should be re-generated at least once a day. This is achieved using a scheduled workflow (see .github/workflows/build.yml).

✉️ Telegram Integration

There is a Telegram channel at t.me/honzajavorekcz. GitHub Actions build (see .github/workflows/build.yml) runs the telegram.py script. The script checks whether the last article has been already posted to the Telegram channel. If not, it posts it there (Telegram bot account) and records the link to the article as Telegram-Comments meta data. This is also how next time the script knows that the article is already posted. The change is persisted by a next step in GitHub Actions, which commits the information back to the source and pushes to the repository.

Honza also uses the channel for sharing links to stuff he finds interesting. The weeknotes.py script then checks the channel history (Telegram API account), collects links shared since the last weeknotes, and persists them as a list at the bottom of the weeknotes article. This has been previously handled by Pocket and the pocket-recommendations library, but Honza doesn't fancy those anymore.

📪 Domain

The site runs under custom domain honzajavorek.cz. The HTTPS is turned on in the GitHub Pages repository settings. The domain's DNS is managed by WEDOS. E-mail redirecting is done by ImprovMX. CSV export from WEDOS:

"";"name";"TTL";"type";"data"
"";"";"3600";"A";"185.199.110.153"
"";"";"3600";"A";"185.199.111.153"
"";"";"3600";"A";"185.199.108.153"
"";"";"3600";"A";"185.199.109.153"
"";"";"300";"MX";"20 mx2.improvmx.com"
"";"";"300";"MX";"10 mx1.improvmx.com"
"";"prazeni";"3600";"CNAME";"honzajavorek.github.io"
"";"www";"3600";"CNAME";"honzajavorek.github.io"

📊 Analytics

The site uses privacy-focused Simple Analytics, with a public dashboard at simpleanalytics.com/honzajavorek.cz.

👀 License

See LICENSE. TL;DR is that the code is MIT and the content is my precious. If you wish to re-publish the texts or translate them, I'm usually fine with it, but let me know first.

About

Honza Javorek's personal website and blog

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.MIT

Stars

Watchers

Forks