Permalink
Browse files

Update for Jekyll 3.3

Use the new `absolute_url` and `relative_url` Jekyll filters.
  • Loading branch information...
1 parent fa6ae73 commit fae263bd4e90eb0454857e4c2153b198e77ef596 @JoelMarcey JoelMarcey committed Nov 11, 2016
View
@@ -1,4 +1,2 @@
source 'https://rubygems.org'
-gem 'github-pages', group: :jekyll_plugins
-# Uncomment this if you need link redirects from, for example, an old site
-# gem 'jekyll-redirect-from'
+gem 'github-pages', '~> 104'
View
@@ -21,26 +21,28 @@ GEM
ffi (1.9.14)
forwardable-extended (2.6.0)
gemoji (2.1.0)
- github-pages (96)
+ github-pages (104)
activesupport (= 4.2.7)
github-pages-health-check (= 1.2.0)
- jekyll (= 3.2.1)
+ jekyll (= 3.3.0)
+ jekyll-avatar (= 0.4.2)
jekyll-coffeescript (= 1.0.1)
- jekyll-feed (= 0.5.1)
+ jekyll-feed (= 0.8.0)
jekyll-gist (= 1.4.0)
- jekyll-github-metadata (= 2.0.2)
+ jekyll-github-metadata (= 2.2.0)
jekyll-mentions (= 1.2.0)
jekyll-paginate (= 1.1.0)
jekyll-redirect-from (= 0.11.0)
jekyll-sass-converter (= 1.3.0)
- jekyll-seo-tag (= 2.0.0)
- jekyll-sitemap (= 0.10.0)
+ jekyll-seo-tag (= 2.1.0)
+ jekyll-sitemap (= 0.12.0)
+ jekyll-swiss (= 0.4.0)
jemoji (= 0.7.0)
kramdown (= 1.11.1)
liquid (= 3.0.6)
listen (= 3.0.6)
mercenary (~> 0.3)
- minima (= 1.2.0)
+ minima (= 2.0.0)
rouge (= 1.11.1)
terminal-table (~> 1.4)
github-pages-health-check (1.2.0)
@@ -53,7 +55,8 @@ GEM
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.7.0)
- jekyll (3.2.1)
+ jekyll (3.3.0)
+ addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
@@ -63,14 +66,17 @@ GEM
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
+ jekyll-avatar (0.4.2)
+ jekyll (~> 3.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
- jekyll-feed (0.5.1)
+ jekyll-feed (0.8.0)
+ jekyll (~> 3.3)
jekyll-gist (1.4.0)
octokit (~> 4.2)
- jekyll-github-metadata (2.0.2)
+ jekyll-github-metadata (2.2.0)
jekyll (~> 3.1)
- octokit (~> 4.0)
+ octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.2.0)
activesupport (~> 4.0)
html-pipeline (~> 2.3)
@@ -80,9 +86,11 @@ GEM
jekyll (>= 2.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
- jekyll-seo-tag (2.0.0)
- jekyll (~> 3.1)
- jekyll-sitemap (0.10.0)
+ jekyll-seo-tag (2.1.0)
+ jekyll (~> 3.3)
+ jekyll-sitemap (0.12.0)
+ jekyll (~> 3.3)
+ jekyll-swiss (0.4.0)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
jemoji (0.7.0)
@@ -98,27 +106,25 @@ GEM
rb-inotify (>= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.1.0)
- minima (1.2.0)
- minitest (5.9.0)
+ minima (2.0.0)
+ minitest (5.9.1)
multipart-post (2.0.0)
net-dns (0.8.0)
- nokogiri (1.6.8)
+ nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
- pkg-config (~> 1.1.7)
- octokit (4.3.0)
- sawyer (~> 0.7.0, >= 0.5.3)
+ octokit (4.6.0)
+ sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
- pkg-config (1.1.7)
public_suffix (1.5.3)
- rb-fsevent (0.9.7)
+ rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.22)
- sawyer (0.7.0)
- addressable (>= 2.3.5, < 2.5)
+ sawyer (0.8.0)
+ addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 0.10)
terminal-table (1.7.3)
unicode-display_width (~> 1.1.1)
@@ -133,7 +139,7 @@ PLATFORMS
ruby
DEPENDENCIES
- github-pages
+ github-pages (~> 104)
BUNDLED WITH
1.13.1
View
@@ -44,18 +44,26 @@ The requirements for running a GitHub pages site locally is described in [GitHub
- On first runs or for structural changes to the documentation (e.g., new sidebar menu item), do a full build.
```
- bundle exec jekyll serve --config=_config.yml,_config_local_dev.yml
+ bundle exec jekyll serve
```
- For content changes only, you can use `--incremental` for faster builds.
```
- bundle exec jekyll serve --config=_config.yml,_config_local_dev.yml --incremental
+ bundle exec jekyll serve --incremental
```
> We use `bundle exec` instead of running straight `jekyll` because `bundle exec` will always use the version of Jekyll from our `Gemfile`. Just running `jekyll` will use the system version and may not necessarily be compatible.
- > The `_config_local_dev` file overrides some URL settings that you might be using in production to allow you to test links, etc. locally.
+ - To run using an actual IP address, you can use `--host=0.0.0.0`
+
+ ```
+ bundle exec jekyll serve --host=0.0.0.0
+ ```
+
+ This will allow you to use the IP address associated with your machine in the URL. That way you could share it with other people.
+
+ e.g., on a Mac, you can your IP address with something like `ifconfig | grep "inet " | grep -v 127.0.0.1`.
1. Either of commands in the previous step will serve up the site on your local device at http://127.0.0.1:4000/ or http://localhost:4000.
View
@@ -4,12 +4,29 @@ title: Hack
tagline: Programming productivity without breaking things
fbappid: "1615782811974223"
gacode: "UA-49208336-1"
+
# baseurl determines the subpath of your site. For example if you're using an
# organisation.github.io/reponame/ basic site URL, then baseurl would be set
-# as "/reponame/" but leave blank if you have a top-level domain URL
-# https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/
-baseurl: ""
-url: "http://hacklang.org" # the base hostname & protocol for your site
+# as "/reponame" but leave blank if you have a top-level domain URL as it is
+# now set to "" by default as discussed in:
+# http://jekyllrb.com/news/2016/10/06/jekyll-3-3-is-here/
+
+# the base hostname & protocol for your site
+# If baseurl is set, then the absolute url for your site would be url/baseurl
+# This was also be set to the right thing automatically for local development
+# https://github.com/blog/2277-what-s-new-in-github-pages-with-jekyll-3-3
+# http://jekyllrb.com/news/2016/10/06/jekyll-3-3-is-here/
+url: "http://hacklang.org"
+
+# Note: There are new filters in Jekyll 3.3 to help with absolute and relative urls
+# absolute_url
+# relative_url
+# So you will see these used throughout the Jekyll code in this template.
+# no more need for | prepend: site.url | prepend: site.baseurl
+# http://jekyllrb.com/news/2016/10/06/jekyll-3-3-is-here/
+# https://github.com/blog/2277-what-s-new-in-github-pages-with-jekyll-3-3
+
+# The GitHub repo for your project
ghrepo: "hhvm/hacklang.org"
# Use these color settings to determine your colour scheme for the site.
@@ -1,6 +0,0 @@
-# Local development config settings to over-ride base.
-# `jekyll serve` will by default generate a webserver at localhost:4000, so
-# only change `url` if you're using a non-default location.
-
-baseurl: ""
-url: "http://127.0.0.1:4000"
View
@@ -1,35 +1,38 @@
- title: Install
href: http://docs.hhvm.com/hack/getting-started/getting-started
- category: install
+ category: external
- title: Tutorial
href: /tutorial.html
category: tutorial
- title: Docs
href: http://docs.hhvm.com/hack/
- category: documentation
+ category: external
- title: Spec
href: https://github.com/hhvm/hack-langspec
- category: specifcation
+ category: external
- title: GitHub
href: http://github.com/facebook/hhvm
- category: github
+ category: external
- title: Twitter
href: https://twitter.com/hacklang
- category: twitter
+ category: external
- title: HHVM
href: http://hhvm.com/
- category: hhvm
+ category: external
- title: Blog
href: http://hhvm.com/blog
- category: hhvm-blog
+ category: external
- title: IRC
href: http://webchat.freenode.net/?channels=hhvm
- category: hhvm-irc
+ category: external
+
+# Use external for external links not associated with the paths of the current site.
+# If a category is external, site urls, for example, are not prepended to the href, etc.
@@ -3,7 +3,7 @@
<br />
<div class="pagination">
{% if paginator.previous_page %}
- <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; Prev</a>
+ <a href="{{ paginator.previous_page_path | relative_url | replace: '//', '/' }}">&laquo; Prev</a>
{% else %}
<span>&laquo; Prev</span>
{% endif %}
@@ -12,18 +12,17 @@
{% if page == paginator.page %}
<em>{{ page }}</em>
{% elsif page == 1 %}
- <a href="{{ '/blog' | prepend: site.baseurl }}">{{ page }}</a>
+ <a href="{{ '/blog' | relative_url }}">{{ page }}</a>
{% else %}
- <a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
+ <a href="{{ site.paginate_path | relative_url | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
- <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next &raquo;</a>
+ <a href="{{ paginator.next_page_path | relative_url | replace: '//', '/' }}">Next &raquo;</a>
{% else %}
<span>Next &raquo;</span>
{% endif %}
</div>
<br />
{% endif %}
-
View
@@ -1,14 +1,14 @@
<div class="post">
<header class="post-header">
- <h1 class="post-title">{% if include.truncate %}<a href="{{ site.url }}{{ site.baseurl }}{{ page.url }}">{{ page.title }}</a>{% else %}{{ page.title }}{% endif %}</h1>
+ <h1 class="post-title">{% if include.truncate %}<a href="{{ page.url | absolute_url }}">{{ page.title }}</a>{% else %}{{ page.title }}{% endif %}</h1>
</header>
<article class="post-content">
{% if include.truncate %}
{% if page.content contains '<!--truncate-->' %}
{{ page.content | split:'<!--truncate-->' | first }}
<div class="read-more">
- <a href="{{ site.url }}{{ site.baseurl }}{{ page.url }}" >
+ <a href="{{ page.url | absolute_url }}" >
...Read More
</a>
</div>
View
@@ -3,23 +3,21 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <meta property="og:url" content="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}" />
+ <meta property="og:url" content="{{ page.url | replace:'index.html','' | absolute_url }}" />
<meta property="og:site_name" content="{{ site.title }}"/>
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" />
- <meta property="og:image" content="{{ site.url }}{{ site.baseurl }}/static/og_image.png" />
+ <meta property="og:image" content="{{ '/static/og_image.png' | absolute_url }}" />
<meta property="og:description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}" />
- <link rel="stylesheet" href="{{ site.url }}{{ site.baseurl }}/css/main.css" media="screen">
- <link rel="icon" href="{{ site.url }}{{ site.baseurl }}/static/favicon.png" type="image/x-icon">
+ <link rel="stylesheet" href="{{ '/css/main.css' | relative_url }}" media="screen">
+ <link rel="icon" href="{{ '/static/favicon.png' | relative_url }}" type="image/x-icon">
{% if site.searchconfig %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" />
{% endif %}
<title>{% if page.title %}{{ page.title }} | {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
- <base href="{{ site.url }}{{ site.baseurl }}/" />
-
- <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
- <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
+ <link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
+ <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ '/feed.xml' | absolute_url }}" />
</head>
@@ -1,7 +1,7 @@
<div class="headerContainer">
<div id="header_wrap" class="wrapper headerWrapper">
<div class="inner">
- <img class="projectLogo" height="200px" src="{{ site.baseurl }}/static/logo.svg" alt="{{ site.title }}" title="{{ site.title }}" />
+ <img class="projectLogo" height="200px" src="{{ '/static/logo.svg' | relative_url }}" alt="{{ site.title }}" title="{{ site.title }}" />
<h1 id="project_title">{{ site.title }}</h1>
<h2 id="project_tagline" class="fbossFontLight">{{ site.tagline }}</h2>
@@ -16,4 +16,4 @@ <h2 id="project_tagline" class="fbossFontLight">{{ site.tagline }}</h2>
</div>
</div>
</div>
-</div>
+</div>
View
@@ -1,21 +1,25 @@
<div id="fixed_header" class="fixedHeaderContainer{% if include.alwayson %} visible{% endif %}">
<div class="headerWrapper wrapper">
<header>
- <a href="{{ site.url }}{{ site.baseurl }}/">
- <img src="{{ site.baseurl }}/static/logo.svg">
+ <a href="{{ absolute_url }}/">
+ <img src="{{ '/static/logo.svg' | relative_url }}">
<h2>{{ site.title }}</h2>
</a>
<div class="navigationWrapper navigationFull" id="flat_nav">
<nav class="navigation">
<ul>
{% for item in site.data.nav %}
- <li class="navItem{% if page.collection == item.category or page.category == item.category %} navItemActive{% endif %}">
- <a href="{{ item.href }}">{{ item.title }}</a>
- </li>
+ <li class="navItem{% if page.collection == item.category or page.category == item.category %} navItemActive{% endif %}">
+ {% if item.category == "external" %}
+ <a href="{{ item.href }}">{{ item.title }}</a>
+ {% else %}
+ <a href="{{ item.href | relative_url }}">{{ item.title }}</a>
+ {% endif %}
+ </li>
{% endfor %}
{% if site.searchconfig %}
- {% include nav_search.html inputselector="search_input" %}
+ {% include nav_search.html inputselector="search_input" %}
{% endif %}
</ul>
</nav>
@@ -1 +1 @@
-<li class="navListItem"><a class="navItem" href="{{ groupitem.url }}">{{ groupitem.title }}</a></li>
+<li class="navListItem"><a class="navItem" href="{{ groupitem.url | absolute_url }}">{{ groupitem.title }}</a></li>
@@ -2,12 +2,12 @@
<a
href="https://twitter.com/share"
class="twitter-share-button"
- data-url="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}"
+ data-url="{{ page.url | replace:'index.html','' | absolute_url }}"
data-text="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"
data-hashtags="flowtype">Tweet</a>
<div
class="fb-like"
- data-href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}"
+ data-href="{{ page.url | replace:'index.html','' | absolute_url }}"
data-layout="button_count"
data-action="like"
data-show-faces="false"
Oops, something went wrong.

0 comments on commit fae263b

Please sign in to comment.