Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added site.baseurl for cases where site is served from sub-directory #92

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Gemfile.lock
.jekyll-metadata
.DS_Store
.jekyll-cache
.idea/
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ title: 'Lagrange'
description: 'a minimalist Jekyll theme'
author: 'Paul Le'

# URL settings
url: # Root of the domain. Full URL including protocol, domain, and port (if applicable), e.g., https://example.com

# baseurl is optional: Name of sub-directory where the site is served from, e.g., in https://example.com/Lagrange
baseurl: /Lagrange # comment this line if the site lives at the root of the domain

# RSS 2.0 can be used instead of Atom by uncommenting following two lines
#feed:
# path: rss-feed.xml
2 changes: 1 addition & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer class="footer">
{% include social-icons.html %}
<div class="footer-description"><a href="{{ site.github.url }}/">{{ site.title }} | {{ site.description }} by {{ site.author }}</a></div>
<div class="footer-description"><a href="{{ site.url }}{{ site.baseurl }}/">{{ site.title }} | {{ site.description }} by {{ site.author }}</a></div>
</footer>
6 changes: 3 additions & 3 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<link rel="stylesheet" href="{{ site.github.url }}/assets/css/main.css">
<link rel="stylesheet" href="{{ site.github.url }}/assets/css/syntax.css">
<link rel="stylesheet" href="{{ site.url }}{{ site.baseurl }}/assets/css/main.css">
<link rel="stylesheet" href="{{ site.url }}{{ site.baseurl }}/assets/css/syntax.css">
<!-- Use Atom -->
{% feed_meta %}
<!-- Use RSS-2.0 -->
<!--<link href="{{ site.github.url }}/rss-feed.xml" type="application/rss+xml" rel="alternate" title="{{ site.title }} | {{ site.description }}"/>
<!--<link href="{{ site.url }}{{ site.baseurl }}/rss-feed.xml" type="application/rss+xml" rel="alternate" title="{{ site.title }} | {{ site.description }}"/>
//-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700%7CPT+Sans:400">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro">
Expand Down
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<header class="header">
<h3 class="header-title">
<a href="{{ site.github.url }}/">{{ site.title }}</a>
<a href="{{ site.url }}{{ site.baseurl }}/">{{ site.title }}</a>
<small class="header-subtitle">{{ site.description }}</small>
{% include menu.html %}
</h3>
Expand Down
2 changes: 1 addition & 1 deletion _includes/menu.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="menu">
<nav class="menu-content">
{% for item in site.data.settings.menu %}
<a href="{{ site.github.url }}/{{ item.url }}">{{ item.name }}</a>
<a href="{{ site.url }}{{ site.baseurl }}/{{ item.url }}">{{ item.name }}</a>
{% endfor %}
</nav>
<nav class="social-icons">
Expand Down
2 changes: 1 addition & 1 deletion _includes/related-posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1 >{{ site.data.settings.related_posts }}</h1>
{% else %}
<li>
<h3>
<a href="{{ site.github.url }}{{ mypost.url }}">
<a href="{{ site.url }}{{ site.baseurl }}{{ mypost.url }}">
{{ mypost.title }}
<!--<img src="{{ site.url }}{{ site.baseurl }}/images/{{ mypost.image.teaser }}">-->
<!--<small>{{ mypost.date | date: "%B %-d, %Y" }}</small>-->
Expand Down
4 changes: 2 additions & 2 deletions _includes/social-sharing.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="post-date">{{ site.data.settings.sharing_button_prompt }}</div>
<div class="sharing-icons">
<a href="https://twitter.com/intent/tweet?text={{ page.title }}&amp;url={{ site.github.url }}{{ page.url }}" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a>
<a href="https://www.facebook.com/sharer/sharer.php?u={{ site.github.url }}{{ page.url }}&amp;title={{ page.title }}" target="_blank"><i class="fa fa-facebook" aria-hidden="true"></i></a>
<a href="https://twitter.com/intent/tweet?text={{ page.title }}&amp;url={{ site.url }}{{ site.baseurl }}{{ page.url }}" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a>
<a href="https://www.facebook.com/sharer/sharer.php?u={{ site.url }}{{ site.baseurl }}{{ page.url }}&amp;title={{ page.title }}" target="_blank"><i class="fa fa-facebook" aria-hidden="true"></i></a>
</div>
2 changes: 1 addition & 1 deletion _layouts/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3>{{ post.date | date: '%Y' }}</h3>
{% endif %}
{% endunless %}
<li itemscope>
<a href="{{ site.github.url }}{{ post.url }}">{{ post.title }}</a>
<a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
<p class="post-date"><span><i class="fa fa-calendar" aria-hidden="true"></i> {{ post.date | date: "%B %-d" }} - <i class="fa fa-clock-o" aria-hidden="true"></i> {% include read-time.html %}</span></p>
</li>
{% endfor %}
Expand Down
8 changes: 4 additions & 4 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
{% for post in paginator.posts %}
<div class="posts-container">
<h1>
<a href="{{ site.github.url }}{{ post.url }}">{{ post.title }}</a>
<a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
</h1>
{% if post.image %}
<div class="thumbnail-container">
<a href="{{ site.github.url }}{{ post.url }}"><img src="{{ site.github.url }}/assets/img/{{ post.image }}"></a>
<a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}"><img src="{{ site.url }}{{ site.baseurl }}/assets/img/{{ post.image }}"></a>
</div>
{% endif %}
<p>
{{ post.content | strip_html | truncate: 350 }} <a href="{{ site.github.url }}{{ post.url }}">Read more</a>
{{ post.content | strip_html | truncate: 350 }} <a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}">Read more</a>
<span class="post-date"><i class="fa fa-calendar" aria-hidden="true"></i> {{ post.date | date_to_string }} - <i class="fa fa-clock-o" aria-hidden="true"></i> {% include read-time.html %}</span>
</p>
</div>
{% endfor %}
<!-- Pagination links -->
<div class="pagination">
{% if paginator.next_page %}
<a class="pagination-button pagination-active next" href="{{ site.github.url }}{{ paginator.next_page_path }}">{{ site.data.settings.pagination.previous_page }}</a>
<a class="pagination-button pagination-active next" href="{{ site.url }}{{ site.baseurl }}{{ paginator.next_page_path }}">{{ site.data.settings.pagination.previous_page }}</a>
{% else %}
<span class="pagination-button">{{ site.data.settings.pagination.previous_page }}</span>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h1>
{{ page.title }}
</h1>
{% if page.image %}
<img src="{{ site.github.url }}/assets/img/{{ page.image }}">
<img src="{{ site.url }}{{ site.baseurl }}/assets/img/{{ page.image }}">
{% endif %}
<article>
{{ content }}
Expand Down
4 changes: 2 additions & 2 deletions _posts/2016-01-01-welcome-to-lagrange.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Lagrange is a minimalist Jekyll theme. The purpose of this theme is to provide a

