Skip to content

Commit

Permalink
Proper use of url and baseurl
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvc committed Jul 29, 2015
1 parent c38e648 commit 3a0f792
Show file tree
Hide file tree
Showing 14 changed files with 199 additions and 41 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: ruby
rvm:
- 2.0.0 # otherwise public_suffix will fail to install
script:
- bundle exec jekyll build --config _config.yml,_config_dev.yml
- bundle exec htmlproof ./_site --only-4xx --check-favicon --check-html
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
5 changes: 2 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ author:
# want it.
info:

# The URL of the homepage of your site (without trailing slash). Leave this
# empty when you run Jekyll locally.
url: http://steinvc.github.io/holo-alfa
url: http://steinvc.github.io
baseurl: "/holo-alfa"

# language attribute in <html> element.
lang: en
Expand Down
150 changes: 150 additions & 0 deletions _config_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@

# The name of your website.
name: Holo Alfa

description:

# Discription of your site, this will show up in google.
meta: Holo Alfa is a minimalist, mobile first Jekyll theme with focus on readability and content.

# Discription of your site, this will show up on the front page.
subtitle: Holo Alfa is a minimalist, mobile first Jekyll theme with focus on readability and content. <a href="https://github.com/steinvc/holo-alfa">&lt;/&gt; on Github</a>.

author:
name: Stijn van Cuijk

# Necessary for contact page
email: [email protected]

# Optional text (html) to dislay after author name. Leave empty if you don't
# want it.
info:

# The URL of the homepage of your site (without trailing slash). Leave this
# empty when you run Jekyll locally.
url: http://localhost:4000
baseurl: ""

# language attribute in <html> element.
lang: en

# FROM THIS POINT ON EVERYTHING IS OPTIONAL

##############
# APPEREANCE #
##############

# If you want to show the subtitle anywhere else than the front page, use
# {% include subtitle.html %} to include it anywhere you want.
show-subtitle: true
display-social-icons: false

footer-text: This is the footer.<br><a href="http://steinvc.github.io/holo-alfa/">Holo Alfa</a> Jekyll theme crafted by <a href="http://steinvc.github.io/holo-alfa/">Stijn</a>.

# Preferrably 64px in height. Leave empty = disbale.
logo-image: # /img/logo.png

# Toolbar color for Chrome on Android.
theme-color-attr: "#00f0ff"

# Color of Microsoft live Tile.
ms-tile-color: "#00f0ff"

# Color used throughout the theme. Format: R, G, B.
theme-color: 0, 240, 255 # Original: 0, 240, 255

# Text color used throughout the theme. Format: R, G, B.
text-color: 0, 0, 0 # Original: 0, 0, 0

# Background color used throughout the theme. Format: R, G, B.
# Note: if you change the background color AND you use cover images, you should
# also change the CSS gradient in "_includes\gradient.css" to match the
# background color. Edit and copy it from here:
# http://www.colorzilla.com/gradient-editor/#ffffff+0,ffffff+100&0+0,1+100
background-color: 255, 255, 255 # Original: 255, 255, 255

display-author-post-page: true
display-author-front-page: true

# http://alanwsmith.com/jekyll-liquid-date-formatting-examples
date_format: "%b %-d, %Y"

# Minimal screen-width after wich the navigation will change position from
# vertical to horizontal.
nav-breaking-point: 520px

# Number of posts on each page.
paginate: 3

# Display links for the previous and next post on post pages.
display-next-prev-post: false

# Leave empty if you don't want comments on post pages.
disqus-shortname:


################
# SOCIAL ICONS #
################

# Use a complete url here, including http:// and such. Requiring just usernames
# has been considered, but this is way more customizable.
twitter:
youtube:
instagram:
tumblr:
facebook:
google-plus:
reddit:
soundcloud:
medium:
linkedin:
github:
behance:
codepen:
dribbble:
trello:
stack-overflow:
bitcoin:
paypal:


#####################
# CUSTOMIZABLE TEXT #
#####################

# Usefull for translating into other languages.

var_on_the_web: On the web
var_read: Read # Text after each post summary on the homepage.
var_newer: Newer
var_older: Older
var_next_post: Next post
var_previous_post: Previous post
var_less_than_a_minute_read: Less than a minute read
var_min_read: min read # Text after reading time. Example: 5 min read.
var_post_by: Post by
var_guest_post_by: Guest post by
var_your_email: Your email
var_your_message: Your message


##################
# BUILD SETTINGS #
##################

# You don't have to change these.

highlighter: pygments
kramdown:
input: GFM
paginate_path: "/page-:num/"
permalink: pretty
defaults:
-
scope:
path: ""
type: "posts"
values:
layout: "post"
excerpt_separator: "<!--more-->"
34 changes: 17 additions & 17 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@
{% endif %}
</title>
<meta name="description" content="{{ page.summary }} {{ site.description.meta }}">
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="{{ site.url }}/feed.xml">
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="{{ site.baseurl }}/feed.xml">

