Skip to content
markentier.tech

markentier.tech

About people, tech, and code | markentier.tech | Topics: code, people, humans, software, development, diversity, inclusion, rust, programming, unicorn, tech

markentier.tech
markentier.techmarkentier.tech
COMPUTING INFRASTRUCTURE AND TELECOMMUNICATIONS

How to build a static site/blog

A comment on my previous post »Push, rinse, repeat …« made me think about that you might want to know how this blog is being built and deployed. This site (if you reading this blog post at its canonical location) is freshly hatched. And I realized that I used a couple of things some people might not be familiar with … yet. While everything is still in progress, the heavy lifting for getting it up and running is already done, and I think I can maybe give you some insights on how it is made. In this article we will discover how to get a static site or blog bootstrapped with a GitHub repository, filling it with cobalt.rs, deploying on netlify, using your own domain, get it DNS managed, and using SSL/TLS via Let's Encrypt (https!). A final note on status monitoring via updown.io included as well. Sounds exciting? Then keep reading. Beware the long read, it is probably not your typical how-to guide, it is more like a journey. ### Darkness was over the surface of the deep Step Zero would be to have a reason why you want to build a site or blog, but I assume you found your reason already and just cannot wait to get your ideas published into the world. So especially tech-savvy people love to build or run their own stuff. The middle of a hosted blog and running stuff on your own server is probably using some managed services without relying on the software of the hosting providers. Tools like WordPress are cool and I remember that they are quite beginner friendly, also to the lesser tech-savvy ones, but—no matter your actual background and knowledge—you might have come to the conclusion that you really want to explore the field of owning more of the build and run aspect. You might not need a fully fledged software, maybe even require less to no dynamic features (makes it mostly safer against hacks), or you're just not satisfied with what they offer. But writing your own CMS or blog engine from scratch is also something many developers have tried, but in the end stepped away or replaced this idea with better projects. I always wanted to build such software, but lost interest or motivation in continuing it. A static site usually serves my purposes quite well. ### All your rebase are belong to us Anyway I'm lost in my own thoughts, but you want to read a guide, not my history and reasoning. At least I could save this for a future post. So, the very first thing is: how and where do I want to store my data (content and site stuff) and which tool do I want to use to build and manage? Nowadays a GitHub repository seems to be the most favourite choice. You could use alternative services and even another version control system entirely. Git is quite popular and you will find a lot of help out there when stuck. Since we want to build a static site, we need a tool helping us. Of course, you could write and maintain everything manually, but you will get exhausted by it. ### Generators, Generators, Generators! So naturally a vast amount of static site generators exists, because a lot of people feel the same. And plenty of them created applications to help us. I went for cobalt, because I want to learn and use Rust more often. If you not so much into such adventures, then the following tools will do it as well: Jekyll, Hugo, OctoPress, Gatsby, Middleman, … (check out https://www.staticgen.com/ to get a more complete list of available static site generators). Jekyll is special, because it is also supported by GitHub Pages, which would be another alternative to deploy your static site. Within your freshly cloned and probably still very empty repository you run something like cobalt init (or whatever your tool requires) and start the heavy work of creating a website from bits and pieces. You can spend already hours and days just building the site, since layout and design are a neverending story. But also pages and posts need to be written, and this will take some time as well. ### </head><body> Of course, you can start easy. It doesn't have to be pixel perfect right from the start. Look at this one, it might seem a bit rough and edgy here and there (depending when you will discover this article). Anyway, let's assume you learned some lessons around web design and writing. So don't forget to commit and push your changes to your GitHub repository. Do it more often than not. Your computer might store everything now, but it's not reliable in the long run and you don't want to deploy your machine anyway. Building a home server is a completely different story. So, you built, wrote, pushed. Now we come to the beauty of 2018: let it automatically publish your site and expose it to the world! ### Publish it like it's hot I discovered netlify just because we use and support it at my work (Contentful), and by googling for this article I just found some resources if you're interested in it: - https://www.gatsbyjs.org/blog/2017-12-06-gatsby-plus-contentful-plus-netlify/ - https://dev.to/milkstarz/contentful-and-netlify-the-dynamic-duo-of-static-site-management-55i - https://www.smcculloch.com/code/netlify-contentful-jamstack - https://www.netlify.com/blog/2017/07/06/contentful-an-api-first-cms/ Since I'm not starting with a Contentful-backed approach I will not dive deeper into it. I leave the advertising to our evangelists for now. :-) Initially I really thought that GitHub Pages would be okay already, but netlify comes with some batteries I didn't want to miss, the biggest one was the Let's Encrypt based SSL/TLS certificate, so I can get https all the time and not have to think about the renewal in the future. This works best if you not only bring your own domain, but also can configure it this way that you can let netlify manage your DNS settings (I think this was recommended for better subdomain stuff and enforcing https across them; could be done in your DNS provider probably, but hey, let's give it a try and see how netlify can deal with it). Another cool feature is that you can use GitHub's pull requests (and branching in general) to get a preview deployment. So you can check your changes not only on your local machine, but also let other see how the things will look like (pretty good for teams and collaboration). In fact, I used this for this blog post, so I can test this opportunity. Another tiny benefit is that you can use online validators (like https://validator.w3.org/nu/ for HTML) and fix issues before they go into your production site. Sounds cool, he? Hey, netlify folks, when you reading this by accident, you can donate a bit to my PayPal account for my advertisement efforts. Setting up netlify is quite easy even without the domain stuff. Point it to your repository and maybe define what (supported) tool should be run. Since cobalt is not widely used yet, I already ship my generated site with the repo, so I only need to tell netlify, which folder to use instead. That would be also the case if you went full manual and craft your pages by hand. Netlify offers a lot more stuff, which I'm not using yet. You should discover their features on your own. Split testing might be interesting for sites with customers and your attempts to drag them to CTAs (call to actions). Form handling is probably nice if you want to get feedback or collect other data. ### Hey, author, where you're going? Sorry. You wanted to know how difficult it is to get your site deployed with netlify. Well, I have to disappoint you. Once you've set up your repo, branch and optional configs, you're pretty much done. You can either trigger a deployment manually or just push changes to your previously configured branch. You wait a few seconds (the very first deployment might take a slightly bit longer) and then you check if you're site is up and running. I really mean it, it is so simple, that any How To for netlify is more complicated and longer than their step by step guidance within their interface. Give it a try. If you're really stuck, then their help pages should do the rest. All the things I wanted to use and try was provided within netlify's documentation. And in the end, deploying a static site should not be so much magic. ### Vertrauen ist gut, Kontrolle ist besser I know that nothing comes with perfect 100 percent uptime. That's usually okay. And better you're notified about it. Independently, of course. While you can go with well-known services like pingdom, I use updown.io, which is not free, but with initial signup you will get enough credits to monitor a single website for a long time. If you think it is really not worth it, change to another uptime monitoring solution. What I like about updown is, that they offer a simple status page, you can expose via a subdomain you control. For this blog you can check it under https://status.markentier.tech/: That's all I have for today. I hope this article is useful to anyone of you. If you want to give feedback, have questions or suggestions, you can usually find me on Twitter: https://twitter.com/asaaki — See you soon! 👋🏽
NETLIFY
markentier.techmarkentier.tech
HOME GARDENING AND HOUSEHOLD LIFE

