-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
145 changed files
with
7,706 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
--- | ||
title: README | ||
|
||
--- | ||
= neicweb = | ||
|
||
NeIC Static Website | ||
|
||
Adapted by Joel Hedlund (NeIC, NSC) based a framework built by Peter Larsson (NSC). | ||
|
||
== How to create pages == | ||
|
||
=== Creating the file === | ||
First decide if you want to make a news post or a normal page. | ||
|
||
For normal pages: make a directory and put an index.wiki* file in it, like so: | ||
|
||
/about/areas/bms/af/index.wiki. | ||
: * ''Expert option:'' Making .html files instead allows you to opt out of pandoc and write raw Jekyll/HTML5 instead. Please refrain from this. Be considerate to the people who will be stuck maintining whatever ghastly magic you produce. This is about keeping it simple. | ||
For news posts: put a YYYY-MM-DD-some-name.wiki* file in the /_posts/ directory, like so: | ||
|
||
/_posts/2014-08-14-nt1-seeking-sysadm.wiki | ||
: * ''Note:'' The news post naming scheme is not required, but a convenience. | ||
=== Edit the page === | ||
Pages should be written using mediawiki markup, and must start with a YAML front matter data block, like so: | ||
|
||
--- | ||
title: BMS advisory forum | ||
--- | ||
: * ''Note:'' If you do not add a data block then Jekyll will not process the file. Jekyll will instead include it as-is, which is probably not what you want. | ||
|
||
==== Variables ==== | ||
Some variable names are used by all page layouts, and some layouts take additional variables. The currently used variables are: | ||
* Used by all page layouts: | ||
** '''title''' ''Required'' Short title, used for link text. | ||
** '''layout''' ''Optional'' Select page layout: menu or news. menu is default. News post pages should have the news layout. All others should have the menu layout. | ||
* menu layout (=all normal pages): | ||
** '''description''' ''Optional'' Very short descrition of page, used for link tooltips. | ||
** '''menu''' ''Optional'' A number giving a rough indication whether this page should show up in the beginning or towards the end of a menu list. Lower numbers go first. Default is 100. | ||
* news layout (only news posts): | ||
** '''date''' ''Required'' An ISO date, like 2014-09-10. | ||
** '''summary''' ''Optional'' A short blurb describing the news post. Used on lists of news posts. | ||
** '''image''' ''Optional'' Url to a small(ish) image. Used on lists of news posts. If given, recommendation is to put the image in /assets/img/posts/SAME-NAME.jpg. Do not put large files here (see "Large files" below). | ||
==== Add media to your page ==== | ||
Upload your media files to the server, and display them using e.g: | ||
|
||
<nowiki>[[File:small.png|]]</nowiki> | ||
<nowiki>[[File:/media/about/huge.png|]]</nowiki> | ||
==== Large media files ==== | ||
'''Do not put large files in the repository''' as doing so will bloat the repo forever. Version control will ensure it stays in there even if you "delete" it later. | ||
|
||
Use ssh to upload large files into the /media directory, e.g: | ||
|
||
/media/SAME/PATH/AS/YOUR/PAGE/bloat.ppt | ||
/media/posts/SAME-NAME-AS-POST-img-name.jpeg | ||
==== Small media files ==== | ||
|
||
Put small one-off files in the same directory as your page file. If it's something that will see reuse, like a small logo file, consider putting it in | ||
|
||
/assets/img/SENSIBLE/PATH/logo.png | ||
== How to run your own copy of this website using Jekyll == | ||
|
||
Clone the neicweb repository, and cd into it: | ||
|
||
git clone [email protected]:yohell/neicweb.git | ||
cd neicweb | ||
We use the new "rbenv": | ||
|
||
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | ||
Add to the .bash_profile: | ||
|
||
export PATH="$HOME/.rbenv/bin:$PATH" | ||
eval "$(rbenv init -)" | ||
Install the ruby-build plugin: | ||
|
||
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | ||
Run eval "$(rbenv init -)" again. | ||
|
||
Check that it works by running: | ||
|
||
rbenv install --list | ||
Install the same version of Ruby as on the webserver (2.0.0p598 at the time, but please check) | ||
|
||
rbenv install 2.0.0p598 | ||
Building ruby may require you to install additional build packages, for example: | ||
|
||
yum groupinstall "Development Tools" | ||
yum install autoconf byacc | ||
Change Ruby version | ||
|
||
rbenv global 2.0.0p598 | ||
Install same version Jekyll as on the webserver | ||
|
||
gem update | ||
gem install jekyll -v 2.5.3 | ||
We need Pandoc and pandoc-ruby to build the site. | ||
|
||
yum install pandoc | ||
gem install pandoc-ruby --no-rdoc --no-ri | ||
And RedCloth | ||
|
||
gem install RedCloth --no-rdoc --no-ri | ||
The commands to build the site are: | ||
|
||
jekyll build | ||
jekyll serve --watch | ||
The latter command will launch the web server locally on port 4000, and rebuild the site if any of the files are modified. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'rbconfig' | ||
|
||
LANG = "en_EN.UTF-8" | ||
|
||
if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ | ||
SET = "set" | ||
else | ||
SET = "export" | ||
end | ||
|
||
task :build do | ||
system "#{SET} LANG=#{LANG} && jekyll build" | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Nordic e-infrastructure collaboration | ||
highlighter: pygments | ||
|
||
markdown_ext: wiki | ||
markdown: pandoc | ||
pandoc: | ||
format: html5 | ||
extensions: | ||
from: mediawiki | ||
|
||
defaults: | ||
- | ||
scope: | ||
path: "" | ||
type: "pages" | ||
values: | ||
layout: menu | ||
menu: 100 | ||
- | ||
scope: | ||
path: "" | ||
type: "posts" | ||
values: | ||
layout: news | ||
|
||
paginate: 5 | ||
paginate_path: "/news/page:num/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<address class="address">NeIC <br/>c/o NordForsk<br/>Stensberggata 25<br/>NO-0170 Oslo</address> | ||
<dl> | ||
<dt>Tlf:</dt> | ||
<dd>+47 476 14 400</dd> | ||
<dt>E-post:</dt> | ||
<dd> | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
</dd> | ||
</dl> | ||
<div class="logo-holder"> | ||
<strong class="logo"><a href="/" title="NeIC"></a></strong> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<a href="/#" class="opener">Menu</a> | ||
<nav class="slide js-slide-hidden"> | ||
<ul id="nav"> | ||
{% generate_top_menu %} | ||
</ul> | ||
</nav> | ||
<div class="panel"> | ||
<div class="holder"> | ||
<strong class="logo-neic"><a href="/" title="NeIC">neic Nordic e-Infrastructure Collaboration</a></strong> | ||
<strong class="logo"><a href="/" title="NeIC">norden NordForsk</a></strong> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<a href="/#" class="opener">Menu</a> | ||
<nav class="slide js-slide-hidden"> | ||
<ul id="nav"> | ||
<li id="portaltab-index_html" {% if page.url == '/index.html' %} class="selected" {% else %} class="plain" {% endif %}><a href="/" title="">Home</a></li> | ||
{% assign tmp = page.url|split:"/" %} | ||
{% assign current_section = tmp[1] %} | ||
{% for p in site.pages %} | ||
{% assign parts=p.url|split:"/" %} | ||
{% assign length=parts|size %} | ||
{% if parts.last == 'index.html' and length == 3 %} | ||
{% unless p.hidden %} | ||
<li id="portaltab-{{ parts[1] }}" {% if parts[1] == current_section %} class="selected" {% else %} class="plain" {% endif %}><a href="{{ p.url|remove:'/index.html' }}" title="{{ p.description }}">{{ p.title }}</a></li> | ||
{% endunless %} | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</nav> | ||
<div class="panel"> | ||
<div class="holder"> | ||
<strong class="logo-neic"><a href="/" title="NeIC">neic Nordic e-Infrastructure Collaboration</a></strong> | ||
<strong class="logo"><a href="/" title="NeIC">norden NordForsk</a></strong> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!-- Pagination links --> | ||
{{ paginator.total_posts }} news articles in {{ paginator.total_pages }} pages, {{ paginator.per_page }} articles per page. | ||
<div class="pagination"> | ||
Page {{ paginator.page }} of {{ paginator.total_pages }} | ||
| ||
<a href="/news/">First</a> | ||
| ||
{% if paginator.previous_page %} | ||
<a href="{{ paginator.previous_page_path }}" class="previous"><</a> | ||
{% else %} | ||
<span class="previous"><</span> | ||
{% endif %} | ||
| ||
<select onchange="location = this.options[this.selectedIndex].value;"> | ||
<option value="/news/" {% if paginator.page == 1 %}selected{% endif %}>1</option> | ||
{% for i in (2..paginator.total_pages) %} | ||
<option value="/news/page{{ i }}" {% if i == paginator.page %}selected{% endif %}>{{ i }}</option> | ||
{% endfor %} | ||
</select> | ||
| ||
{% if paginator.next_page %} | ||
<a href="{{ paginator.next_page_path }}" class="next">></a> | ||
{% else %} | ||
<span class="next ">></span> | ||
{% endif %} | ||
| ||
{% if paginator.total_pages > 1 %} | ||
<a href="/news/page{{ paginator.total_pages }}" class="next">Last</a> | ||
{% else %} | ||
<a href="/news/" class="next">Last</a> | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<title>{{ page.title }}</title> | ||
<meta name="viewport" content="width=device-width"> | ||
|
||
<!-- syntax highlighting CSS --> | ||
<link rel="stylesheet" href="/css/syntax.css"> | ||
|
||
<!-- Custom CSS --> | ||
<link rel="stylesheet" href="/css/main.css"> | ||
|
||
</head> | ||
<body> | ||
|
||
<div class="container"> | ||
<div class="site"> | ||
<div class="header"> | ||
<h1 class="title"><a href="/">{{ site.name }}</a></h1> | ||
<a class="extra" href="/">home</a> | ||
<h2>Main navigation</h2> | ||
{% generate_navigation %} | ||
</div> | ||
|
||
{{ content }} | ||
|
||
<div class="footer"> | ||
<div class="contact"> | ||
<p> | ||
Your Name<br /> | ||
What You Are<br /> | ||
[email protected] | ||
</p> | ||
</div> | ||
<div class="contact"> | ||
<p> | ||
<a href="https://github.com/yourusername/">github.com/yourusername</a><br /> | ||
<a href="http://twitter.com/yourusername/">twitter.com/yourusername</a><br /> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> <!-- /container --> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.