<!-- icons -->
<link rel="apple-touch-icon" href="{{ site.url }}/apple-touch-icon.png">
<link rel="icon" type="image/png" href="{{ site.url }}/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="{{ site.url }}/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="{{ site.url }}/android-chrome-192x192.png" sizes="192x192">
<link rel="apple-touch-icon" href="{{ site.baseurl }}/apple-touch-icon.png">
<link rel="icon" type="image/png" href="{{ site.baseurl }}/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="{{ site.baseurl }}/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="{{ site.baseurl }}/android-chrome-192x192.png" sizes="192x192">
<meta name="theme-color" content="{{ site.theme-color-attr }}">
<meta name="msapplication-TileColor" content="{{ site.ms-tile-color }}">
<meta name="msapplication-TileImage" content="{{ site.url }}/mstile-310x310.png">
<meta name="msapplication-TileImage" content="{{ site.baseurl }}/mstile-310x310.png">
<!-- /icons -->

<!-- og tags -->
<meta property="og:site_name" content="{{ site.name }}">
<meta property="og:title" content="{% if page.title %}{{ page.title }} • {{ site.name }}{% else %}{{ site.name }}{% endif %}">
<meta property="og:locale" content="{{ site.locale }}">
<meta property="og:locale" content="{{ site.lang }}">
{% if page.og-image %}
<meta property="og:image" content="{{ site.url }}{{ page.og-image }}">
<meta property="og:image" content="{{ site.url }}{{ site.baseurl }}{{ page.og-image }}">
{% else %}
{% if page.cover-image %}
<meta property="og:image" content="{{ site.url }}{{ page.cover-image }}">
<meta property="og:image" content="{{ site.url }}{{ site.baseurl }}{{ page.cover-image }}">
{% else %}
<meta property="og:image" content="{{ site.url }}/og-image.jpg">
<meta property="og:image" content="{{ site.url }}{{ site.baseurl }}/og-image.jpg">
{% endif %}
{% endif %}
<meta property="og:type" content="website">
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:url" content="{{ site.url }}{{ site.baseurl }}{{ page.url }}">
<meta property="og:description" content="
{% if page.summary %}
{{ page.summary }}
Expand All @@ -44,15 +44,15 @@
<!-- /og tags -->

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="{{ site.url }}/js/modernizr.js"></script>
<script src="{{ site.url }}/js/fitvids.js"></script>
<script src="{{ site.baseurl }}/js/modernizr.js"></script>
<script src="{{ site.baseurl }}/js/fitvids.js"></script>
<link href='//fonts.googleapis.com/css?family=Source+Code+Pro:400,700|Source+Sans+Pro:600,900|Crimson+Text:700italic,600,600italic,400,700,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{ site.url }}/css/reset.css">
<link rel="stylesheet" href="{{ site.url }}/css/pygments.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/reset.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/pygments.css">
{% if site.display-social-icons %}
<link rel="stylesheet" href="{{ site.url }}/css/font-awesome.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/font-awesome.css">
{% endif %}
<link rel="stylesheet" href="{{ site.url }}/css/style.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/style.css">
<!--[if gte IE 9]>
<style type="text/css">
.gradient {
Expand Down
4 changes: 2 additions & 2 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header>
<a href="{{ site.url }}/" class="website-title">
<a href="{{ site.baseurl }}/" class="website-title">
{% if site.logo-image %}
<img alt="{{ site.name }}" src="{{ site.url }}{{ site.logo-image }}">
<img alt="{{ site.name }}" src="{{ site.baseurl }}{{ site.logo-image }}">
{% else %}
{{ site.name }}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions _includes/navigation.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nav>
<a href="{{ site.url }}/about/">About</a>
<a href="{{ site.url }}/contact/">Contact</a>
<a href="{{ site.url }}/archive/">Archive</a>
<a href="{{ site.baseurl }}/about/">About</a>
<a href="{{ site.baseurl }}/contact/">Contact</a>
<a href="{{ site.baseurl }}/archive/">Archive</a>
</nav>
6 changes: 3 additions & 3 deletions _includes/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<div class="left">
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a href="{{ site.url }}/">‹ {{ site.var_newer }}</a>
<a href="{{ site.baseurl }}/">‹ {{ site.var_newer }}</a>
{% else %}
<a href="{{ site.url }}/page-{{paginator.previous_page}}/">‹ {{ site.var_newer }}</a>
<a href="{{ site.baseurl }}/page-{{paginator.previous_page}}/">‹ {{ site.var_newer }}</a>
{% endif %}
{% else %}
<span class="disabled">‹ {{ site.var_newer }}</span>
{% endif %}
</div>
<div class="right">
{% if paginator.next_page %}
<a href="{{ site.url }}/page-{{paginator.next_page}}/">{{ site.var_older }} ›</a>
<a href="{{ site.baseurl }}/page-{{paginator.next_page}}/">{{ site.var_older }} ›</a>
{% else %}
<span class="disabled">{{ site.var_older }} ›</span>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<body>
{% if page.cover-image %}
<div class="cover-image-container">
<img alt="Cover image" src="{{ site.url }}/img/covers/{{ page.cover-image }}">
<img alt="Cover image" src="{{ site.baseurl }}/img/covers/{{ page.cover-image }}">
</div>
{% endif %}
<div class="wrap">
Expand Down
4 changes: 2 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ <h1>{{ page.title }}</h1>
<div class="pagination clearfix">
<div class="left">
{% if page.next.url %}
<a href="{{ page.next.url | prepend: site.url }}">‹ {{ site.var_next_post }}</a>
<a href="{{ page.next.url | prepend: site.baseurl }}">‹ {{ site.var_next_post }}</a>
{% else %}
<span class="disabled">‹ {{ site.var_next_post }}</span>
{% endif %}
</div>
<div class="right">
{% if page.previous.url %}
<a href="{{ page.previous.url | prepend: site.url }}">{{ site.var_previous_post }} ›</a>
<a href="{{ page.previous.url | prepend: site.baseurl }}">{{ site.var_previous_post }} ›</a>
{% else %}
<span class="disabled">{{ site.var_previous_post }} ›</span>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ <h3>{{ post.date | date: '%Y' }}</h3>
{% endif %}
{% endunless %}

<p><a href="{{ post.url | prepend: site.url }}">{{ post.title }}</a><small> • {{ post.date | date: site.date_format }}</small></p>
<p><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a><small> • {{ post.date | date: site.date_format }}</small></p>
{% endfor %}
4 changes: 2 additions & 2 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<form action="//formspree.io/{{ site.author.email }}"
method="POST">
<input type="email" name="_replyto" placeholder="{{ site.var_your_email }}">
<input type="hidden" name="_next" value="{{ site.url }}/thanks" />
<input type="hidden" name="_subject" value="New submission from {{ site.url }}" />
<input type="hidden" name="_next" value="{{ site.baseurl }}/thanks" />
<input type="hidden" name="_subject" value="New submission from {{ site.url }}{{ site.baseurl }}" />
<input type="text" name="_gotcha" style="display:none" />
<textarea type="text" name="content" rows="8" placeholder="{{ site.var_your_message }}"></textarea>
<input type="submit" value="Send">
Expand Down
4 changes: 2 additions & 2 deletions feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<description>{{ post.content | xml_escape }}</description>
{% endif %}
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
<link>{{ post.url | prepend: site.url }}</link>
<guid isPermaLink="true">{{ post.url | prepend: site.url }}</guid>
<link>{{ site.url }}{{ site.baseurl }}{{ post.url }}</link>
<guid isPermaLink="true">{{ site.url }}{{ site.baseurl }}{{ post.url }}</guid>
</item>
{% endfor %}
</channel>
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
{% endif %}
{% endif %}
{{ post.date | date: site.date_format }} • {{ read-time }}</span>
<a href="{{ post.url | prepend: site.url }}"><h1>{{ post.title }}</h1></a>
<a href="{{ post.url | prepend: site.baseurl }}"><h1>{{ post.title }}</h1></a>
<p>
{% if post.summary %}
{{ post.summary }}&nbsp;<a class="read-more" href="{{ post.url | prepend: site.url }}">{{ site.var_read }} →</a>
{{ post.summary }}&nbsp;<a class="read-more" href="{{ post.url | prepend: site.baseurl }}">{{ site.var_read }} →</a>
{% else %}
{{ post.excerpt | remove: '<p>' | remove: '</p>' }}&nbsp;<a class="read-more" href="{{ post.url | prepend: site.url }}">{{ site.var_read }} →</a>
{{ post.excerpt | remove: '<p>' | remove: '</p>' }}&nbsp;<a class="read-more" href="{{ post.url | prepend: site.baseurl }}">{{ site.var_read }} →</a>
{% endif %}
</p>

Expand Down
4 changes: 2 additions & 2 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for post in site.posts %}
<url>
<loc>{{ site.url }}{{ post.url | remove: 'index.html' }}</loc>
<loc>{{ site.url }}{{ site.baseurl }}{{ post.url | remove: 'index.html' }}</loc>
</url>
{% endfor %}

Expand All @@ -13,7 +13,7 @@
{% if page.layout != 'redirect' %}
{% if page.ignore != true %}
<url>
<loc>{{ site.url }}{{ page.url | remove: 'index.html' }}</loc>
<loc>{{ site.url }}{{ site.baseurl }}{{ page.url | remove: 'index.html' }}</loc>
</url>
{% endif %}
{% endif %}
Expand Down

0 comments on commit 3a0f792

Please sign in to comment.