Skip to main content

8 posts tagged with "docusaurus"

View All Tags

Encapsulate an entire Docusaurus site in a Docker image

14 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Encapsulate an entire Docusaurus site in a Docker image

Started on 2 November 2023, this article is already the hundredth I've published on this blog. To mark the occasion, I wanted to do something a bit special to honor the blog. What better way than to build a 100% Docker version, i.e. in the form of a downloadable Docker image that you can run with a single command line.

A single command to download the blog and run it on your machine (Linux, Mac or Windows) and have a fully working site; nice isn't it?

And as usual, you'll find all the information you need below so that you can do the same for your own Docusaurus installation.

Don't wait more

Start a console, run docker pull cavo789/blog && docker run -d -p 80:80 --name blog cavo789/blog to download a local copy of my blog and to start it. Once done, just open http://localhost on your computer and ... congratulations, you've just obtained an offline yet executable version!

Now, we'll learn to do the same for your own Docusaurus instance. Ladies and gentlemen, please follow the guide...

Running your own blog with Docusaurus and Docker

6 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Running your own blog with Docusaurus and Docker

This is the second part of the Running Docusaurus with Docker

This article continues where Running Docusaurus with Docker left off. Make sure to read it first and to create required files first.

So you've created your own blog using Docker and Docusaurus. By following steps explained in the Running Docusaurus with Docker article, now, you've a blog with the list of articles stored on your machine; in a blog folder.

Let's go further.

Running Docusaurus with Docker

6 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Running Docusaurus with Docker

As you know, this blog is powered by Docusaurus.

I'm writing blog posts in Markdown files (one post = one .md file) and Docusaurus will convert them into HTML pages.

In this first article, we're going to learn how to install Docusaurus... ouch, sorry, not install Docusaurus as we're going to use Docker to simplify our lives.

How to self-host Matomo

2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

How to self-host Matomo

Matomo is a GDPR-compliant tracking tool for your website. I've finally decided to install it so that I can get the blog's traffic figures; find out which articles are the most widely read, which topics are of most interest, etc., not just out of curiosity but also to get a better idea of the audience.

I've chosen for the self-hosted solution (because it's free) and like that my traffic figures remains on my own server.

GitHub - Use Actions to deploy this blog

3 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

GitHub - Use Actions to deploy this blog

The last two months, I was using a FTP automation script to deploy the blog on my FTP server.

This way of doing things worked fine but had several inherent problems, the most important of which was that I had to run the script manually (from my computer).

If I modified an article directly from the Github interface or from another computer (where WinSCP was not installed, for example), there was no deployment.

By using Github actions, this problem no longer exists. With each push, the blog will be updated.

Getting the number of published posts

One min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Getting the number of published posts

Docusaurus didn't provide an easy way to retrieve the number of blog posts but there is well a trick.

There is an automatic page called archive like https://www.avonture.be/blog/archive/.

On that page, all blog posts are displayed by year and months. With a document.querySelectorAll console instruction it's possible to make the count as suggested on https://github.com/facebook/docusaurus/discussions/9712