Portfolio website methods

Udacity Full Stack Web Developer Nanodegree program

Project 2. Build a portfolio site

Brendon Smith

br3ndonland

Portfolio website documentation:

Table of Contents

Summary

This was my second project for the Udacity Full Stack Web Developer nanodegree program. We were provided with a design mockup (screenshot) of a developer portfolio webpage, and had to replicate the design with HTML and CSS.

I based the webpage on Bootstrap v4.0.0-beta. In the main webpage index.html, I linked to the Bootstrap core CSS through their Content Delivery Network (CDN), and created portfolio.css for additional custom styling.

I provided a toggle button in the footer that uses jQuery JavaScript to change the page color scheme.

The repository for this project is available at https://github.com/br3ndonland/udacity-fsnd01-p02-portfolio.

I used the webpage design to create a full website with Jekyll, and hosted the site with GitHub Pages at https://br3ndonland.github.io/udacity-fsnd01-p02-portfolio. The website has three pages: “Home,” an “About” page explaining how I built the site in detail, and a “Rubric” page providing a comparison with the Udacity project rubric and all the Udacity documentation for the project.

(Back to TOC)

Development environment

I wrote the code in Sublime Text, as usual. I typically had two windows open: a double pane window, with left side for the core files I was creating (like this one, and the HTML and CSS), and right side for the Bootstrap core files for reference, and a separate window for my Udacity reference materials. I usually had three Chrome browser windows open: one for Udacity, one for reference sites like Bootstrap, and a third to preview my site with Developer Tools.

(Back to TOC)

Bootstrap

I based the site on Bootstrap v4.0.0-beta.

Bootstrap installation and use options

I explored the different ways to use Bootstrap.

Using Bootstrap

(Back to TOC)

General webpage style and structure

See the Rubric comparison section of README.md for details.

(Back to TOC)

(Back to TOC)

Jumbotron

(Back to TOC)

Portfolio thumbnails

Here is a screenshot after completing the Jumbotron and portfolio thumbnails:

Completed Jumbotron and thumbnails

Here are screenshots after completing the responsive homepage on desktop, iPad, and Nexus:

Desktop

Completed responsive homepage on desktop

iPad

Completed responsive homepage on iPad

Nexus

Completed responsive homepage on Nexus

(Back to TOC)

(Back to TOC)

Theme toggle

Colors

SVG toggle

When the dark theme is toggled, I want the “Udacity” text in the header to invert to white to stand out against the dark theme background. The Udacity logo is an SVG, and it shouldn’t be difficult to work with SVG, because it’s just simple code. Right? Wrong.

Here are screenshots of the webpage after completing the theme toggle:

Light

Completed responsive homepage on desktop with light theme

Dark

Completed responsive homepage on desktop with dark theme

(Back to TOC)

Website creation with Jekyll

Intro

I used this project as an opportunity to expand my skills from building single webpages to building multi-page websites. I used Jekyll to build the site and GitHub Pages to host the site.

Jekyll GitHub README:

Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity.

There are two ways to create a GitHub Pages site: create locally with Jekyll, or create on GitHub directly. I chose to create the site locally, as recommended in Jonathan McGlone’s tutorial:

I recommend setting up Jekyll on your own computer so you can edit and preview your site locally, and when ready, push those changes to your GitHub repo…

There are also two types of GitHub Pages sites: user and project pages. I made this a project page.

Jekyll and Ruby installation

Jekyll website creation

Jekyll website page includes and layouts

(Back to TOC)

Jekyll website hosting with GitHub Pages

Jekyll intro

Jekyll sites can be deployed to GitHub pages either as user or project pages, as described in the Jekyll docs. User pages have a dedicated repository and are built from the master branch. Project pages are built either from the docs/ folder on the master branch, or on a gh-pages branch. I made this repository into a project page from the docs/ folder.

Jekyll prep

GitHub

Resources

(Back to TOC)

Website troubleshooting

Liquid, Jekyll, GitHub Pages, and GitHub are not seamlessly integrated.

Relative URLs

In my config.yml file, I had to set the url and baseurl separately:

url: "https://br3ndonland.github.io"
baseurl: "/udacity-fsnd01-p02-portfolio"

Convert relative links to Jekyll Liquid filters for consistent linking throughout the site. The baseurl from _config.yml will only be prepended to relative urls in the context of Liquid filters.

Liquid templating can be used within HTML. For example, when creating a relative URL to an image, the entire Liquid filter is enclosed within quotes. However, I’m not sure if Liquid templating can be used within YAML front matter.

Images in Markdown

Images will show up in Markdown files with either HTML img tags or Markdown image tags. Use HTML img tags instead of Markdown ![]() image tags to allow sizing and styling.

If Jekyll Liquid filters are used to refer to images, even if the filters are within HTML img tags, the images will not show up in the Markdown files when viewed on GitHub. GitHub Pages reads Jekyll Liquid templating, but GitHub.com does not apply Liquid when viewing files in repositories. You can see this when comparing the images page of Bootstrap’s GitHub Pages site with the images page in the GitHub repository used to run the site.

The solution was to put the pages in a pages folder (not _pages, apparently custom directories for pages can’t begin with whatever you want), set permalinks in the YAML front matter, then use a plain HTML relative link starting with ../img/ to point to the directory above. This way, the file path is the same on the website and in the plain GitHub repository.

Syntax highlighting

Blockquotes

I couldn’t get blockquotes to show up properly, either with Markdown or HTML blockquote tags.

Header anchors

GitHub provides header anchor links, so that Markdown headers viewed on GitHub each have unique links. When viewing this site on GitHub pages, the header links do exist (so you can type the link into the URL manually), but the headers themselves do not have hyperlinks.

Jekyll plugins and themes

There are many Jekyll themes bundled with Jekyll, as you can see when updating with bundle update, but there is no index of the themes. Some of them can be found at GitHub Pages themes and Ruby Gems.

GitHub only allows select plugins on their site. See GitHub Pages dependencies for more info on compatibility.

View local Jekyll site on Android device

I used this feature to view a local preview of the site on my Android phone.

Screenshot of homepage after troubleshooting and two rounds of code review

Screenshot of homepage after troubleshooting and two rounds of code review

See the Review and Changelog pages for further changes.

(Back to TOC)