From cobalt.rs to zola (née gutenberg)

I wish I could have the features of both tools, but for now I will use zola over cobalt. A tiny migration and feature comparison story. Note: "gutenberg" got renamed to "zola" in September 2018. While cobalt is a pretty nice and easy static site generator written in Rust (in the vein of Jekyll, the famous tool used for GitHub pages), I struggled a bit. Especially that the stylesheet compilation is not enabled by default yet, but also other tiny annoyances or missing features played into that. I still want to stick with Rust and the only other active option here is gutenberg==zola==. But to be honest, this one also comes with its complications. Cobalt is your tool for a quick blog-like setup, because it supports the usual two different article types of (static) pages and blog posts. Zola doesn't really have such distinction, and therefore you need to be more elaborate if you want to achieve the same. ### Not all perfect, but we're getting there Since both projects are pretty young, they share similar shortcomings: the template libraries are usually not feature complete yet or behave a slightly bit different than their spiritual role models. Mostly one can work around those issues, but it's a bit painful still. Zola shines here a bit brighter, since it supports macros and shortcodes. Especially the latter is something nice, because I can quickly enrich my pages with snippets, which are usually weird or hard to be done purely in Markdown. Embedded HTML is not the nicest thing and if I can abstract them away, I'm all in for that. Another tiny plus: Zola is supported by Netlify, therefore I do not need to install the binary somehow on their side. Now I can let it build the final site on deployment and skip committing a prebuilt project. Pretty sure I could have done it with cobalt as well, but this way it worked out of the box. ### Tools, tools, tools Speaking of tooling: I was a bit adventurous and bundled two tiny binaries anyway and it worked. #### fd - the simpler find, written in Rust fd advertises itself as A simple, fast and user-friendly alternative to 'find'. And according to their benchmarks it is incredibly fast. But I also like the easier command-line options. The interface is designed for the common cases. And it is written in Rust. Have I mentioned that I love Rust? No? ;-) #### tidy-html5 - getting rid of awkward whitespaces and indentation > The granddaddy of HTML tools. The granddaddy of HTML tools. — well, yes, tidy is a pretty old tool, I probably used it already 10+ years ago. I recommend this helper to anyone who gets slightly shitty HTML generated from their CMS, static site generator or whatevery is producing such files automatically. Usually there is no harm in leaving the HTML pages as they are, as long as they render in most browsers. I like my pages nice and clean. And I wish most programs would come with tidy builtin. I know, I know, I'm such a dreamer. Here a snippet how I use fd and tidy for my post processing: mk # from my Makefile: TIDY_SETTINGS = -q -m -w 0 -i \ --indent-with-tabs yes \ --indent-spaces 2 \ --tab-size 2 \ --clean yes \ --join-styles yes build-tidy-html: fd -p public -e html -x sh -c "echo {} && tidy $(TIDY_SETTINGS) {}" \; - find all files with extension .html in the public folder - apply command with -x option; since I want to do multiple things I have to wrap it with sh -c "…" - tidy removes all superfluous whitespaces and empty lines, properly indents the tags, and cleans up the inline styles, which is quite handy for the code snippes, because zola (and cobalt) do not use a global/external stylesheet for the syntax highlighting If you want to learn more about all the possible flags and options, check out the tidy reference for details and explanations. This step helps me a lot getting a consistent output for my whole site, also I will get warnings/errors in case I messed up something in my templates and markup. ### More about zola In the zola repo itself is a nice comparison between zola, cobalt, hugo, and pelican. Since I'm not really interested in non-Rust generators I just keep rephrasing the differences between the first two. The only thing zola has not is the data files feature of cobalt, which can be seen as flat file databases in YAML, JSON, or TOML format. You would maybe need this if you organize and use a lot of data while site generation step. While it sounds nice it is not something I really need yet. What I really appreciate in zola is the wide support of tiny features complementing Markdown based editing. Similar to GitHub wikis you can internally link between documents. Furthermore you get automatically linkable headers and can autogenerate a table of contents (TOC). The template engine is pretty nice (I still need more definable types like arrays and maps, something I could do with liquid based engines). Themes, Aliases, and Pagination are not my main concern yet, but at least the latter could come in handy pretty soon. What I really like are the (custom) shortcodes, I loved it already years ago as a WordPress plugin (or you remember them even from bulletin board/forum software). And the macro system is quite useful when you do base your design on a theme. As mentioned above the stylesheet compilation based on SASS is quite nice, just because splitting up the styles in logical chunks helps to better reason about them. Currently there is a discussion about custom taxonomies which is interesting. Oh and I totally forgot a tiny but really convenient feature: the automatic page reloading while editing and tweaking. People who also build React apps will love it. #### Wishlist I have more items I'd like to see: - probably a plugin system, although I have not an idea yet, how it could look like; but since zola itself seems to be a pretty modular codebase there might be an option to get this going (extension language does not have to be Rust though) - more "native" blog support (a collection type of blog post based on a common parent directory) - better page collection access, globally (I have seen that this is done internally already for sitemap and feed generation, we just need to abstract and expose this nicely) - tera, the template engine could probably benefit from more types and related filters/builtin functions; even with the macro system some things still feel clumsy or nearly impossible ### Migrate all the things Although zola is not cobalt or Jekyll, the move was not as painful as I initially thought it would be. The template languages are similar enough, syntactically and semantically, so that adjustments were sometimes just search-and-replace, both use curlies for their tags. Some of the shortcomings of Tera made some changes slightly more difficult, but overall nothing was totally impossible, or I could just live with a similar but simpler solution for now. I didn't like the builtin rss feed generation and it lacks different feed formats anyway, so I work around this by creation my own feed pages in a slightly awkward way: I built "html" pages for each feed format and rename/move the files in a post processing step later. The sitemap generation was a bit more straight forward. The biggest part of my time I spent in adopting the blog post directory structure and page traversal for the home page. And while writing this post I have an idea how to make my life easier in the future: since I'm not really using the categories (yet) I could utilize a default category page for simpler blog post listings. Will definitely try this one. (If/when we get custom taxonomies I could shift again to use categories as intended.) The organization of post related assets is now a bit different, but maybe even easier/more intuitive. Getting the cover image URL became a bit simpler now. Overall the migration was quite fast, less than a day or so. For how it was done I recommend to head over to the markentier.tech repository and check out the commit history. ### Functions, lambdas, and "serverless" Recently Netlify opened up their previous beta features: Forms, Identity, and Functions (Lambdas). I have no immediate use for the forms and identity service (yet), but the functions are probably a nice feature to check out first. As with most of their tools and support they promise that it will be easy or easier than the underlying solution. And while I haven't even actively played around with AWS Lambda yet, I tested it via Netlify's Functions feature. The free tier is quite limited, of course, but I cannot image a simpler way to get started with functions and lambdas and the whole serverless universe. Although I don't really like this marketing term, since in the end everything is running on some server somewhere. I'd rather think of the evolution after Heroku, which never claimed to be serverless, but a platform where most of the painful infrastructure administration is abstracted away. Functions and Lambdas just further narrow down the scope and surface, but still: they are really tiny applications running on managed servers and services, and a little bit more on demand. And I have to admit, there is great appeal in such services. Especially for single person projects (like this site), where you want a little bit more than just pure static, but also do not want to invest too much time and effort in setting things up. Because in the end all you really want is: getting things done. --- Note: The tool got renamed to zola. IIRC there was a naming conflict in the past.
NETLIFY
markentier.techmarkentier.tech
SOFTWARE DEVELOPMENT AND APPLICATIONS

