Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
baseurl
Browse files Browse the repository at this point in the history
  • Loading branch information
gemfarmer committed Jan 26, 2017
1 parent 343fa5b commit cdc2209
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 12 deletions.
3 changes: 1 addition & 2 deletions _plugins/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Jekyll
class SearchStoreTag < Liquid::Tag
def initialize(tag, text, tokens)
super
@baseurl = Jekyll.sites[0].config['baseurl']
end

def slugify(str)
Expand All @@ -18,7 +17,7 @@ def create_store(collections)
title: doc.data['title'],
description: doc.data['description'],
tag: doc.data['tag'],
url: "#{@baseurl}#{doc.data['permalink']}",
url: doc.data['permalink'],
internal: true
}
obj[slugify(doc.data['permalink'])] = new_obj
Expand Down
5 changes: 4 additions & 1 deletion js/components/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
var external = item.internal
? ''
: ' target="_blank" ';
var baseurl = item.internal
? window.location.origin
: ''
appendString += '<article class="search-result-list">' +
'<h1><a href="' + item.url + '"' + external + ">" +
'<h1><a href="' + baseurl + item.url + '"' + external + ">" +
item.title +
'</a></h1>' +
'<p>' + item.description + '</p>' +
Expand Down
2 changes: 1 addition & 1 deletion js/lib/company-revenue.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/lib/explore.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/lib/homepage.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/lib/main.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/lib/narrative.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/lib/reconciliation.min.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion js/lib/search.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/lib/search.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/lib/state-pages.min.js.map

Large diffs are not rendered by default.

0 comments on commit cdc2209

Please sign in to comment.