SlideShare a Scribd company logo
@jrf_nl
#ghpages
Promote your Open Source Project
with GitHub Pages
Juliette Reinders Folmer
CODEMOTION MILAN - SPECIAL EDITION
10 – 11 NOVEMBER 2017
@jrf_nl
#ghpages
Does my
open source project
need
a website ? (Hint: YES!)
@jrf_nl
#ghpages
Why ?
discoverability usability credibility
@jrf_nl
#ghpages
Content ?
• What is it ?
• Why should I use it ?
• Features
• Roadmap
• Development Blog
• Download link
• How to install
• How to use
• Documentation
@jrf_nl
#ghpages
Introducing GitHub Pages
@jrf_nl
#ghpages
Static
Site
Generator
@jrf_nl
#ghpages
Static site
Pre-
generated
static site
Jekyll
generated
static site
@jrf_nl
#ghpages
Pre-generated vs Jekyll
Make changes
Push to src branch
Locally build site
Push to GH Pages branch
Make changes
Push to GH Pages
branch
@jrf_nl
#ghpages
WordPress or
other CMS
GHWiki GH Pages
static
GH Pages pre-
generated
GH Pages
with Jekyll
Findability + -/+ + + +
Usability + - + + +
Ease of contributing
same login ? -- + + + +
testing locally ? - -- ++ - +
reviewability ? + - ++ (PR) ++ (PR) ++ (PR)
auditability ? - +/-
(history)
++ ++ ++
access to GH API ? +/-
via plugin or
custom code
-- --
via custom js
code
+
via custom code
+
at push
extendability ? ++ -- - ++ -
threshold to contribute ? -- ++ + +/- ++
@jrf_nl
#ghpages
Free Fast Open
@jrf_nl
#ghpages
Open
Collaboration
Website
@jrf_nl
#ghpages
GitHub Pages in Practice
@jrf_nl
#ghpages
Types
Type Site Branch
User <username>.github.io master
Organisation <orgname>.github.io master
Project
<username>.github.io/<projectname>
<orgname>.github.io/<projectname>
• gh-pages
• /docs subdir of
master
@jrf_nl
#ghpages
How It Works
• Orphan branch
• Site regenerated on
push to gh-pages
branch or master
/docs subdirectory
master
gh-pages
@jrf_nl
#ghpages
@jrf_nl
#ghpages
@jrf_nl
#ghpages
@jrf_nl
#ghpages
What Do You Get ?
RougeKramdown
LiquidJekyll
@jrf_nl
#ghpages
Plugins
jekyll-redirect-
from
jekyll-sitemapjekyll-seo-tag
jekyll-
mentions
jekyll-gistjekyll-feed
jemoji
jekyll-sass-
converter
@jrf_nl
#ghpages
Basic Set Up
@jrf_nl
#ghpages
Gem File
source 'https://rubygems.org'
gem 'github-pages'
Branch: gh-pages/master
Location: /
Filename: Gemfile
https://pages.github.com/versions/
@jrf_nl
#ghpages
Git Ignore
_site/*
Gemfile.lock
Branch: gh-pages/master
Location: /
Filename: .gitignore
@jrf_nl
#ghpages
Using Your Own Domain
yourdomainname.com
Branch: gh-pages/master
Location: /
Filename: CNAME
@jrf_nl
#ghpages
DNS Settings
www or custom
subdomain
CNAME
<user>.github.io
APEX domain
ALIAS, ANAME or A
192.30.252.153
192.30.252.154
@jrf_nl
#ghpages
Working With
@jrf_nl
#ghpages
Directory Layout
/
_drafts
_includes
_layouts
_posts
_sass
assets
css
js
images
@jrf_nl
#ghpages
.config.yml
baseurl: /
highlighter: rouge
markdown: kramdown
permalink: /:year/:month/:day/:title/
encoding: UTF-8
kramdown:
input: GFM
auto_id_prefix: "h-"
parse_block_html: true
plugins:
- jekyll-mentions
exclude: ['CNAME', '.gitignore', '.travis.yml',
'Gemfile', 'CONTRIBUTING.md', 'LICENSE', 'README.md']
@jrf_nl
#ghpages
Front Matter
---
title: How do I get started with Jekyll ?
permalink: /installing-jekyll/
layout: default
published: false
date: YYYY-MM-DD HH:MM:SS +/-TTTT (posts only)
category: install
tags:
- tag1
- tag2
---
@jrf_nl
#ghpages
URL Structure
1. _config.yml
permalink: date
# = {:categories/:year/
:month/:day/:title.html}
# other options:
• pretty ● none
• ordinal ● custom
2. frontmatter
---
permalink: /custom-url/
---
3. via directory structure
@jrf_nl
#ghpages
Working With Liquid
@jrf_nl
#ghpages
Liquid Basics
# Output
{{ variable | filter }}
# Tags
{% tag %}
@jrf_nl
#ghpages
Jekyll Variables
# Sitewide info + info from
_config.yml
{{ site }}
# Page/post info + page
front matter
{{ page }}
### {{page.title}}
# All posts (files) in
/_posts/
{{ site.posts }}
# All pages
{{ site.pages }}
# The content of the page or
post being generated
{{ content }}
@jrf_nl
#ghpages
{{ variable | filters | more filters }}
append / prepend: 'string'
capitalize
downcase / upcase
escape(_once)
xml_escape
strip_html
strip_newlines
newline_to_br
replace: 'foo','bar'
markdownify
slugify
date_to_xmlschema
date_to_rfc822
date_to_string
date_to_long_string
ceil
floor
sort
size
map
@jrf_nl
#ghpages
Creating
Output
<h3>Recent posts</h3>
<ul>
{% for post in site.posts | limit: 5 %}
<li>
<a href="{{ post.url | remove: 'index.html' |
prepend: site.github.url }}">{{ post.title }}</a><br />
<span class="post-meta"><a href="{{ post.author |
url_escape | prepend: 'https://github.com/' }}">
@{{ post.author }}</a> |
<time datetime="{{ post.date | date: '%F %R' }}">
{{ post.date | date_to_string }}</time></span>
</li>
{% endfor %}
</ul>
@jrf_nl
#ghpages
@jrf_nl
#ghpages
Tags
{% for var in varhash %}
# do something
{% endfor %}
{% case condition %}
{% when 'public' %}
# do something else
{% when 'private' %}
# do something else
{% endcase %}
{% if var.size > 5 %}
# do something
{% else %}
# do something else
{% endif %}
# Including partials
{% include footer.html %}
@jrf_nl
#ghpages
Other Useful Tricks
{% capture generate_date %}
{{ site.time | date: "%Y%m%d" }}
{% endcapture %}
{{ 'style.css?v=' | append
generate_date }}
{% assign sorted_categories
= ( site.categories | sort:0
%}
{% raw %}
Some content with
conflicting {{{tags}}}.
{% endraw %}
{% comment %}
This will be ignored when
the site is build.
{% endcomment %}
@jrf_nl
#ghpages
Rouge Code Highlighting
{% highlight php %}
<?php
foreach ( $attendees as $attendee ) {
echo 'Codemotion Milan 2017 rocks!';
}
{% endhighlight %}
@jrf_nl
#ghpages
Rouge Code Highlighting
{% highlight php %}
<?php
foreach ( $attendees as $attendee ) {
echo 'Codemotion Milan 2017 rocks!';
}
{% endhighlight %}
https://github.com/mojombo/tpw/blob/master/css/syntax.css
https://github.com/richleland/pygments-css/blob/master/github.css
@jrf_nl
#ghpages
Working With the GitHub API
@jrf_nl
#ghpages
Useful Variables From the API
{{ site.github.url }}
# http://<user>.github.io/<project>
{{ site.github.repository_url }}
# https://github.com/<user>/<project>
{{ site.github.zip_url }}
{{ site.github.tar_url }}
{{ site.github.clone_url }}
@jrf_nl
#ghpages
Useful Variables From the API
{{ site.github.project_title }}
# Repository name
{{ site.github.project_tagline }}
# Repository description
{{ site.github.owner_name }} # nick
{{ site.github.owner_url }}
@jrf_nl
#ghpages
Adding a
Releases
Table
<div class="releases">
{%if site.github.releases %}
<table>
<tr><th>Release</th><th>Version</th><th>Released on</th><th
colspan="2">Download</th></tr>
{% for release in site.github.releases limit:3 %}
<tr>
<td><a href="{{ release.html_url }}">{{ release.name
}}</a></td>
<td>{{ release.published_at | date_to_string }}</td>
<td><a href="{{ release.zipball_url }}">Zip</a></td>
<td><a href="{{ release.tarball_url }}">Tar</a></td>
</tr>
{% endfor %}
</table>
{% endif %}
@jrf_nl
#ghpages
@jrf_nl
#ghpages
Adding
Change-
logs
{% if site.github.releases %}
##### Changelog
{% for release in site.github.releases
limit:1 %}
<div class="changelog">{{ release.body |
markdownify }}</div>
{% endfor %}
{% endif %}
@jrf_nl
#ghpages
@jrf_nl
#ghpages
Showing
Off
Contributors
<div class="contributors">
{% for contributor in site.github.contributors %}
[![Avatar]({{ contributor.avatar_url }}){: style="width:
30px;"}]({{ contributor.html_url }}) [@{{
contributor.login }}]({{ contributor.html_url }})
{: .contributor }
{% else %}
This project would not be possible without the help of
[our amazing contributors]( {{ '/graphs/contributors' |
prepend: site.github.url }} ) on GitHub.
{% endfor %}
</div>
@jrf_nl
#ghpages
@jrf_nl
#ghpages
Showing Your Gists
{% gist e5af95370fdb834ad7d696b4112c8d0c %}
@jrf_nl
#ghpages
Showing Your Gists
{% gist e5af95370fdb834ad7d696b4112c8d0c %}
@jrf_nl
#ghpages
Testing Your Build
@jrf_nl
#ghpages
Testing
Your
Build
branches:
only:
- gh-pages
language: ruby
cache: bundler
rvm:
- 2.1.0
script:
# Test the build
- bundle exec jekyll build
@jrf_nl
#ghpages
Setting Up a Local Environment
• https://www.ruby-lang.org/en/downloads/
Install Ruby
• > gem install bundler
Install Bundler
Make sure you have created a Gemfile
• projectdir> bundle install
Install gems
@jrf_nl
#ghpages
Testing Locally
# Always make sure your gems are up to date
projectdir> bundle update
# Build it and watch for changes
projectdir> bundle exec jekyll serve
View in browser: http://localhost:4000/
@jrf_nl
#ghpages
Questions ?
@jrf_nl
#ghpages
Useful Links
• https://pages.github.com/
• https://help.github.com/categories/
customizing-github-pages/
• https://jekyllrb.com/
• https://github.com/Shopify/liquid/wiki/
Liquid-for-Designers
• https://help.github.com/articles/
repository-metadata-on-github-pages/
• http://ghpages.info/ (coming soon)
@jrf_nl
#ghpages
Thank you !
Slides will be posted to
http://speakerdeck.com/jrf

More Related Content

PDF
Collaborative Development: The Only CD That Matters - Brent Beer - Codemotion...
PPTX
Git and git workflow best practice
KEY
Matt Gauger - Git & Github web414 December 2010
KEY
Gittalk
PDF
Front Ends for Back End Developers - Spring I/O 2017
DOCX
Git github
PDF
Git and Github workshop
PPTX
Introduction To Git Workshop
Collaborative Development: The Only CD That Matters - Brent Beer - Codemotion...
Git and git workflow best practice
Matt Gauger - Git & Github web414 December 2010
Gittalk
Front Ends for Back End Developers - Spring I/O 2017
Git github
Git and Github workshop
Introduction To Git Workshop

What's hot (20)

PDF
手把手教你如何串接 Log 到各種網路服務
PDF
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
PDF
Advanced Git
PDF
Git and Github
PDF
沒有 GUI 的 Git
PDF
Git Real
PDF
Git the Docs: A fun, hands-on introduction to version control
PPTX
Hacking Git and GitHub
PPT
Open Source Collaboration With Git And Git Hub
PDF
Git workflow in agile development
PDF
Starting with Git & GitHub
PDF
Enabling Microservice @ Orbitz - GOTO Chicago 2016
PDF
Nina Zakharenko - Introduction to Git - Start SLC 2015
KEY
Git Magic: Versioning Files like a Boss
PDF
Git & Github for beginners
PDF
Git advanced
PDF
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
PDF
Git in pills : git stash
PDF
Git For The Android Developer
PDF
Git for Beginners
手把手教你如何串接 Log 到各種網路服務
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
Advanced Git
Git and Github
沒有 GUI 的 Git
Git Real
Git the Docs: A fun, hands-on introduction to version control
Hacking Git and GitHub
Open Source Collaboration With Git And Git Hub
Git workflow in agile development
Starting with Git & GitHub
Enabling Microservice @ Orbitz - GOTO Chicago 2016
Nina Zakharenko - Introduction to Git - Start SLC 2015
Git Magic: Versioning Files like a Boss
Git & Github for beginners
Git advanced
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
Git in pills : git stash
Git For The Android Developer
Git for Beginners
Ad

Similar to Juliette Reinders Folmer - Promote your open source project with GitHub Pages - Codemotion Milan 2017 (20)

PDF
Building Tools with GitHub Customize Your Workflow 1st Edition Chris Dawson
PPTX
Git, GitHub gh-pages and static websites
PPTX
Untangling4
PDF
Static Websites - The Final Frontier
PDF
Git Hub Platform
PDF
Fewd week1 slides
PPTX
A Deep Dive into RESTful API Design Part 2
PPTX
About GitHub Profile for projects and academic purpose.pptx
PDF
OSS SW Basics Lecture 03: Fundamental parts of open-source projects
PPTX
Untangling fall2017 week2
PPTX
Untangling fall2017 week2_try2
PDF
WebDev Crash Course
PPTX
API Documentation Workshop tcworld India 2015
PDF
GIT_GITHUB_2016_06_17
PPTX
Workshop html5, css3 & github
PPTX
Untangling the web - fall2017 - class 4
PPT
Stop Making The Web Harder Than It Is; Real-world REST, HATEOAS, and Hypermed...
PPTX
Basics of Open Source Contribution - WWCodeMobile
PDF
Architektura html, css i javascript - Jan Kraus
PPTX
Creating Truly RESTful APIs
Building Tools with GitHub Customize Your Workflow 1st Edition Chris Dawson
Git, GitHub gh-pages and static websites
Untangling4
Static Websites - The Final Frontier
Git Hub Platform
Fewd week1 slides
A Deep Dive into RESTful API Design Part 2
About GitHub Profile for projects and academic purpose.pptx
OSS SW Basics Lecture 03: Fundamental parts of open-source projects
Untangling fall2017 week2
Untangling fall2017 week2_try2
WebDev Crash Course
API Documentation Workshop tcworld India 2015
GIT_GITHUB_2016_06_17
Workshop html5, css3 & github
Untangling the web - fall2017 - class 4
Stop Making The Web Harder Than It Is; Real-world REST, HATEOAS, and Hypermed...
Basics of Open Source Contribution - WWCodeMobile
Architektura html, css i javascript - Jan Kraus
Creating Truly RESTful APIs
Ad

More from Codemotion (20)

PDF
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
PDF
Pompili - From hero to_zero: The FatalNoise neverending story
PPTX
Pastore - Commodore 65 - La storia
PPTX
Pennisi - Essere Richard Altwasser
PPTX
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
PPTX
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
PPTX
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
PPTX
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
PDF
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
PDF
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
PDF
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
PDF
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
PDF
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
PDF
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
PPTX
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
PPTX
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
PDF
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
PDF
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
PDF
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
PDF
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Pompili - From hero to_zero: The FatalNoise neverending story
Pastore - Commodore 65 - La storia
Pennisi - Essere Richard Altwasser
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation theory and applications.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Approach and Philosophy of On baking technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KodekX | Application Modernization Development
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
20250228 LYD VKU AI Blended-Learning.pptx
cuic standard and advanced reporting.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Review of recent advances in non-invasive hemoglobin estimation
Network Security Unit 5.pdf for BCA BBA.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation theory and applications.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Approach and Philosophy of On baking technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

Juliette Reinders Folmer - Promote your open source project with GitHub Pages - Codemotion Milan 2017