šŸ“‰
Tutorials
  • Computer History
  • Function
    • Finance
      • Calculate
    • Manage Data
    • Date&Time
    • Strings and Character
  • Snippets
    • Web Application
      • Hugo
      • JavaScript
        • Stopwatch using JavaScript?
    • Note
    • Start Project
      • GitHub
      • GitLab
    • Python Programming
      • Strings and Character Data
      • List
      • Dictionaries
    • Data Science
      • Setting Option
      • Get Data
  • Link Center
    • Next Articles
    • Google
    • Excel VBA
    • Python
      • Notebook
    • WebApp
      • Vue.js
    • Finance
    • Project
      • Kids
        • Scratch
      • Finance
        • Plotly.js
        • Portfolio
      • Mini Lab
        • Systems Administration
        • Auto Adjust Image
      • Sending Emails
      • ECS
        • Knowledge Base
        • ąø£ąø°ąøšąøšąøœąø¹ą¹‰ą¹€ąøŠąøµą¹ˆąø¢ąø§ąøŠąø²ąø (Expert System)
        • Check product
        • Compare two SQL databases
      • e-Library
        • Knowledge base
        • ąøąø²ąø£ąøˆąø±ąø”ąø«ąø”ąø§ąø”ąø«ąø”ąø¹ą¹ˆąø«ą¹‰ąø­ąø‡ąøŖąø”ąøøąø”
        • Temp
      • AppSheet
        • ąøšąø±ąøąøŠąøµąø£ąø²ąø¢ąø£ąø±ąøšąø£ąø²ąø¢ąøˆą¹ˆąø²ąø¢
      • Weather App
      • COVID-19
  • Tutorials
    • Data Science
      • Data Science IPython notebooks
    • UX & UI
      • 7 ąøąøŽąøąø²ąø£ąø­ąø­ąøą¹ąøšąøš UI
    • Web Scraping
      • Scrape Wikipedia Articles
      • Quick Start
    • GUI
      • pysimple
        • Create a GUI
      • Tkinter
        • Python Tkinter Tutorial
      • PyQt
        • PyQt Tutorial
    • MachineLearning
      • ąøąø²ąø£ąøžąø±ąø’ąø™ąø² Chat Bot
      • AI ąøœąø¹ą¹‰ąøŠą¹ˆąø§ąø¢ą¹ƒąø«ąø”ą¹ˆą¹ƒąø™ąøąø²ąø£ąø—ąø³ Customer Segmentation
      • Customer Segmentation
      • ตัดคำภาษาไทย ด้วย PyThaiNLP API
    • Excel & VBA
      • INDEX กับ MATCH
      • รวดสูตร Excel ปี 2020
      • How to Write Code in a Spreadsheet
    • Visualization
      • Bokeh
        • Part I: Getting Started
        • Data visualization
        • Plotting a Line Graph
        • Panel Document
        • Interactive Data Visualization
    • VueJS
      • VueJS - Quick Guide
    • Django
      • Customize the Django Admin
      • ąøžąø±ąø’ąø™ąø²ą¹€ąø§ą¹‡ąøšąø”ą¹‰ąø§ąø¢ Django
    • Git
      • ąø§ąø“ąø˜ąøµąøŖąø£ą¹‰ąø²ąø‡ SSH Key
      • Git คืออะไร
      • ą¹€ąø£ąø“ą¹ˆąø”ąø•ą¹‰ąø™ą¹ƒąøŠą¹‰ąø‡ąø²ąø™ Git
      • ąøąø²ąø£ą¹ƒąøŠą¹‰ąø‡ąø²ąø™ Git แคะ Github
      • รวด 10 ąø„ąø³ąøŖąø±ą¹ˆąø‡ Git
      • GIT Push and Pull
    • Finance
      • Stock Analysis using Pandas (Series)
      • Building Investment AI for fintech
      • Resampling Time Series
      • Python for Finance (Series)
      • Stock Data Analysis (Second Edition)
      • Get Stock Data Using Python
      • Stock Price Trend Analysis
      • Calculate Stock Returns
      • Quantitative Trading
      • Backtrader for Backtesting
      • Binance Python API
      • Pine Script (TradingView)
      • Stocks Analysis with Pandas and Scikit-Learn
      • Yahoo Finance API
      • Sentiment Analysis
      • yfinance Library
      • Stock Data Analysis
      • YAHOO_FIN
      • Algorithmic Trading
    • JavaScript
      • Split a number
      • Callback Function
      • The Best JavaScript Examples
      • File and FileReader
      • JavaScript Tutorial
      • Build Reusable HTML Components
      • Developing JavaScript components
      • JavaScript - Quick Guide
      • JavaScript Style Guide()
      • Beginner's Handbook
      • Date Now
    • Frontend
      • HTML
        • File Path
      • Static Site Generators.
        • Creating a New Theme
    • Flask
      • Flask - Quick Guide
      • Flask Dashboards
        • Black Dashboard
        • Light Blue
        • Flask Dashboard Argon
      • Create Flask App
        • Creating First Application
        • Rendering Pages Using Jinja
      • Jinja Templates
        • Primer on Jinja Templating
        • Jinja Template Document
      • Learning Flask
        • Ep.1 Your first Flask app
        • Ep.2 Flask application structure
        • Ep.3 Serving HTML files
        • Ep.4 Serving static files
        • Ep.5 Jinja template inheritance
        • Ep.6 Jinja template design
        • Ep.7 Working with forms in Flask
        • Ep.8 Generating dynamic URLs in Flask
        • Ep.9 Working with JSON data
        • Ep.23 Deploying Flask to a VM
        • Ep.24 Flask and Docker
        • Ep. 25: uWSGI Introduction
        • Ep. 26 Flask before and after request
        • Ep. 27 uWSGI Decorators
        • Ep. 28 uWSGI Decorators
        • Ep. 29 Flask MethodView
        • Ep. 30 Application factory pattern
      • The Flask Mega-Tutorial
        • Chapter 2: Templates
      • Building Flask Apps
      • Practical Flask tutorial series
      • Compiling SCSS to CSS
      • Flask application structure
    • Database
      • READING FROM DATABASES
      • SQLite
        • Data Management
        • Fast subsets of large datasets
      • Pickle Module
        • How to Persist Objects
      • Python SQL Libraries
        • Create Python apps using SQL Server
    • Python
      • Python vs JavaScript
      • Python Pillow – Adjust Image
      • Python Library for Google Search
      • Python 3 - Quick Guide
      • Regular Expressions
        • Python Regular Expressions
        • Regular Expression (RegEx)
        • Validate ZIP Codes
        • Regular Expression Tutorial
      • Python Turtle
      • Python Beginner's Handbook
      • From Beginner to Pro
      • Standard Library
      • Datetime Tutorial
        • Manipulate Times, Dates, and Time Spans
      • Work With a PDF
      • geeksforgeeks.org
        • Python Tutorial
      • Class
      • Modules
        • Modules List
        • pickle Module
      • Working With Files
        • Open, Read, Append, and Other File Handling
        • File Manipulation
        • Reading & Writing to text files
      • Virtual Environments
        • Virtual Environments made easy
        • Virtual Environmen
        • A Primer
        • for Beginners
      • Functions
        • Function Guide
        • Inner Functions
      • Learning Python
        • Pt. 4 Python Strings
        • Pt. 3 Python Variables
      • Zip Function
      • Iterators
      • Try and Except
        • Exceptions: Introduction
        • Exceptions Handling
        • try and excep
        • Errors and Exceptions
        • Errors & Exceptions
      • Control Flow
      • Lambda Functions
        • Lambda Expression คืออะไร
        • map() Function
      • Date and Time
        • Python datetime()
        • Get Current Date and Time
        • datetime in Python
      • Awesome Python
      • Dictionary
        • Dictionary Comprehension
        • ALL ABOUT DICTIONARIES
        • DefaultDict Type for Handling Missing Keys
        • The Definitive Guide
        • Why Functions Modify Lists and Dictionaries
      • Python Structures
      • Variable & Data Types
      • List
        • Lists Explained
        • List Comprehensions
          • Python List Comprehension
          • List Comprehensions in 5-minutes
          • List Comprehension
        • Python List
      • String
        • Strings and Character Data
        • Splitting, Concatenating, and Joining Strings
      • String Formatting
        • Improved String Formatting Syntax
        • String Formatting Best Practices
        • Remove Space
        • Add Spaces
      • Important basic syntax
      • List all the packages
      • comment
    • Pandas
      • Tutorial (GeeksforGeeks)
      • 10 minutes to pandas
      • Options and settings
      • ą¹€ąø£ąø“ą¹ˆąø”ąø•ą¹‰ąø™ Set Up Kaggle.com
      • Pandas - Quick Guide
      • Cookbook
      • NumPy
        • NumPy Package for Scientific
      • IO tools (text, CSV, …)
      • pandas.concat
      • Excel & Google Sheets
        • A Guide to Excel
        • Quickstart to the Google Sheets
        • Python Excel Tutorial: The Definitive Guide
      • Working With Text Data
        • Quickstart
      • API Reference
      • Groupby
      • DateTime Methods
      • DataFrame
      • sort_values()
      • Pundit: Accessing Data in DataFrames
      • datatable
        • DataFrame: to_json()
        • pydatatable
      • Read and Write Files
      • Data Analysis with Pandas
      • Pandas and Python: Top 10
      • 10 minutes to pandas
      • Getting Started with Pandas in Python
    • Markdown
      • Create Responsive HTML Emails
      • Using Markup Languages with Hugo
    • AngularJS
      • Learn AngularJS
    • CSS
      • The CSS Handbook
      • Box Shadow
      • Image Center
      • The CSS Handbook
      • The CSS Handbook
      • Loading Animation
      • CSS Grid Layout
      • Background Image Size
      • Flexbox
  • Series
    • ąøˆąø²ąø§ąø²ąøŖąø„ąø£ąø“ąø›ąø•ą¹Œą¹€ąøšąø·ą¹‰ąø­ąø‡ąø•ą¹‰ąø™
      • 1: ąø£ąø¹ą¹‰ąøˆąø±ąøąøąø±ąøšąøˆąø²ąø§ąø²ąøŖąø„ąø£ąø“ąø›ąø•ą¹Œ
  • Articles
    • Visualization
      • Dash
        • Introducing Dash
    • Finance
      • PyPortfolioOpt
      • Best Libraries for Finance
      • Detection of price support
      • Portfolio Optimization
      • Python Packages For Finance
    • Django
      • ą¹€ąø£ąø“ą¹ˆąø”ąø•ą¹‰ąø™ Django RestFramework
    • General
      • Heroku คืออะไร
      • How to Crack Passwords
    • Notebook
      • IPython Documentation
      • Importing Notebooks
      • Google Colab for Data Analytics
      • Creating Interactive Dashboards
      • The Definitive Guide
      • A gallery of interesting Jupyter Notebooks
      • Advanced Jupyter Notebooks
      • Converting HTML to Notebook
    • Pandas
      • Pandas_UI
      • Pandas Style API
      • Difference Between two Dataframes
      • 19 Essential Snippets in Pandas
      • Time Series Analysis
      • Selecting Columns in a DataFrame
      • Cleaning Up Currency Data
      • Combine Multiple Excel Worksheets
      • Stylin’ with Pandas
      • Pythonic Data Cleaning
      • Make Excel Faster
      • Reading Excel (xlsx) Files
      • How to use iloc and loc for Indexing
      • The Easiest Data Cleaning Method
    • Python
      • pip install package
      • Automating your daily tasks
      • Convert Speech to Text
      • Tutorial, Project Ideas, and Tips
      • Image Handling and Processing
        • Image Processing Part I
        • Image Processing Part II
        • Image tutorial
        • Image Processing with Numpy
        • Converts PIL Image to Numpy Array
      • Convert Dictionary To JSON
      • JSON Dump
      • Speech-to-Text Model
      • Convert Text to Speech
      • Tips & Tricks
        • Fundamentals for Data Science
        • Best Python Code Examples
        • Top 50 Tips & Tricks
        • 11 Beginner Tips
        • 10 Tips & Tricks
      • Password hashing
      • psutil
      • Lambda Expressions
    • Web Scraping
      • Web Scraping using Python
      • Build a Web Scraper
      • Web Scraping for beginner
      • Beautiful Soup
      • Scrape Websites
      • Python Web Scraping
        • Web Scraping Part 1
        • Web Scraping Part 2
        • Web Scraping Part 3
        • Web Scraping Part 4
      • Web Scraper
    • Frontend
      • Book Online with GitBook
      • Progressive Web App คืออะไร
      • self-host a Hugo web app
  • Examples
    • Django
      • Build a Portfolio App
      • SchoolManagement
    • Flask
      • Flask Stock Visualizer
      • Flask by Example
      • Building Flask Apps
      • Flask 101
    • OpenCV
      • Build a Celebrity Look-Alike
      • Face Detection-OpenCV
    • Python
      • Make Game FLASH CARD
      • Sending emails using Google
      • ąø•ąø£ąø§ąøˆąø«ąø²ąø ąø²ąøžąø‹ą¹‰ąø³ąø”ą¹‰ąø§ąø¢ Perceptual hashing
        • Sending Emails in Python
      • Deck of Cards
      • Extract Wikipedia Data
      • Convert Python File to EXE
      • Business Machine Learning
      • python-business-analytics
      • Simple Blackjack Game
      • Python Turtle Clock
      • Countdown
      • 3D Animation : Moon Phases
      • Defragmentation Algorithm
      • PDF File
        • ąøˆąø±ąø”ąøąø²ąø£ąø‚ą¹‰ąø­ąø„ąø§ąø²ąø” แคะรูป ąøˆąø²ąøą¹„ąøŸąø„ą¹Œ PDF ด้วย PDFBox
      • Reading and Generating QR codes
      • Generating Password
        • generate one-time password (OTP)
        • Random Password Generator
        • Generating Strong Password
      • PyQt: Building Calculator
      • List Files in a Directory
      • [Project] qID – ą¹‚ąø›ąø£ą¹ąøąø£ąø”ą¹ąø•ą¹ˆąø‡ąø£ąø¹ąø›ąø‡ą¹ˆąø²ąø¢ą¹† ą¹€ąøžąø·ą¹ˆąø­ąøąø²ąø£ąø­ąø±ąøžąø„ąø‡ą¹€ąø§ą¹‡ąøš
      • Python and Google Docs to Build Books
      • Tools for Record Linking
      • Create Responsive HTML Email
      • psutil()
      • Transfer Learning for Deep Learning
      • ąø”ąø¶ąø‡ąø‚ą¹‰ąø­ąø”ąø¹ąø„ąø„ąøøąø“ąø ąø²ąøžąø­ąø²ąøąø²ąøØąø›ąø£ąø°ą¹€ąø—ąøØą¹„ąø—ąø¢
        • Image Classification
    • Web Scraper
      • Scrape Wikipedia Articles
        • Untitled
      • How Scrape Websites with Python 3
    • Finance
      • Algorithmic Trading for Beginners
      • Parse TradingView Stock
      • Creating a stock price database with MariaDB and python
      • Source Code
        • stocks-list
      • Visualizing with D3
      • Real Time Stock in Excel using Python
      • Create Stock Quote Module
      • The Magic Formula Lost Its Sparkle?
      • Stock Market Analysis
      • Stock Portfolio Analyses Part 1
      • Stock Portfolio Analyses Part 2
      • Build A Dashboard In Python
      • Stock Market Predictions with LSTM
      • Trading example
      • Algorithmic Trading Strategies
      • DOWNLOAD FUNDAMENTALS DATA
      • Algorithmic Trading
      • numfin
      • Financial Machine Learning
      • Algorithm To Predict Stock Direction
      • Interactive Brokers API Code
      • The (Artificially) Intelligent Investor
      • Create Auto-Updating Excel of Stock Market
      • Stock Market Predictions
      • Automate Your Stock Portfolio
      • create an analytics dashboard
      • Bitcoin Price Notifications
      • Portfolio Management
    • WebApp
      • CSS
        • The Best CSS Examples
      • JavaScript
        • Memory Game
      • School Clock
      • Frontend Tutorials & Example
      • Side Menu Bar with sub-menu
      • Create Simple CPU Monitor App
      • Vue.js building a converter app
      • jQuery
        • The Best jQuery Examples
      • Image Slideshow
      • Handle Timezones
      • Text to Speech with Javascript
      • Building Blog for Your Portfolio
      • Responsive Website Layout
      • Maths Homework Generator
  • Books
    • Finance
      • Python for Finance (O'Reilly)
    • Website
      • Hugo
        • Go Bootcamp
        • Hugo in Action.
          • About this MEAP
          • Welcome
          • 1. The JAM stack with Hugo
          • 2. Live in 30 minutes
          • 3. Using Markup for content
          • 4. Content Management with Hugo
          • 5. Custom Pages and Customized Content
          • 6. Structuring web pages
          • A Appendix A.
          • B Appendix B.
          • C Appendix C.
    • Python
      • ąø ąø²ąø©ąø²ą¹„ąøžąø˜ąø­ąø™ą¹€ąøšąø·ą¹‰ąø­ąø‡ąø•ą¹‰ąø™
      • Python Cheatsheet
        • Python Cheatsheet
      • Beginning Python
      • IPython Cookbook
      • The Quick Python Book
        • Case study
        • Part 1. Starting out
          • 1. About Python
          • 2. Getting started
          • 3. The Quick Python overview
        • Part 2. The essentials
          • 14. Exceptions
          • 13. Reading and writing files
          • 12. Using the filesystem
          • 11. Python programs
          • 10. Modules and scoping rules
          • 9. Functions
          • 8. Control flow
          • 4. The absolute basics
          • 5. Lists, tuples, and sets
          • 6. Strings
          • 7. Dictionaries
        • Part 3. Advanced language features
          • 19. Using Python libraries
          • 18. Packages
          • 17. Data types as objects
          • 16. Regular expressions
          • 15. Classes and OOP
        • Part 4. Working with data
          • Appendix B. Exercise answers
          • Appendix A. Python’s documentation
          • 24. Exploring data
          • 23. Saving data
          • 20. Basic file wrangling
          • 21. Processing data files
          • 22. Data over the network
      • The Hitchhiker’s Guide to Python
      • A Whirlwind Tour of Python
        • 9. Defining Functions
      • Automate the Boring Stuff
        • 4. Lists
        • 5. Dictionaries
        • 12. Web Scraping
        • 13. Excel
        • 14. Google Sheets
        • 15. PDF and Word
        • 16. CSV and JSON
    • IPython
    • Pandas
      • ąøˆąø±ąø”ąøąø²ąø£ąø‚ą¹‰ąø­ąø”ąø¹ąø„ąø”ą¹‰ąø§ąø¢ pandas ą¹€ąøšąø·ą¹‰ąø­ąø‡ąø•ą¹‰ąø™
      • Pandas Tutorial
  • Link Center
    • Temp
  • เทควันโด
    • รวดเทคนณค
    • Help and Documentation
  • Image
    • Logistics
Powered by GitBook
On this page
  • Building a Data Science Blog for Your Portfolio
  • Static Sites
  • Static Site Generators
  • Installing Pelican
  • Creating Your Data Science Blog
  • Installing the Jupyter Plugin
  • Writing your First Post
  • Generating HTML
  • Creating a GitHub Page
  • Committing Your Files
  • Deploy to GitHub Pages
  • Add Comments
  • Choose a Theme
  • Next Steps

Was this helpful?

  1. Examples
  2. WebApp

Building Blog for Your Portfolio

PreviousText to Speech with JavascriptNextResponsive Website Layout

Last updated 5 years ago

Was this helpful?

Building a Data Science Blog for Your Portfolio

data-science-blogs

Data science blogs can be a fantastic way to demonstrate your skills, learn topics in more depth, and build an audience. There are quite a few examples of and blogs that have helped their authors land jobs or make important connections. Writing a data science blog is thus one of the most important things that any aspiring programmer or data scientist should be doing on a regular basis. (This is the second in a series of posts on how to build a Data Science Portfolio. You can find links to the other posts in this series at the bottom of the post.) Unfortunately, one very arbitrary barrier to blogging can be knowing how to set up a blog in the first place. In this post, we’ll cover how to create a blog using Python, how to create posts using Jupyter notebook, and how to deploy the blog live using GitHub Pages. After reading this post, you’ll be able to create your own data science blog, and author posts in a familiar and simple interface.

Static Sites

Fundamentally, a static site is just a folder full of HTML files. We can run a server that allows others to connect to this folder and retrieve files. The nice thing about this is that it doesn’t require a database or any other moving parts, and it’s very easy to host on sites like GitHub. It’s a great idea to have your data science blog be a static site, because it makes maintaining it very simple. One way to create a static site is to manually edit HTML, then upload the folder full of HTML to a server. In this scenario, you would at the minimum need an

index.html file. If your website URL was thebestblog.com, and visitors visited http://www.thebestblog.com, they would be shown the contents of index.html. Here’s how a folder of HTML might look for thebestblog.com:

thebestblog.com
│   index.html
│   first-post.html
│   how-to-use-python.html
│   how-to-do-machine-learning.html
│   styles.css

On the above site, visiting

http://www.thebestblog.com/first-post.html would show you the content in first-post.html, and so on. first-post.html might look like this:

<html>
<head>
  <title>The best blog!</title>
  <meta name="description" content="The best blog!"/>
  <link rel="stylesheet" href="styles.css" />
</head>
<body>
  <h1>First post!</h1>
  <p>This is the first post in what will soon become (if it already isn't) the best blog.</p>
  <p>Future posts will teach you about data science.</p>

<div class="footer">
  <p>Thanks for visiting!</p>
</div>
</body>
</html>

You might immediately notice a few problems with manually editing HTML:

  • Manually editing HTML is incredibly painful.

  • If you want to make multiple posts, you have to copy over styles, and other elements, like the title and footer.

  • If you want to integrate comments or other plugins, you’ll have to write JavaScript.

Generally, when you’re blogging, you want to focus on the content, not spend time fighting with HTML. Thankfully, you can create a data science blog without hand editing HTML using tools known as static site generators.

Static Site Generators

Static site generators allow you to write blog posts in simple formats, usually markdown, then define some settings. The generators then convert your posts into HTML automatically. Using a static site generator, we’d be able to dramatically simplify

first-post.html into first-post.md:

# First post!

This is the first post in what will soon become (if it already isn't) the best blog.

Future posts will teach you about data science.

This is much easier to manage than the HTML file! Common elements, like the title and the footer, can be placed into templates, so they can be easily changed. There are a few different static site generators. The most popular is called

Installing Pelican

Before we get started,

  • Create a folder — we’ll put our blog content and styles in this folder. We’ll refer to it in this tutorial as jupyter-blog, but you can call it whatever you want.

  • cd into jupyter-blog.

  • Create a file called requirements.txt in jupyter-blog, with the following content:

Markdown==2.6.6
pelican==3.6.3
jupyter>=1.0
ipython>=4.0
nbconvert>=4.0
beautifulsoup4
ghp-import==0.4.1
matplotlib==1.5.1
  • Run pip install -r requirements.txt in jupyter-blog to install all of the packages in requirements.txt.

Creating Your Data Science Blog

Once you’ve done the preliminary setup, you’re ready to create your blog! Run

pelican-quickstart in jupyter-blog to start an interactive setup sequence for your blog. You’ll get a sequence of questions that will help you setup your blog properly. For most of the questions, it’s okay to just hit Enter and accept the default value. The only ones you should fill out are the title of the website, the author of the website, n for the URL prefix, and the timezone. Here’s an example:

(jupyter-blog)āžœ  jupyter-blog āœ— pelican-quickstart
Welcome to pelican-quickstart v3.6.3.

This script will help you create a new Pelican-based website.

Please answer the following questions so this script can generate the files
needed by Pelican.


> Where do you want to create your new web site? [.]
> What will be the title of this web site? Vik's Blog
> Who will be the author of this web site? Vik Paruchuri
> What will be the default language of this web site? [en]
> Do you want to specify a URL prefix? e.g., http://example.com   (Y/n) n
> Do you want to enable article pagination? (Y/n)
> How many articles per page do you want? [10]
> What is your time zone? [Europe/Paris] America/Los_Angeles
> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n)
> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n)
> Do you want to upload your website using FTP? (y/N)
> Do you want to upload your website using SSH? (y/N)
> Do you want to upload your website using Dropbox? (y/N)
> Do you want to upload your website using S3? (y/N)
> Do you want to upload your website using Rackspace Cloud Files? (y/N)
> Do you want to upload your website using GitHub Pages? (y/N)

After running

pelican-quickstart, you should have two new folders in jupyter-blog, content, and output, along with several files, such as pelicanconf.py and publishconf.py. Here’s an example of what should be in the folder:

jupyter-blog
│   output
│   content
│   .gitignore
│   develop_server.sh
│   fabfile.py
│   Makefile
│   requirements.txt
│   pelicanconf.py
│   publishconf.py

Installing the Jupyter Plugin

Pelican doesn’t support writing blog posts using Jupyter by default — we’ll need to install a

  • Run git init to initialize the current folder as a git repository.

  • Create the folder plugins.

  • Run git submodule add git://github.com/danielfrg/pelican-ipynb.git plugins/ipynb to add in the plugin.

You should now have a

.gitmodules file and a plugins folder:

jupyter-blog
│   output
│   content
│   plugins
│   .gitignore
│   .gitmodules
│   develop_server.sh
│   fabfile.py
│   Makefile
│   requirements.txt
│   pelicanconf.py
│   publishconf.py

In order to activate the plugin, we’ll need to modify

pelicanconf.py and add these lines at the bottom:

MARKUP = ('md', 'ipynb')

PLUGIN_PATH = './plugins'
PLUGINS = ['ipynb.markup']

These lines tell Pelican to activate the plugin when generating HTML.

Writing your First Post

Once the plugin is installed, we can create the first post:

  • Copy the notebook file into the content folder.

  • Add the following content to the ipynb-meta file, but change the fields to match your own post:

Title: First Post
Slug: first-post
Date: 2016-06-08 20:00
Category: posts
Tags: python firsts
author: Vik Paruchuri
Summary: My first post, read it to find out.

Here’s an explanation of the fields:

  • Title — the title of the post.

  • Slug — the path at which the post will be accessed on the server. If the slug is first-post, and your server is jupyter-blog.com, you’d access the post at http://www.jupyter-blog.com/first-post.

  • Date — the date the post will be published.

  • Category — a category for the post (this can be anything).

  • Tags — a space-separated list of tags to use for the post. These can be anything.

  • Author — the name of the author of the post.

  • Summary — a short summary of your post.

You’ll need to copy in a notebook file, and create an

ipynb-meta file whenever you want to add a new post to your blog. Once you’ve created the notebook and the meta file, you’re ready to generate your blog HTML files. Here’s an example of what the jupyter-blog folder should look like now:

jupyter-blog
│   output
│   content
    │   first-post.ipynb
    │   first-post.ipynb-meta
│   plugins
│   .gitignore
│   .gitmodules
│   develop_server.sh
│   fabfile.py
│   Makefile
│   requirements.txt
│   pelicanconf.py
│   publishconf.py

Generating HTML

In order to generate HTML from our post, we’ll need to run Pelican to convert the notebooks to HTML, then run a local server to be able to view them:

  • Switch to the jupyter-blog folder.

  • Run pelican content to generate the HTML.

  • Switch to the output directory.

  • Run python -m pelican.server.

  • Visit localhost:8000 in your browser to preview the blog.

You should be able to browse a listing of all the posts in your data science blog, along with the specific post you created.

Creating a GitHub Page

  • Switch to the jupyter-blog folder.

  • Add the repository as a remote for your local git repository by running git remote add origin git@github.com:username/username.github.io.git — replace both references to username with your GitHub username.

A GitHub page will display whatever HTML files are pushed up to the

master branch of the repository username.github.io at the URL username.github.io (the repository name and the URL are the same). First, we’ll need to modify Pelican so that URLs point to the right spot:

  • Edit SITEURL in publishconf.py, so that it is set to http://username.github.io, where username is your GitHub username.

  • Run pelican content -s publishconf.py. When you want to preview your blog locally, run pelican content. Before you deploy, run pelican content -s publishconf.py. This uses the correct settings file for deployment.

Committing Your Files

If you want to store your actual notebooks and other files in the same Git repo as a GitHub Page, you can use git branches.

  • Run git checkout -b dev to create and switch to a branch called dev. We can’t use master to store our notebooks, since that’s the branch that’s used by GitHub Pages.

  • Create a commit and push to GitHub like normal (using git add, git commit, and git push).

Deploy to GitHub Pages

We’ll need to add the content of the blog to the

  • Run ghp-import output -b master to import everything in the output folder to the master branch.

  • Use git push origin master to push your content to GitHub.

  • Try visiting username.github.io — you should see your page!

Whenever you make a change to your data science blog, just re-run the

pelican content -s publishconf.py, ghp-import and git push commands above, and your GitHub Page will be updated.

Add Comments

Comments are one way to interact with your guests. Disqus is a good tool for this, and it integrates with Pelican seamlessly. Follow these steps:

  1. Click ā€œGet Startedā€, then choose ā€œI want to install Disqus on my siteā€.

  2. Enter your Website Name. This will serve as a unique key to link Disqus to your blog, by passing it into the publishconf.py file. (More on this in a future step.)

  3. Choose a Disqus subscription plan — a basic plan is perfect for a personal blog.

  4. When Disqus asks which platform your site is on, scroll down and choose ā€œI don’t see my platform listed, install manually with Universal Codeā€.

  5. On the Universal Code page, scroll down again and click ā€œConfigureā€.

  6. On the Configure page, fill in the ā€œWebsite URLā€ section with your actual website address (https://username.github.io). You can also add information about your comment policy (if you don’t have one, Disqus gives suggestions), and enter a description for your site. Click ā€œComplete Setupā€.

  7. You’ll now have the ability to configure your site’s community settings. Click into this section and look around. Among other things, you’ll be able to control whether guests can comment, and activate ads.

  8. In the toolbar on the left, click ā€œAdvancedā€ and add your website into Trusted Domains as username.github.io.

  9. Lastly, update publishconf.py. Make sure to specify DISQUS_SITENAME = "website-name", where ā€œwebsite-nameā€ comes from step 3.

Now rerun the

pelican content -s publishconf.py, ghp-import output -b master and git push origin master commands to update your GitHub Page. Refresh your website and you’ll see Disqus appearing under each post.

Choose a Theme

The Pelican community offers a variety of themes at

  • Keep it simple. The design should not distract from the actual content.

  • Pay attention to the width of your page — it should be enough to contain infographics and code that you may want to publish.

Once you’ve picked a theme, go to the folder where you wish to store your theme and create a repo:

Next Steps

We’ve come a long way! You now should be able to author blog posts and push them to GitHub Pages. Anyone should be able to access your data science blog at

username.github.io (replacing username with your GitHub username). This gives you a great way to show off your data science portfolio. As you write more posts and gain an audience, you may want to dive more into a few areas:

  • Your own custom URL.

  • Plugins

  • Promotion

At

If you liked this, you might like to read the other posts in our ā€˜Build a Data Science Portfolio’ series:

, and is written in Ruby. Since we’ll be making a data science blog, we want a static site generator that can process Jupyter notebooks. is a static site generator that is written in Python that can take in Jupyter notebook files and convert them to HTML blog posts. Pelican also makes it easy to deploy our blog to GitHub Pages, where other people can read our blog.

a repo that’s an example of what we’ll eventually get to. If you don’t have Python installed, you’ll need to do some preliminary setup before we get started. are setup instructions for Python. We recommend using Python 3.5. Once you have Python installed:

Create a file called .gitignore, and add in the content from . We’ll need to eventually commit our repo to git, and this will exclude some files when we do.

Create and activate a .

that enables this behavior. We’ll install the plugin as a to make it easier to manage. If you don’t have git installed, you can find instructions . Once you have git installed:

Create a Jupyter notebook with some basic content. an example you can download if you want.

Create a file that has the same name as your notebook, but with the extension .ipynb-meta. an example.

is a feature of GitHub that allows you to quickly deploy a static site and let anyone access it using a unique URL. In order to set it up, you’ll need to:

for GitHub if you haven’t already.

Create a repository called username.github.io, where username is your GitHub username. a more detailed guide on how to do this.

master branch for GitHub Pages to work properly. Currently, the HTML content is inside the folder output, but we need it to be at the root of the repository, not in a subfolder. We can use the tool for this:

Go to the and register.

. You can choose any theme you like, but here are some quick tips:

Remember the ā€œRule of Three Colorsā€. According to , most people prefer combinations of two to three colors. This way colors don’t fight for attention.

git clone --recursive https://github.com/getpelican/pelican-themes pelican-themes. Create a THEME variable in your pelicanconf.py file and set its value to the location of the theme: THEME = 'E:\\Pelican\\pelican-themes\\flex Here, we are using a nice flex theme by . Run the usual finishing commands — pelican content, ghp-import, and git push — and enjoy a new look!

Using username.github.io is nice, but sometimes you want a more custom domain. a guide on using a custom domain with GitHub Pages.

Check out the list of plugins . Plugins can help you setup analytics, commenting, and more.

Trying promoting your blog posts on sites , , and others to build an audience.

, our interactive guided projects are designed to help you start building a data science portfolio to demonstrate your skills to employers and get a job in data. If you’re interested, you can .

.

.

.

Reference :

Jekyll
Pelican
here’s
Here
this file
virtual environment
plugin
git submodule
here
Here’s
Here’s
GitHub Pages
Sign up
Here’s
ghp-import
Disqus site
pelicanthemes.com
University of Toronto study
Alexandre Vincenzi
Here’s
here
Twitter
Quora
Dataquest
signup and do our first module for free
Storytelling with data
Building a machine learning project
The key to building a data science portfolio that will get you a job
17 places to find datasets for data science projects
How to present your data science portfolio on GitHub
https://www.dataquest.io/blog/how-to-setup-a-data-science-blog/
data science
programming