Open In App

Building your Data Science blog with pelican

Last Updated : 26 Apr, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

First step in order to get a job in Data Science is building a solid profile. Aspiring Data Scientist often do research and study regarding this field, however fail to take the right steps in the right direction. But experts advises to aspiring Data Scientists to write a blog or make video tutorial in order to show their knowledge in data science field. It not only show that a candidate have the knowledge but also is proof of your written or verbal skills.

Tutorial is one way learn new things and especially when it is on the web and written by you. Advantage is, that the concept stays in your mind and you feel a constant motivation to contribute more. Therefore,  this article will explain you how you can create your own blogging website using pelican.

Pelican

Pelican is framework which generate html folder containing the code to create the website pages. It is purely built in python and powered by Python.org. It generate static sites combined with Jinja templates. Along with the general page you can also create comment or discussion section for the viewer. Python programmer can also customize these templates to make the front-end more attractive and responsive.  

Creating your Data Science blog with pelican –

  • To create the website first create a folder in your system e.g mkdir pelicansite. Type cd/pelicansite command to get inside the folder and create a virtual environment using virtualenv command, as shown below 

    creating the environment

  • Now we will activate the environment we have created by using the call command. i.e call pelicanenvm/Scripts/activate.bat as shown below. 

  • As you can see the environment name is activated just before of the C:// 

    installing pelican

  • After that type pip install pelican. It will take few seconds to download the pelican libraries. It is also recommended to install markdown package just in case to use the markdown Syntax. Therefore,  

    installing markdown

  • Now we will create a folder called project which will have all files regarding the site creation and get inside the folder. After this is done lets start building the website. First type pelican-quickstart and then it will ask certain question regarding the site setup.

  • Your folder should then look like as shown below with python files. 

  • You can also view the tree structure of the project folder by simply typing tree in the command line prompt as shown below.

    Raw project folder tree structure

  • Content folder will be the place where we will store our site articles. There we will create two more directories called dev and books. </

  • Now we will go to dev folder to create the article components for our site. For this you can use your preferable text editor, however here I am using atom. UNIX/LINUX user can use vi editor. Type command atom create-page.md.  It will automatically open the text editor with the file name create-page.md. 

    text editor’s article file.

    tree structure of  project folder after article details submission

  • Now the article format should be markdown syntax same as shown above, make changes save the file close it. In the command line come back to the project folder as cd..  twice. Type in the command python -s pelicanconf.py

    Ignore the warnings, article is ready

  • Till here you can see we haven’t added any html files, however when you see the tree structure of the content by typing tree, it will be something like this

  • Final step is to activate the theme for the site and run the local server. 

    running the local server

  • A prompt will ask you for the permission. Click on allow. Open the browser and in URL type localhost:8000, voila! your website is ready for blogging.

    The blogging site


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads