Skip to content

Commit 16adb8c

Browse files
author
Ben Cipollini
committed
RF: make consistent use of baseurl, avoid replace '//','/'
1 parent 32bc534 commit 16adb8c

11 files changed

+30
-33
lines changed

Diff for: _config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author:
88
url: "nipy.github.io"
99

1010
# Build settings
11-
baseurl: "/" # this must be line 11; see circle_urls.sh
11+
baseurl: "" # this must be line 11; see circle_urls.sh
1212
markdown: kramdown
1313
source: .
1414
destination: ./_site # this must be line 14; see circle_urls.sh

Diff for: _data/contribute.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
questions:
66
- tag: "add-a-package"
77
question: "How do I add a package?"
8-
answer: "<h3>Infrastructure and workflow</h3><p>Let's first look at the infrastructure and workflow of the site</p><p><ul class='list-group'><li class='list-group-item'><strong>Github</strong>:The site is a repo under the nipy organization on<a href='nipy.github.com' target='_blank'> github</a>.This means that contribution to it goes by way of forking the repo and doing a pull request (PR).</li><li class='list-group-item'><strong>Github pages</strong>: We also use hosting on github pages, which only means that the site lives on a branch called gh-pages that gets rendered at nipy.github.io.</li><li class='list-group-item'><strong>CI</strong>: We use continuous integration to preview all PRs by way of viewing <a href='https://circle-artifacts.com/gh/vsoch/nipy-jekyll/63/artifacts/0/home/ubuntu/nipy-jekyll/_site/index.html' target='_blank'>artifacts</a>.</li></ul></p><h3>Your Workflow</h3><p>You should do the following:</p><ul><li>Fork the nipy jekyll repo</li><li>Make your changes</li><li>Submit a PR</li><li>We will review the PR, and push to master and ghpages branches.</li></ul></p><h3>Details</h3><ol><li>Add your package info to the data file, in the same format. This will have it rendered automatically in the navigation, and added to the animated brain on all pages.</li><li>Add a base page for your package in the base directory of the site repo. It should be named [packagetag].html where [packagetag] corresponds with the tag variable in the data file. We have a page template for packages, and the easiest thing to do is copy another package's page to start.</li><li>Static site content can be put in the js,css,img folders in the base directory. Any static content can be linked to like '{{ site.baseurl }}/img/myimage.png'. Keep it organized.</li><li>To contribute an svg image, put it in the '_includes/svg' folder and include like {% include svg/mysvg.svg %}</li><li>Subpages should be contributed as posts to <a href='http://neuroimaging.tumblr.com'>blog content</a>.</li></ol><p>"
8+
answer: "<h3>Infrastructure and workflow</h3><p>Let's first look at the infrastructure and workflow of the site</p><p><ul class='list-group'><li class='list-group-item'><strong>Github</strong>:The site is a repo under the nipy organization on<a href='nipy.github.com' target='_blank'> github</a>.This means that contribution to it goes by way of forking the repo and doing a pull request (PR).</li><li class='list-group-item'><strong>Github pages</strong>: We also use hosting on github pages, which only means that the site lives on a branch called gh-pages that gets rendered at nipy.github.io.</li><li class='list-group-item'><strong>CI</strong>: We use continuous integration to preview all PRs by way of viewing <a href='https://circle-artifacts.com/gh/vsoch/nipy-jekyll/63/artifacts/0/home/ubuntu/nipy-jekyll/_site/index.html' target='_blank'>artifacts</a>.</li></ul></p><h3>Your Workflow</h3><p>You should do the following:</p><ul><li>Fork the nipy jekyll repo</li><li>Make your changes</li><li>Submit a PR</li><li>We will review the PR, and push to master and ghpages branches.</li></ul></p><h3>Details</h3><ol><li>Add your package info to the data file, in the same format. This will have it rendered automatically in the navigation, and added to the animated brain on all pages.</li><li>Add a base page for your package in the base directory of the site repo. It should be named [packagetag].html where [packagetag] corresponds with the tag variable in the data file. We have a page template for packages, and the easiest thing to do is copy another package's page to start.</li><li>Static site content can be put in the js,css,img folders in the base directory. Any static content can be linked to like '{{ '/img/myimage.png' | prepend: site.baseurl }}'. Keep it organized.</li><li>To contribute an svg image, put it in the '_includes/svg' folder and include like {% include svg/mysvg.svg %}</li><li>Subpages should be contributed as posts to <a href='http://neuroimaging.tumblr.com'>blog content</a>.</li></ol><p>"
99
- tag: "write-a-post"
1010
question: "How do I write a post?"
1111
answer: "<h3>Quick and Easy</h3><p>The fastest way to contribute is to <a href='http://neuroimaging.tumblr.com/submit'> submit </a> an idea, link, or video right away, or <a href='http://neuroimaging.tumblr.com/ask'>ask us a question</a>. Your submission will be reviewed and immediately available on the site and for social media integration.</p><h3>Contribute Regularly</h3><p>If you like writing tutorials, or regularly write about your research, we encourage you to <a href='https://www.tumblr.com/docs/en/posting' target='_blank'> read more about posting</a> and <a href='mailto:[email protected]'>contact us</a> with your email or tumblr username, and you will be added as a contributor to the blog. As an official contributor you can write posts in several formats, receive notifications, integrate apps, and contribute via email. Contributors are subject to the same standards of conduct as non-affiliated posters.</p><h3>Package Specific</h3><p>To contribute content, or a 'blogroll' for your package, we encourage you to become a tumblr contributor, tag your posts with your package, and <a href='https://www.tumblr.com/docs/en/using_tags#specific' target='_blank'>link to the tagged posts</a> from your package page.</p>"

