2019-12-15-your-corner-of-the-internet.md (6627B) - raw


      1 <!-- title: Your corner of the Internet -->
      2 <!-- slug: your-corner-of-the-internet -->
      3 <!-- categories: Decentralization, Personal domain -->
      4 <!-- lastmod: 2019-12-06T00:00:00Z -->
      5 <!-- date: 2019-12-15T00:00:00Z -->
      6 
      7 We tend to have online accounts across different social networks and services.
      8 We upload our projects in some sites, we post on different ones and we follow
      9 different people on all of them. Our online identities—along with everything we
     10 share—are all over the place, but there is a way to solve this (and many other
     11 problems): personal websites.
     12 
     13 Creating a personal website is a great way to share our projects, experiences,
     14 thoughts, etc. under our own terms, without being limited to a given theme or a
     15 couple of available options in a certain service. A personal website allows you
     16 to customize it as you want, whether that is quickly setting up a simple website
     17 with a portfolio, spending time creating the perfect CSS file or even setting up
     18 a service to share files with your friends using a password.
     19 
     20 You can buy a personal domain at a considerably cheap price (less than $12 a
     21 year for a `.me`, `.org` or `.com` domain), but it will provide you with
     22 something much more valuable: your corner of the Internet. Nobody can shut down
     23 your domain because it is no longer profitable and if your host can't continue
     24 to provide you with what you need, or they change their terms, you can simply
     25 switch companies, and still show your website under the same URL. You can change
     26 anything on the "backstage", and others will always find you at the same place.
     27 
     28 ## Building the website
     29 
     30 If you don't have any experience with programming or using plain text and you
     31 don't want to spend time getting familiar with it, you can use WordPress[^wp] to
     32 create your site. It is a free (as in freedom) [content management system][cms]
     33 that will allow you to build a site without much HTML/CSS knowledge. If you are
     34 more comfortable with plain text and the terminal or want to get in touch with
     35 them, building a static site that supports Markdown will probably be a much
     36 better option.
     37 
     38 [^wp]: I use WordPress as the dynamic alternative because it has a free license,
     39   it is beginner-friendly, it can easily be configured to run a personal website
     40   with a blog and a portfolio and because it is very popular. However, if you
     41   are thinking about creating a dynamic personal site, you should consider other
     42   options that are also interesting.
     43 
     44 ### What is a static site?
     45 
     46 Most of the websites we visit are dynamic. That means that the server we are
     47 retrieving the pages from is executing a program, and the pages we see are the
     48 results of that web application. Dynamic sites can be useful when we want users
     49 to be able to edit data. For instance, if users can log in and publish posts,
     50 that would require a dynamic site.
     51 
     52 On the other hand, there are static websites. In this case, the server simply
     53 serves files that are already stored on the server. So, for a given URL,
     54 everybody sees the same HTML (and JavaScript and CSS). You probably won't
     55 require a dynamic personal website, since you'll probably be publishing
     56 information about you, your projects, etc., without the need of a server that
     57 does real-time calculations to serve a page[^static].
     58 
     59 [^static]: You can still change the contents in a static site, however, you will
     60   have to edit the text files manually and then upload them to the server (this
     61   can be automated). It is less complicated than it sounds once you learn
     62   Markdown (which is very simple).
     63 
     64 Why am I talking about static sites? Well, they offer some advantages over
     65 dynamic ones.
     66 
     67 - **More efficient**: since serving a page doesn't need any extra server-side
     68   operation, static sites use way fewer resources, which can benefit you when
     69   considering self-hosting the site. It will also make your site more
     70   environmentally friendly.
     71 - **More secure**: since there isn't an app server, potential vulnerabilities
     72   are reduced drastically.
     73 - **Faster**: because the server doesn't need to do operations, it can respond
     74   to requests faster, hence accelerating the loading time.<br/>
     75   *That is a general claim, by using proper caching and using content delivery
     76   networks, speeds can change considerably. It also depends on the number of
     77   plugins installed (or other operations made by the server).*
     78 
     79 Because of these advantages, you can find free hosting for static sites and
     80 lower prices when self-hosting or using shared-hosting because of the lower
     81 amount of resources needed. Furthermore, since everything is stored in plain
     82 text and not in a database, you can easily use a version control system (such as
     83 Git) to keep a history of all your changes and easily share the source code of
     84 your site.
     85 
     86 ## Generating a multi-page site
     87 
     88 To create a static website with multiple pages, you can use a static site
     89 generator. There are a lot of static site generators, and I use Hugo (for a
     90 couple of reasons that I might write about some other time). With the use of
     91 Hugo—most other generators also offer this functionality—, you can code your
     92 navigation bar in a file, your footer in a different one and include both of
     93 them in multiple templates. These templates will then gather the content from
     94 your Markdown (or HTML) files, put it all together and output all the HTML files
     95 of your site. Now that I have an operative site, when I want to publish a new
     96 post, I create a file with some metadata and the post content, and Hugo does the
     97 rest. Post files look like the following:
     98 
     99 ```markdown
    100 ---
    101 title: "Post title"
    102 categories: category
    103 tags: [ "tag1", "tag2" ]
    104 ---
    105 
    106 Post content.
    107 ```
    108 
    109 Thanks to Hugo, it is very easy to add content to a website, and the source code
    110 is neatly organized. Hugo also lets you minify the content to reduce file
    111 sizes—although some people might argue against it, I find it useful and some
    112 files get reduced by up to 30% (CSS files)[^minify].
    113 
    114 [^minify]: On top of that, you can always find the source code well indented in
    115   the repository, by clicking on *Inspect element* or by using a prettifier.
    116 
    117 ## Conclusion
    118 
    119 Since my recent exit from multiple services because of privacy terms concerns, I
    120 realized having a personal website can substitute social networks. I get to
    121 share anything I want on my own terms (and with my own theme!), ensuring privacy
    122 to anybody who wants to read, and I get to keep the copyright over my content. I
    123 now have my corner of the Internet, where everyone can find me, contact me and
    124 read what I have to share.
    125 
    126 
    127 [cms]: <https://en.wikipedia.org/wiki/Content_management_system> "Content management system — Wikipedia"