Skip to content

Commit

Permalink
Look for site.github.url if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
parkr committed Aug 30, 2016
1 parent da835d1 commit b2dedc4
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 14 deletions.
8 changes: 5 additions & 3 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">

<link rel="stylesheet" href="{{ "/css/main.css" | prepend: 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 | escape }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
{% assign custom_url = site.url | append: site.baseurl %}
{% assign full_base_url = site.github.url | default: custom_url %}
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: full_base_url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: full_base_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | prepend: full_base_url }}">
</head>
6 changes: 4 additions & 2 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

<div class="wrapper">

<a class="site-title" href="{{ site.baseurl }}/">{{ site.title | escape }}</a>
{% assign custom_url = site.url | append: site.baseurl %}
{% assign full_base_url = site.github.url | default: custom_url %}
<a class="site-title" href="{{ full_base_url }}/">{{ site.title | escape }}</a>

<nav class="site-nav">
<a href="#" class="menu-icon">
Expand All @@ -16,7 +18,7 @@
<div class="trigger">
{% for my_page in site.pages %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | prepend: site.baseurl }}">{{ my_page.title | escape }}</a>
<a class="page-link" href="{{ my_page.url | prepend: full_base_url }}">{{ my_page.title | escape }}</a>
{% endif %}
{% endfor %}
</div>
Expand Down
4 changes: 4 additions & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "jekyll", "~> 3.2"
gem "minima", path: "../"
22 changes: 15 additions & 7 deletions example/_config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
theme: minima

name: A site title
description: "Write an awesome description for your new site here. It will appear in your document head meta (for Google search results) and in your feed.xml site description."
title: Your awesome title
email: your-email@domain.com
description: > # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "/my-project"
twitter_username: jekyllrb
github_username: jekyll

collections:
posts:
permalink: /posts/:title
# Build settings
markdown: kramdown
theme: minima
exclude:
- Gemfile
- Gemfile.lock
6 changes: 6 additions & 0 deletions example/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: about
layout: page
---

About me!
6 changes: 4 additions & 2 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
layout: default
layout: page
---

Lorem ipsum dolor sit amet, quo id prima corrumpit pertinacia, id ius dolor dolores, an veri pertinax explicari mea. Agam solum et qui, his id ludus graeco adipiscing. Duis theophrastus nam in, at his vidisse atomorum. Tantas gloriatur scripserit ne eos. Est wisi tempor habemus at, ei graeco dissentiet eos. Ne usu aliquip sanctus conceptam, te vis ignota animal, modus latine contentiones ius te.

{% assign custom_url = site.url | append: site.baseurl %}
{% assign full_base_url = site.github.url | default: custom_url %}
{% for post in site.posts %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<h2><a href="{{ post.url | prepend: full_base_url }}">{{ post.title }}</a></h2>
{% endfor %}

Te falli veritus sea, at molestiae scribentur deterruisset vix, et mea zril phaedrum vulputate. No cum dicit consulatu. Ut has nostro noluisse expetendis, te pro quaeque disputando, eu sed summo omnes. Eos at tale aperiam, usu cu propriae quaestio constituto, sed aperiam erroribus temporibus an.
Expand Down

0 comments on commit b2dedc4

Please sign in to comment.