Brother PTouch6 using database
The post can be read in English down below, I created this post mostly for myself and my colleagues.
The post can be read in English down below, I created this post mostly for myself and my colleagues.
There are a few things that needs to be done when you want to update your site, for example upload a new post, or update an existing post. I had some trouble getting back to it after not doing it for a few weeks, so here is a detailed instruction, for myself but also for you.
Login to your webserver with for example winscp for filetransfer, or how you transfer your updated files.
Go to the folder that your mkdocs or zensical configuration is in. I have mine installed at '/root/blog/'. Delete the folder named 'site'.
Go to '/var/www/html/' and delete the same folder named 'site'.
Open the command line on your webserver, in the site folder where the mkdocs or zensical configuration file is. Go ahead and build the site with the following command.
When you refresh on winscp, or with ls in the command line you see the folder 'site' is back. Now copy that folder back to '/var/www/html/'.Run the following command to restart the site.
This should have updated your website.It's not so much work to do it all manually, but I have noticed that if you update the site multiple times a day, it gets annoying to do and I started to make mistakes after a few hours. So I thought, what if I just automate it. Well, here we are!
First create an upload folder, for the updated files. My upload folder is in the root directory, as seen below. Create the script with the following command.
Here is the script I'm using, you need to adjust the paths on line 4-7 to your own paths.If there is a mistake in the script, you could easily delete or edit the wrong files. So please, before you run the script, create a backup of your installation!
If you want to run the script, add your files you want to update to the upload-blog folder and run the following command.
This should have updated the files, that you have uploaded to the upload-blog folder and restarted the website.Maybe you have never used docker before, I did (ofcourse). But each time I use it again, I have to lookup how to exactly install it, because there are some commands. Personally I always use docker-compose, why? Because I never need the regular docker. This post will also be my new guide, as I normally use a link from my bookmarks. For this whole post I'm going to assume you have sudo rights.
This will be my first blog post, and I think it would be suitable to tell you how I installed MkDocs.
First of all make sure you have an environment you will run MkDocs on, maybe a computer with multiple services, or a separate vm/container. I prefer a separate container, so I have made one on my proxmox server. I couldn't find minimum specs so I gave my container: