When things go wrong, error messages are your best friends.
The Python syntax is super easy to read and follow. Pelican is also very simple and ideal for you as an introduction to programming. This tutorial will help you set up a blog, a website or both depending on what need is. And host it on GitHub for the world to see.
In step three, you saw the following two error messages.
- WARNING Watched path does not exist: /Users/yourname/Desktop/website/content/images
- WARNING Unable to find `/favicon.ico` or variations:
Error 1: Add the images folder
- Make sure you are in the root folder by typing
ls
. If you need to move around,cd <foldername>
in andcd ..
out of folders till you are there. - Type
cd content
, to move into the content folder andmkdir image
to make the missing image folder. - That is it. You will be using the image folder for images you will add in the next steps.
Error 2: What is a favicon
A favicon is that little icon that is on the tabs in your browser, like in the image.
Make a favicon
Some applications can save an image as a .ico. If you don't have such an application that are webistes that will do the job for you.
The page I used is https://www.icoconverter.com/. As you can see from the image it is limited what you can see, so keep it simple.
Make sure the favicon is saved as favicon.ico.
If you are following along, you can download the favicon here.
Add new folder
In terminal, navigate to the content folder and mkdir extra
Add Lines to pelicanconf.py
Open the pelicanconf.py file and add the following lines at the bottom of the file.
The lines are telling pelican that there is a new folder to hold static files. The folder is called extra, because it'll hold different extra files and the only thing they have in common is that they are different.
STATIC_PATHS = [
'images',
'extra', # this is the folder we'll add
]
EXTRA_PATH_METADATA = {
'extra/favicon.ico': {'path': 'favicon.ico'}, # this is the direction for Pelican to find the favicon.
}
Add the favicon
Drag and drop your favicon file into the extra folder.
Check out your work
make html
andmake serve
- Your page may look something like this.
COMMENTS