Progressive Web App

This site is a Progressive Web App now, too. What does it mean and why are PWAs so cool? Main reason: it is about speed! > Progressive Web Apps (PWAs) are web applications that are regular web pages or websites, but can appear to the user like traditional applications or native mobile applications. The application type attempts to combine features offered by most modern browsers with the benefits of a mobile experience. > > Wikipedia: Progressive Web Apps > > I haven't really followed the development of Progressive Web Applications (short: PWA) for quite some time. And I think the last time I experimented with anything around this topic was, when Application Cache (or AppCache) was still a thing. So yeah, long time ago. > > I have forgotten about web site/app optimization, simply because I had no real web site to build and maintain for years. The sites I had were either abandoned or I didn't care so much about the performance of them. > > The very first question a lot of people might ask is: > > ### Why even bother to read about it, if all I'll make will be a static site anyway? > Well, if you do care about web performance and speed, you might want to consider all the tools available to you. > > If you in full control of the output (HTML, CSS, JS, images, fonts, ...) you have already lots of opportunities. > You can minimize and compress the files. The HTML, CSS, and JavaScript stuff is fairly easy, for all of them exist online services or CLI executables. > > But do not forget your assets like images (and audio/video if you host them yourself), most of them can be made smaller. PNG and JPEG are still the most used image file formats (well, also GIFs for animations), WebP is there, but I haven't really seen serious usage yet. Each format usually supports either lossless and/or lossy compressions. I still prefer PNG as my standard image format, and I like that there are tools out there helping me to squeeze out the last tiny bit to get to a pretty small file size. > > ### Tools for minification and compression > Before I come to the PWA part, let's have a look at what can (and should) be done, no matter what kind of website you have. > > #### HTML > So far I will only mention my go-to tool here: tidy-html5. I elaborated a bit further in my last post, when I wrote about changing my static site generator. > > On the other hand the overhead of bloated and whitespace cluttered HTML pages is proably not the biggest issue when it comes to fat sites. > > #### Stylesheets (CSS) and JavaScript (JS) > Instead of recommending a specific tool I'd rather point to projects like webpack, parcel, or your favourite static site generator of choice with proper support. Also if you use a service like Netlify, that you can enable asset optimization and they will take care of the byte crunching for your, the same goes for the > > Even if you use WordPress I know that people have written nice plugins to help you with such task. Nobody needs to do this by hand anymore. > The same goes for images as well, but for reasons I dedicate it its own section: > > #### PNG and other images > While services like Netlify claim to support compression of images, I'm pretty sure they will have trade-offs to publish and deliver your site faster. > Since images are one of the biggest pieces of the total page weight, I think they deserve more attention beforehand. > > First of all do you know which size you need already? Do not simply put your desired image unaltered into your blog post. Unless you always choose the too small images, you probably end up embedding way too huge files instead. Nobody really needs that 3000x5000 photograph when reading your article. If you want to provide them that original file for later usage, give it a link to it for download. So resize the image to your needs. Consider all the usual presentation layers. Most people can live with a 1024 pixels maximum on either height or width, depending on your theme you might be able to use even smaller default sizes. > > I use an aspect ratio of 2:1, so my default image dimension is 1024x512, which is used for my cover and further images. I use this maximum as default even though my article body width is a bit smaller. The reason is that the cover image is also used for Twitter Cards (and Facebook) presentation. Both platforms either support or suggest bigger sizes, but for now I think this is overkill. > > As said, I love PNGs, even though for photos the JPEG format might be better suited. > Anyway there are a bunch of tools for PNG optimization. > > The most well-known is ImageMagick, which can be used for a lot of different image formats. I used it especially for resizing and generating my thumbnails of the cover images. Resizing down to the visibly rendered size saves already tons of bytes and therefore bandwidth! > > Speaking of thumbnails I go even further, because they cannot be only small in dimensions, but highly reduced and compressed, since they serve as a visual hook, but do not need to be the prettiest pictures ever. > > So something neat is the reduction of the color palette with pngquant; people familiar with GIF optimization now that this helps already a lot. > > Second is done by optipng. pngquant already can do a lot of heavy lifting, so maybe the companion doesn't so much afterwards, but maybe it will find a file for further optimization. > > Initially I also had pngcrush in the pipeline, but after checking the actual byte size of the files I saw that it mostly increased afterwards; I removed it, because I'm not interested in de-optimization of my content. 😅 > > For GUI lovers there is a handy tool for macOS users: ImageOptim. This works on a bunch of image file formats and with quite some tools under the hood. > > ### Caching > Minimization and compression are just the beginning of a fast served site. Once all the files are up on a server, waiting to be delivered all around the world, they also do not change that often. Especially your very static pages with all the assets are unlikely to change (like blog posts and about and imprint pages). > > So, to prevent a constant flow of all the bits and bytes for each request, we want to cache them, and ideally as close to the user as possible, so that the next time they request the exact same data, they are served from their devices instead. This becomes highly efficient for repetitively used and requested files like CSS and JS, which are shared across your whole site. Also your logo and header images do not need to travel each time that way. > > Intermediate steps are server-side caches and CDNs by the way, but I'm not focussing on this right now. > > Also: Caching in itself is a tricky story and should probably deserve its own article. > > Generally speaking the Cache-Control header is a good starting point and helps browsers to determine, what and for how long it should try to keep a file in at hand instead of fetching it from the internet. > > > > ### Next level: Progressive Web > Although I have heard of Progressive Web Application already, I never paid much attention to it. I surely thought that it might be cool to look into this topic, once I figured out a web app project. A static site was definitely not a trigger. I could not have been more wrong. > > When I run the Audits tool in the Google Chrome developer tools, I had no idea what this Lighthouse stuff is. I remember that in previous version of Chrome, there was this PageSpeed Insights tab, which is deprecated and only available as a web service nowadays. It's still a useful tool on its own. But Lighthouse provides much more performance and optimization data. > > So when the report was generated I was a bit confused that it had this Progressive Web App section. Sure, some sites might need this information, but the whole internet is not only about dynamic apps, is it? > > Well, it was about time to dive into this previously neglected topic again. I read and learned about the Web App Manifest (manifest.json) and the PWA Checklist. > > One important step for the baseline was: > > > All app URLs load while offline > > With the suggestion to fix it by doing this: > > > Use a Service Worker. > > Oh, I also read about them, but for the same reason above I just ignored this topic, too. If you want to learn what you can do with them, check out serviceworke.rs > > As a starter I went for the pretty simple setup provided by Google. But also iterated further. Tell me if something doesn't work out well or the site just looks ugly (unstyled). > > The cool thing is, that it not only makes your site perform faster and cache items, but also provides offline functionality. > > > > The screenshots above are an example of how it would look like, if you decided to add markentier.tech to your homescreen. > Coloring the address bar is also a nice gimmick. > > Until now I cannot tell you much more about PWAs yet, since I'm learning the stuff right away on the go. > > I encourage you to look into this topic as well. I hope I provided you with enough links to start your own journey. > > Happy Easter! 🗿🥚🐰 > > --- > PS: Sorry, no April Fools' Jokes or funny anything at all here. — https://en.wikipedia.org/wiki/Progressive_Web_Apps
GOOGLE CHROME LABS
markentier.techmarkentier.tech
DATABASES AND DATA ENGINEERING

Hitchhiker's Guide To Structured Data

A tiny journey to the ==building blocks== of the semantic ==web== and how they make our lives much easier. > “There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened.” > > Hitchhiker's Guide To The Galaxy > > > > When I started using computers, I never thought about if and how they could help me to do things — and if that in turn would improve my life. I automatically assumed that we invented tools, machines, devices, phones, computers, and so on because we wanted to make our lives better, and to think less about tedious tasks by making the complex and especially complicated ones easier and more usable. > > In the late 90s I not only learned but experienced that computers are connected. There was this thing called internet, mostly advertised in the form of WWW, the world wide web: gazillions of documents more or less linked to each other. Mostly plastered with flashy animations saying that this place is under construction. And the <marquee> tag made us feel as important as breaking news or a stock market ticker. > > > > Ah, yes, the good old internet. In the beginning quite static and mostly text, but it became richer, more versatile, dynamic, and included images, audio, and video. Besides the static sites, we built web apps, APIs and made the internet a place to interact with each other and with machines. > > ### Nowadays our fridge "Marvin" can tell us via Twitter that he feels quite empty and sad > As a kid I read tons of books, mostly fiction, of course, but I remember I visited our library in the village quite often and borrowed books explaining the world to me. But I consumed so much, I couldn't keep all the information in my head, nowadays I'm not significantly more knowledgeable than decades ago. I remember bits and pieces, but more importantly, I usually remember where I need to look for the actual data to fill in the gaps. > > > > I grew up with Google from the beginning. And while the old and manually maintained catalogs and directories were a good starting point to explore the digital universe, search engines made my life easier. Now I didn't even need to keep an index and graph of information fragments in my head anymore, I could shift to the skill of asking the right questions. > > But there are a few problems with most general purpose search engines. The easiest way to build an index is to crawl the internet and grab the full text of every page discovered and connect it to keywords. Later when somebody searches for this keyword they will get a huge list of results. The algorithms became smarter, the better you can formulate your query, the more relevant and condensed the list will be. > > But if you think about it, you can already ask very specific questions, and most search engines wouldn't really be able "to get it" right from the beginning. > > ### "What are the books the author Douglas Adams has written?" > If you would have tried this maybe 10 or even just 5 years ago and you got lucky, then some result on page one would have pointed you to an article about his publications. If you're not using Google or WolframAlpha the situation is still quite disappointing. > > Today I'm quite impressed how this works out: > > > > As you can also see, the first organic result is about the author on Wikipedia, only the second one is close to what I was asking. But the top bar with the book covers is rocking it! (I first tried with Google.de and there it was just the 3rd result.) > > And I will make a bold statement here: giving you such specific and contextually relevant information is not possible solely based on some full text search index; I believe this was driven by structured data (and potentially stored in a graph database … maybe). > > My internal QuickCheck program narrowed it down to "douglas adams books", but this is not the point (although parsing the input of a search box is probably a nice adventure on its own). > > We can further decompose our query and figure that it consists of a tuple: "douglas adams" and "books". The first one describes the name of a person, the second one describes an entity type, and obviously we want to find a connection between this very person and the books he wrote. Since people rarely mentioned which books they have read, the query parser can already make an educated guess here and put as a relationship type a "has written" (also "has published" could work). > > Or expressed in a pseudo query language and very simplistic: > > sql > SELECT * FROM books WHERE author = "Douglas Adams" > > > Of course, first you would need to resolve an actual author/person entity from your database: > > sql > SELECT id FROM people WHERE name = "Douglas Adams" > > > And then you realize that your people table/database could have multiple entries, and you would try to filter based on occupation or hobby. Maybe you have them ranked by popularity and will just take the highest ranked entry. Another option is to resolve the full query for each person and check which one has written the most books (if any at all) and use this one. > > Whatever the approach is, you need to have your data stored in a structured way. And if you want to build a search engine, a knowledge database, or any kind of application querying and presenting such information (but not storing all the information itself) you need to rely on other sources providing them in a machine consumable way. > > > > The idea of structured data and a semantic web is not new. And if you have used any blogging software then you also used some aspects of structuring: categories and tags. > > Depending on your needs you even introduced your own taxonomies to describe and differentiate your articles. As an example: you're a movie reviewer and classify your reviews based on mood, target audience, and genres; all of these dimensions help you to describe your data, make it more discoverable, support consuming systems, and directly or indirectly give your readers more context and meta data, usually in a quicker and easier way, so they can decide if they want to dive deeper into your blog or look somewhere else. > > The article previews/cards on Facebook and Twitter are also driven by structured data. When you look into the source code of some HTML pages you can spot some interesting meta tags with names or properties like "og:title", "twitter:creator", or "article:author". They are used to fill the pieces of the preview. And to be honest — you will most likely click on a blog post when it has a nice cover image and description line won't you? > > > > It took us years to bring in more data, or to take advantage of the full potential of structured data, but nowadays this concept is the foundation of the web. Even with AI on the rise machines can do their job best if they can process the data in a structured way. > > I think the art is to display content in a pleasant, human-readable manner and unobtrusively enrich it with machine consumable semantic information. This so that we can build interfaces and applications that can make sense of all of the data, and then visualize it in a different and more approachable way. > > If you want to see what structured data can look like, then head over to wikidata: > > > > These entity pages are very formal and not the most beautiful ones to read about a person's life, but they contain very valuable information by describing what this entity is about and what kind of relationship it has to other entities. > > Such data is designed to be consumed by other services. For example the infoboxes on the right side of Wikipedia articles are mostly supplemented with wikidata information. > > Some people have built tools to nicely visualize such data: > > > > ### How could you use the structured data from wikidata for your own project? > You have built a website for your international book club. It comes with a knowledge base, which supports already 42 languages. While managing the content for the authors and books is pretty easy with Contentful, you realize that localization is sometimes painful, because you have a hard time to figure out what the translations of each person's name are. > > #### Don't panic! > A friend of yours comes up with the idea to create a UI extension for Contentful, where you can look up the wikidata and automatically fill the translation fields for the names and other common properties. She has even developed a first prototype for you: > > github.com/asaaki/cf-wikidata-ui-extension-example > > You really like it and start to think about how to automate a lot of other steps. For example the extension could fetch all the known books and create drafts for each of them and link them back to the author entry. Since wikidata also provides links to other Wikimedia services you could store them with your knowledge base articles as well. You integrate a lot of links to other sites and maybe want to create some kind of preview box similar to Twitter Cards. > > With well maintained structured data the possibilities are unlimited. So, go out, explore, and build awesome stuff. > > > “Curiously enough, the only thing that went through the mind of the bowl of petunias as it fell was Oh no, not again. Many people have speculated that if we knew exactly why the bowl of petunias had thought that we would know a lot more about the nature of the Universe than we do now.” > > —Hitchhiker's Guide To The Galaxy > > > “Curiously enough, the only thing that went through the mind of the bowl of petunias as it fell was Oh no, not again. Many people have speculated that if we knew exactly why the bowl of petunias had thought that we would know a lot more about the nature of the Universe than we do now.” > > > > Hitchhiker's Guide To The Galaxy > > > > So Long, and Thanks for All the Fish! 🐟
DOUGLAS ADAMSGOOGLE
markentier.techmarkentier.tech
VISUAL ARTS AND DESIGN

