Build unlimited free-forever static sites without a single line of code
Tags: webdev, github, showdev, discuss
Published: 2021-04-05 05:02:58

In this digital era, it is very crucial to be able to publish pages online.

We all have different needs. Someone may need to publish their portfolio, while an educational institute may need to publish their curriculum. The uses are endless.

![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xu7l4fhdc9sf9cei8p4e.png)

There is a requirement for a fast and free system, that will allow us to publish pages online.

[Notion](https://notion.so) is a fantastic all-in-one tool to accomplish a variety of tasks.

## Heaven 😍

There is one thing that Notion shines in. That is, the **creation of beautiful pages**. With Notion's _drag and drop_ editor, you can create **simple yet stunning** pages.

You can have all sorts of formatting like bold, italics, and so on. You have multiple heading levels. You can even change the text color or background color.

You can drag and drop the blocks to organize the page in multiple columns, or even create sub-pages or toggle blocks.


![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sl6pc3a79eq5kx9rftub.png)


You can directly **embed code or a tweet or a youtube video** in a Notion page.

For a full list of blocks, that notion offers, please visit [notion.so](https://notion.so) and try it out yourself, if you have not yet used Notion.


> I believe that this is a far superior way of creating content than using Word Docx or google sheets or plain markdown files.

Using the publish to web feature, you can make any Notion page public.

{% youtube Y-MFFm5Vi0o %}

## Problem 😥

But Notion does not yet allow **custom domains** and **custom slugs** (as on the date this article is published). Plus another big disadvantage is Notion's **slow loading time**. There is several excess stuff on the page, that makes your viewers wait for the page to load.

## Solution 🤩

How to solve this problem?

As of now, the best free way is using [loconotion](https://github.com/leoncvlt/loconotion) which an open-source python tool written by  [Leonardo Cavaletti](https://github.com/leoncvlt).

{% github leoncvlt/loconotion no-readme %}

Loconotion parses the notion pages to produce static HTML, CSS, and js files, which you can deploy anywhere like [GitHub pages](https://pages.github.com/) or [Netlify](https://www.netlify.com/).

- You can have custom slugs (just change the name of the HTML files to the slug you want).
- Loconotion removes unnecessary javascript and CSS to output lightweight pages that load fast.


## Enhancement 😎

As of now (April 05, 2021) loconotion outputs all the files in a single directory, which looks very clumsy.


I made a [script](https://gist.github.com/aahnik/2c18af0ee937bb2947873774f069adc4) that can organize all the files generated by loconotion into various subdirectories without breaking any HTML or CSS.

## Deploy 😘

You can upload all these files to a GitHub repository, and enable GitHub pages for the repository.

 ![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p90ob4wjj2rvfcygx4yg.png)

GitHub pages also allow you to publish the site to a custom domain you own. Read how to set up that in the [GitHub Docs](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages).

-------------


**And thus you have a static site, up and running in a few minutes.** 

If you make any changes, just push the updated files to the GitHub repo, and they go live.

**If you have built any site or pages using this technique, please post a link to that in the comments below.**

How do you build fast static sites for publishing some content to the web? Please share your ideas and techniques in the comments below.

I am [@aahnik](https://github.com/aahnik) on GitHub. Do check out my projects if you are scrolling. ❤️