Diff for: _includes/head.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
<meta name="generator" content="Jekyll">
66

77
<title>{%if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
8-
8+
99
<!-- JS -->
1010
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
1111
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
1212
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
13-
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
14-
<script src="{{ "js/tipsy.js" | prepend: site.baseurl }}"></script>
15-
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
14+
<script src="{{ '/js/tipsy.js' | prepend: site.baseurl }}"></script>
15+
1616

1717
<!-- CSS & fonts -->
18-
<link rel="stylesheet" href="{{ "css/bootstrap.min.css" | prepend: site.baseurl }}">
19-
<link rel="stylesheet" href="{{ "css/main.css" | prepend: site.baseurl }}">
18+
<link rel="stylesheet" href="{{ '/css/bootstrap.min.css' | prepend: site.baseurl }}">
19+
<link rel="stylesheet" href="{{ '/css/main.css' | prepend: site.baseurl }}">
2020
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
2121
<link href='https://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
2222

Diff for: _includes/link.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<a href="http://neuroimaging.tumblr.com">Blog</a>
2-
<a href="{{ site.baseurl }}help.html">Help</a>
3-
<a href="{{ site.baseurl }}conduct.html">Conduct</a>
4-
<a href="{{ site.baseurl }}contribute.html">Contribute</a>
2+
<a href="{{ '/help.html' | prepend: site.baseurl }}">Help</a>
3+
<a href="{{ '/conduct.html' | prepend: site.baseurl }}">Conduct</a>
4+
<a href="{{ '/contribute.html' | prepend: site.baseurl }}">Contribute</a>
55

Diff for: _includes/menu.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<nav {% if site.reverse == true %}id="nav-left"{% else %}id="nav"{% endif %}>
22

33
<div id="nav-list">
4-
<a href="{{ site.baseurl }}">Home</a>
4+
<a href="{{ '/' | prepend: site.baseurl }}">Home</a>
55

66
<!-- Nav pages -->
77
<a href="#projects" class="list-group-item list-group-item" data-toggle="collapse">Projects <i class="fa fa-caret-down"></i></a>
@@ -11,7 +11,7 @@
1111
<div class="collapse" id="{{ category.tag }}" style="color:lime">
1212
{% for package in site.packages %}
1313
{% if package.category == category.tag %}
14-
<a href="{{ site.baseurl }}packages/{{ package.tag }}.html" style="border-radius:0px; color:lime;" id="{{ package.tag }}" class="list-group-item list-project">{{ package.name }}</a>
14+
<a href="{{ package.url | prepend: site.baseurl }}" style="border-radius:0px; color:lime;" id="{{ package.tag }}" class="list-group-item list-project">{{ package.name }}</a>
1515
{% endif %}
1616
{% endfor %}
1717
</div>

Diff for: _includes/script.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<script src="{{ "js/main.js" | prepend: site.baseurl }}"></script>
1+
<script src="{{ '/js/main.js' | prepend: site.baseurl }}"></script>

Diff for: _includes/snakey.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div id="snakey"></div>
66
</div>
77
<div class="col-md-10">
8-
<img src="{{ site.baseurl }}img/nipy.svg" width="150px">
8+
<img src="{{ '/img/nipy.svg' | prepend: site.baseurl }}" width="150px">
99
</div>
1010
</div>
1111
</div>
@@ -38,7 +38,7 @@
3838
radius: "10",
3939
color: colors[{{ category.count }}],
4040
tag: "{{ package.tag }}",
41-
url: "{{ package.url | prepend: site.baseurl | replace:'//','/'}}"
41+
url: "{{ package.url | prepend: site.baseurl }}"
4242
},
4343
{% endif %}
4444
{% endfor %}

Diff for: _layouts/default.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,44 @@
88

99
<!-- Navigation -->
1010
{% include menu.html %}
11-
11+
1212
<!-- Icon menu -->
1313
<a href="#" {% if site.reverse == true %}id="nav-menu-left"{% else %}id="nav-menu"{% endif %}>
1414
<div id="menu"></div>
1515
</a>
1616