## Getting Started

[Getting Started]({{ site.github.url }}{% post_url 2015-10-10-getting-started %}): getting started with installing Lagrange, whether you are completely new to using Jekyll, or simply just migrating to a new Jekyll theme.
[Getting Started]({% post_url 2015-10-10-getting-started %}): getting started with installing Lagrange, whether you are completely new to using Jekyll, or simply just migrating to a new Jekyll theme.

## Example Content

[Text and Formatting]({{ site.github.url }}{% post_url 2014-01-01-text-formatting-examples %})
[Text and Formatting]({% post_url 2014-01-01-text-formatting-examples %})

## Questions?

Expand Down
4 changes: 2 additions & 2 deletions menu/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Lagrange is a minimalist Jekyll theme. The purpose of this theme is to provide a

### Getting Started

[Getting Started]({{ site.github.url }}{% post_url 2015-10-10-getting-started %}): getting started with installing Lagrange, whether you are completely new to using Jekyll, or simply just migrating to a new Jekyll theme.
[Getting Started]({% post_url 2015-10-10-getting-started %}): getting started with installing Lagrange, whether you are completely new to using Jekyll, or simply just migrating to a new Jekyll theme.

### Example Content

[Text and Formatting]({{ site.github.url }}{% post_url 2014-01-01-text-formatting-examples %})
[Text and Formatting]({% post_url 2014-01-01-text-formatting-examples %})

### Questions?

Expand Down
4 changes: 2 additions & 2 deletions rss-feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<channel>
<title>{{ site.title | xml_escape }}</title>
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
<link>{{ site.github.url }}</link>
<atom:link href="{{ site.github.url }}/{{ page.path }}" rel="self" type="application/rss+xml" />
<link>{{ site.url }}{{ site.baseurl }}</link>
<atom:link href="{{ site.url }}{{ site.baseurl }}/{{ page.path }}" rel="self" type="application/rss+xml" />
{% for post in site.posts limit:10 %}
<item>
<title>{{ post.title | xml_escape }}</title>
Expand Down