Skip to content

Commit f500751

Browse files
authored
Merge pull request #39 from singularityware/add/circle-preview
adding circle, first will try build
2 parents cd36029 + 83633c7 commit f500751

8 files changed

Lines changed: 107 additions & 5 deletions

File tree

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: ruby
2+
rvm:
3+
- 2.3.1
4+
addons:
5+
artifacts: true
6+
install:
7+
- bundle install
8+
- bundle exec jekyll build
9+
script:
10+
- bundle exec jekyll build --trace
11+
env:
12+
global:
13+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ exclude:
2828
- .idea/
2929
- .gitignore
3030
- README.md
31+
- vendor/
3132

3233
# Optional Feedback Link in Header (disabled)
3334
feedback_subject_line: Singularity Feedback

_includes/head.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<meta charset="utf-8">
22
<meta http-equiv="X-UA-Compatible" content="IE=edge">
33
<meta name="viewport" content="width=device-width, initial-scale=1">
4-
<meta name="description" content="{% if page.summary %}{{ page.summary | strip_html | strip_newlines | truncate: 160 }}{% endif %}">
5-
<meta name="keywords" content="{{page.tags}}{% if page.tags %}, {% endif %} {{page.keywords}}">
4+
5+
{% include metadata.html %}
6+
67
<title>{{ page.title }} | {{ site.site_title }}</title>
78
<link rel="stylesheet" href="{{ "assets/css/syntax.css" }}">
89

_includes/metadata.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<meta name="description" content="{% if page.summary %}{{ page.summary | strip_html | strip_newlines }}{% endif %}">
2+
<meta name="keywords" content="{{page.tags}}{% if page.tags %}, {% endif %} {{page.keywords}}">
3+
{% if page.title %}
4+
<meta name="name" content="{{ image.name }}">
5+
{% endif %}
6+
<meta name="thumbnail" content="http://singularity.lbl.gov/images/logo/logo.svg">
7+
{% if page.targz %}
8+
<meta name="file" content="{{ site.repo }}/archive/{{ page.targz }}">
9+
{% endif %}
10+
{% if page.version %}
11+
<meta name="file" content="{{ site.repo }}/releases/download/{{ page.version }}/singularity-{{ page.version }}.tar.gz">
12+
{% endif %}

_includes/topnav.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
{% if site.feedback_disable == null or site.feedback_disable == false %}
4848
{% include feedback.html %}
4949
{% endif %}
50-
<!--comment out this block if you want to hide search-->
50+
<li><a href="{{ site.baseurl }}/search"><i class="fa fa-search"></i></li>
51+
<!-- jekyll search hidden in favor of google
5152
<li>
52-
<!--start search-->
5353
<div id="search-demo-container">
5454
<input type="text" id="search-input" placeholder="{{site.data.strings.search_placeholder_text}}">
5555
<ul id="results-container"></ul>
@@ -66,7 +66,7 @@
6666
fuzzy: true,
6767
})
6868
</script>
69-
<!--end search-->
69+
end search-->
7070
</li>
7171
</ul>
7272
</div>

circle.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
machine:
2+
ruby:
3+
version: 2.3.1
4+
5+
dependencies:
6+
pre:
7+
- rvm --ruby-version use 2.3.1
8+
- bundle install
9+
- bundle exec jekyll build
10+
11+
general:
12+
artifacts:
13+
- "./_site"
14+
15+
test:
16+
post:
17+
- bundle exec jekyll build
18+
- python circle_urls.py ./_site

circle_urls.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
3+
'''
4+
circle_urls.py will rename all url files to not have extension .html
5+
'''
6+
import sys
7+
import os
8+
from glob import glob
9+
10+
site_dir = os.path.abspath(sys.argv[1])
11+
print("Using site directory %s" %(site_dir))
12+
13+
files = glob("%s/*.html" %(site_dir))
14+
15+
# For each file, we need to replace all links to have correct .html extension
16+
search_names = [os.path.basename(f).replace('.html','') for f in files]
17+
for html_file in files:
18+
with open(html_file,'r') as filey:
19+
content = filey.read()
20+
for search_name in search_names:
21+
content = content.replace('%s"' %(search_name),'%s.html"' %(search_name))
22+
content = content.replace('/images/logo/logo.svg','http://singularity.lbl.gov/images/logo/logo.svg')
23+
with open(html_file,'w') as filey:
24+
filey.write(content)

pages/info/search.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Search Singularity
3+
sidebar: main_sidebar
4+
permalink: search
5+
toc: false
6+
---
7+
8+
<style>
9+
.cse .gsc-search-button input.gsc-search-button-v2,
10+
input.gsc-search-button-v2 {
11+
height: 26px !important;
12+
margin-top: 0 !important;
13+
min-width: 13px !important;
14+
padding: 5px 26px !important;
15+
width: 68px !important;
16+
}
17+
</style>
18+
19+
<script>
20+
(function() {
21+
var cx = '010503388974132107851:rvx0hek_ybc';
22+
var gcse = document.createElement('script');
23+
gcse.type = 'text/javascript';
24+
gcse.async = true;
25+
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
26+
var s = document.getElementsByTagName('script')[0];
27+
s.parentNode.insertBefore(gcse, s);
28+
})();
29+
</script>
30+
31+
<gcse:search></gcse:search>
32+
33+
{% include links.html %}

0 commit comments

Comments
 (0)