1717
<!-- Header -->
1818
{% include header.html %}
19-
19+
2020
<!-- Main content -->
2121
<div id="container">
2222
<main>
2323
{{ content }}
2424
</main>
25-
25+
2626
<!-- Pagination links -->
2727
{% if paginator.total_pages > 1 %}
2828
<div class="pagination">
2929
{% if paginator.previous_page == 1 %}
30-
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">&laquo;</a>
30+
<a href="{{ '/' | prepend: site.baseurl }}" class="page-item">&laquo;</a>
3131
{% elsif paginator.previous_page%}
32-
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">&laquo;</a>
32+
<a href="{{ paginator.previous_page_path | prepend: site.baseurl }}" class="page-item">&laquo;</a>
3333
{% else %}
3434
<span class="page-item">&laquo;</span>
3535
{% endif %}
36-
36+
3737
{% for page in (1..paginator.total_pages) %}
3838
{% if page == paginator.page %}
3939
<span class="page-item">{{ page }}</span>
4040
{% elsif page == 1 %}
41-
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">{{ page }}</a>
41+
<a href="{{ '/' | prepend: site.baseurl }}" class="page-item">{{ page }}</a>
4242
{% else %}
43-
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}" class="page-item">{{ page }}</a>
43+
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: ':num', page }}" class="page-item">{{ page }}</a>
4444
{% endif %}
4545
{% endfor %}
46-
46+
4747
{% if paginator.next_page %}
48-
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">&raquo;</a>
48+
<a href="{{ paginator.next_page_path | prepend: site.baseurl }}" class="page-item">&raquo;</a>
4949
{% else %}
5050
<span class="page-item">&raquo;</span>
5151
{% endif %}

Diff for: circle_urls.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BASEURL=https://circle-artifacts.com/gh/nipy/nipy.github.com/$CIRCLE_BUILD_NUM/artifacts/0/home/ubuntu/nipy.github.com/_site/
1+
BASEURL=https://circle-artifacts.com/gh/nipy/nipy.github.com/$CIRCLE_BUILD_NUM/artifacts/0/home/ubuntu/nipy.github.com/_site
22
sed -i "14 s,.*,destination: ./_site,g" "_config.yml"
33
sed -i "11 s,.*,baseurl: $BASEURL,g" "_config.yml"

Diff for: contribute.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ <h4 class="panel-title">
7373
{% endfor %}
7474

7575
<p>Thanks for stopping by!</p>
76-
<img src="{{ site.baseurl }}img/reggie.png"/>
76+
<img src="{{ '/img/reggie.png | prepend: site.baseurl }}"/>
7777

7878
</div>

Diff for: index.html

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
---
44

55
<h2 style="margin-top:20px; margin-bottom:20px">nipy.github.io</h2>
6-
<a href="{{ site.baseurl }}">
7-
<img src="{{ site.baseurl }}" >
8-
</a>
96

10-
<p>Welcome to NIPY. The NIPY community is a community of practice devoted to the use of the Python programming language in the analysis of neuroimaging data. You can find us on <a href="https://github.com/nipy" target="_blank">github</a>, as well as <a href="http://neuroimaging.tumblr.com" target="_blank">social media</a>. We welcome <a href="{{ site.baseurl }}contribute.html">contributions</a> and welcome you to read about our <a href="{{ site.baseurl }}conduct.html">standards of conduct</a>, or <a href="{{ site.baseurl }}help.html">ask for help.</a> We develop the following projects:</p>
7+
<p>Welcome to NIPY. The NIPY community is a community of practice devoted to the use of the Python programming language in the analysis of neuroimaging data. You can find us on <a href="https://github.com/nipy" target="_blank">github</a>, as well as <a href="http://neuroimaging.tumblr.com" target="_blank">social media</a>. We welcome <a href="{{ '/contribute.html' | prepend: site.baseurl">contributions</a> and welcome you to read about our <a href="{{ '/conduct.html' | prepend: site.baseurl }}">standards of conduct</a>, or <a href="{{ '/help.html' | prepend: site.baseurl }}">ask for help.</a> We develop the following projects:</p>
118

129
<div class="panel-group" id="accordion">
1310
{% for category in site.data.package-categories %}
@@ -24,7 +21,7 @@ <h4 class="panel-title">
2421
<div id="pr{{ package.tag }}" class="panel-collapse collapse in">
2522
<div class="panel-body">
2623
<p>{{ package.description }}</p>
27-
<a href="{{ package.url | prepend: site.baseurl | replace:'//','/'}}">
24+
<a href="{{ package.url | prepend: site.baseurl }}">
2825
<span style="float:right">learn more</span>
2926
</a>
3027
</div>

0 commit comments

Comments
 (0)