Minimalism, Focus, Clean

Start with whatever you have, but don't stop reaching for something better. Why I love minimalistic and simplistic web designs. ### One: Nothing is forever A few days ago I pointed a colleague to my freshly hatched blog, because I wanted to show him my recent post. In the end we didn't even chat about the post, but web design and the job (he's a web designer), challenges and opportunities and interesting stuff to do and creativity and the past and the kind reminder that I'm not the youngest anymore. What kept nagging in the back was the comment about my (now past) design. > Oh man you need need need to update your site > > Want some design help on that bitch? As much as I appreciate the help and support, but especially for my personal project I tend to do as much as possible on my own. Also taste is highly subjective; I live in Berlin, Germany, I see stuff, I know what I'm talking about. And I do not need to agree with the style and display of others and others' work. I nod (or shrug), I go, and probably forget about it ten minutes later anyway. But there was a point to the above message. Something he couldn't even know. The design was a temporary solution, and I dug it up from a 4 years old proof of concept work I've done. It was the quickest way to get my site up and running without looking too shabby. I didn't need to seek for a pre-made design somewhere else and I didn't need to spend too much time on creating one from scratch. While an old design doesn't need to be bad at all, mine wasn't really finished and fully thought through though. And so this sparked the urge to do something about it. I also knew that I wanted to change the logo independently from a redesign, but now all things came together. ### Two: Anything is possible I love minimalism, I really do. And I wish I could follow this principle a bit more in my daily life, for now the digital one needs to be sufficient enough for this. Not all my previous designs and themes were minimal, simple, or even easy to use. Some were artistic; I think in the early 2000s artsy, graphical and very detailed themes were a thing. Sadly I forgot to bookmark (and screenshot) some of my favourites, I cannot even remember the names of the people, so no hint how to find them again. Well, it's history anyway. In the end I always come to enjoy a design and layout which is not overloaded with stuff and cruft. Sometimes I will add something here and there. And just a bit later I think I should remove something again. Also: minimalism doesn't necessarily mean total emptyness or absense of everthing. But I came to love the huge blanks, and the vast endlessness of the plains. svg <!-- basic SVG logo markup for markentier.tech --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"> <path fill="none" stroke="#0c1328" stroke-linecap="round" stroke-linejoin="round" stroke-width="64" d="M480 506v208-128s0-72 64-72 64 72 64 {…}"/> </svg> ### Three: Something is changing I love vector graphics. And so I love SVG. I remember to have always liked this image format since discovery. It was quite sad, that it also took quite some time to have proper cross browser support. If you ignore old IEs, then the present day situation is awesome. SVG v2 is not there yet (and I really want to get rid of the xlink namespace), but the currently implemented spec is already good for a lot of use cases. One perfect example are logos and icons. As you already see, my website's logo is delivered and rendered as SVG, I couldn't get it smaller than that anyway, any PNG, GIF or JPEG would always be much, much bigger than the following path definition: > M480 506v208-128s0-72 64-72 64 72 64 72v128-128s0-72 64-72 64 72 64 72v128-128s0-72 64-72 64 72 64 72 1 85 1 128c-1 28-24 54-24 54-126 161-348 207-527 111-179-97-262-309-196-501 66-193 261-309 462-275 200 33 347 206 348 409 Yes, exactly, this is all. It is probably the most compact version I could use. Hence the usage of a 1024x1024 viewBox and big numbers, just to avoid decimals, which carry the extra dot. This is a pro-tipp btw, always design your stuff on a huge canvas 1000 pixels or bigger in dimensions. Then with tools like SVGOMG (or already in your vector graphics program) you can save the file with zero decimals (so only integers) without loosing significant information. If you want to get more excited about SVGs: https://www.youtube.com/watch?v=lMFfTRiipOQ https://www.youtube.com/watch?v=ADXX4fmWHbo There are definitely more, but above videos should be a nice starting point. I might come back to this topic in the future. ### Four: Everything is evolving The screenshot above might look a bit weird, because it fits perfectly into the current design (I added a border so it doesn't look too floaty). I think this represents an interpretation of minimalism. At least one I like. There didn't went too much process or sciene into it, at least not consciously. Of course, I'm aware of some color basics, contrasts and a basic understanding of accessibility. It won't be perfect yet. And probably I won't bake in some changes you'd like to see. But I do believe that my articles should be consumable without too much distraction or fatigue or strain. Since it is heavily color range reduced, color blind people (or with partial deficiency) should be able to read and navigate the site without loosing anything or getting confused. I haven't tested screenreaders, but I hope I don't use design magic which would impact your experience here. I also still work on the performance aspect of it. And I also push for more modern browsers. Since it is my personal blog, I think I can afford to "loose" some customers, or at least give them not the full pleasure by not being always fully backwards compatible. If you have questions or just want to know in more detail how something works here, ping me on twitter or open an issue at the repo for this site, I'm happy to explain, glad if you can learn something, and I welcome feedback and corrections.
BERLINGERMANY