Skip to content

Commit 07b3668

Browse files
authored
Merge pull request #334 from ExaWorks/revamp_web_infrastructure
Revamp web infrastructure
2 parents 97f4e6c + 70d3fd4 commit 07b3668

35 files changed

+523
-2932
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ docs:
4646
.PHONY: web-docs
4747
web-docs:
4848
rm -rf docs/.generated
49-
sphinx-build -W -b html -D html_theme='cloud' docs docs/.web-build/
49+
sphinx-build -W -b html -D html_theme='cloud' -D templates_path='_templates' docs docs/.web-build/
5050

5151
.PHONY: style
5252
style:

README-dev.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,26 @@ automatically:
4545
```
4646

4747
Make sure that `build.sh` is called from the main directory. The output will
48-
be in `web-build`. You are likely going to need to load it through a web
49-
server. A simple way to do so is:
48+
be in `web-build`.
49+
50+
3. Render the web site and themed documentation, which can be done using Jekyll.
51+
To install Jekyll, follow these
52+
[instructions](https://jekyllrb.com/docs/installation/). Then run
5053

5154
```
52-
cd web-build
53-
python -m http.server <port>
55+
web/serve.sh
5456
```
5557

56-
where `<port>` is a port number to start the HTTP server on.
58+
which will output something like this:
59+
```
60+
...
61+
Server address: http://127.0.0.1:4000/psij-python/
62+
Server running... press ctrl-c to stop.
63+
```
5764
58-
When developing the web site, a convenient script is `web/watch.sh`, which can
59-
monitor the source directories and re-build when files are modified. This
60-
requires `inotify` which may or may not be available on your platform.
65+
Pointing your web browser to the URL printed by Jekyll will show the PSI/J
66+
web site. The themed documentation will be found under the "Documentation"
67+
tab.
6168
6269
6370
### Release process

docs/_templates/layout.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{%- extends "cloud/layout.html" -%}
2+
3+
{# We are not processing the output of these pages through Jekyll, so
4+
we need to set the variables referenced in the includes. #}
5+
{% set site = {"baseurl": "/psij-python"} %}
6+
7+
{% block scripts %}
8+
{% include "../../web/_includes/head.html" %}
9+
10+
{{ super() }}
11+
{% endblock %}
12+
13+
{% block header %}
14+
<v-app id="psij-app">
15+
{% include "../../web/_includes/menu.html" %}
16+
{{ super() }}
17+
{% endblock %}
18+
19+
{% block footer %}
20+
{{ super() }}
21+
22+
{% include "../../web/_includes/footer.html" %}
23+
</v-app>
24+
25+
{# Same as above #}
26+
{% set page = {"tab": 2} %}
27+
{% include "../../web/_includes/vueinit.html" %}
28+
29+
30+
{% endblock %}
31+
32+
33+
{% block sidebartoggle %}
34+
{% endblock %}

docs/_templates/searchbox.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{#
2+
searchbox.html
3+
~~~~~~~~~~~~~~~~~~~~
4+
5+
Replaces basic/searchbox.html because vue.js does not like <script> without the type attribute
6+
#}
7+
{%- if pagename != "search" and builder != "singlehtml" %}
8+
<div id="searchbox" style="display: none" role="search">
9+
<h3 id="searchlabel">{{ _('Quick search') }}</h3>
10+
<div class="searchformwrapper">
11+
<form class="search" action="{{ pathto('search') }}" method="get">
12+
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
13+
<input type="submit" value="{{ _('Go') }}" />
14+
</form>
15+
</div>
16+
</div>
17+
<script type="application/javascript">$('#searchbox').show(0);</script>
18+
{%- endif %}

web/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
_site
2+
.sass-cache
3+
.jekyll-cache
4+
.jekyll-metadata
5+
vendor

web/.nojekyll

Whitespace-only changes.

web/404.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
permalink: /404.html
3+
layout: default
4+
---
5+
6+
<div class="container">
7+
<h1>404</h1>
8+
9+
<p><strong>Page not found :(</strong></p>
10+
<p>The requested page could not be found.</p>
11+
</div>

web/Gemfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
source "https://rubygems.org"
2+
# Hello! This is where you manage which Jekyll version is used to run.
3+
# When you want to use a different version, change it below, save the
4+
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
5+
#
6+
# bundle exec jekyll serve
7+
#
8+
# This will help ensure the proper Jekyll version is running.
9+
# Happy Jekylling!
10+
gem "jekyll", "~> 4.3.1"
11+
# This is the default theme for new Jekyll sites. You may change this to anything you like.
12+
gem "minima", "~> 2.5"
13+
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
14+
# uncomment the line below. To upgrade, run `bundle update github-pages`.
15+
# gem "github-pages", group: :jekyll_plugins
16+
# If you have any plugins, put them here!
17+
group :jekyll_plugins do
18+
gem "jekyll-feed", "~> 0.12"
19+
end
20+
21+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
22+
# and associated library.
23+
platforms :mingw, :x64_mingw, :mswin, :jruby do
24+
gem "tzinfo", ">= 1", "< 3"
25+
gem "tzinfo-data"
26+
end
27+
28+
# Performance-booster for watching directories on Windows
29+
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
30+
31+
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
32+
# do not have a Java counterpart.
33+
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

web/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
PSI/J Web Site
2+
==============
3+
4+
The web site uses Jekyll, which is a Ruby tool for static page
5+
templating/generation. It is the tool used by Github Pages, so
6+
it is readily deployable there *before* running Jekyll.
7+
8+
The web site also builds the documentation with a custom theme
9+
that allows the Sphinx output to be directly integrated into the
10+
main web site.
11+
12+
Building
13+
========
14+
15+
All operations are to be done from the *root directory* of the
16+
PSI/J repository.
17+
18+
1. Install the packages required to build the documentation
19+
(this step is only needed once):
20+
21+
```bash
22+
$ sudo pip install -r requirements-docs.txt
23+
```
24+
25+
2. Install Jekyll (see [Jekyll Installation](https://jekyllrb.com/docs/installation/) - also a one-time operation).
26+
27+
3. Run the build script, which will build the documentation, process
28+
files in the `web` directory, and generate the output in `web-build`:
29+
30+
```bash
31+
$ web/build.sh
32+
```
33+
4. Run the Jekyll server with the script provided:
34+
35+
```bash
36+
$ web/serve.sh
37+
```
38+
39+
You should then see something like:
40+
```
41+
...
42+
Server address: http://127.0.0.1:4000/psij-python/
43+
Server running... press ctrl-c to stop.
44+
```
45+
46+
You can then point your browser to `http://127.0.0.1:4000/psij-python` to
47+
see the rendered web site.

web/_config.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Welcome to Jekyll!
2+
#
3+
# This config file is meant for settings that affect your whole blog, values
4+
# which you are expected to set up once and rarely edit after that. If you find
5+
# yourself editing this file very often, consider using Jekyll's data files
6+
# feature for the data you need to update frequently.
7+
#
8+
# For technical reasons, this file is *NOT* reloaded automatically when you use
9+
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
10+
#
11+
# If you need help with YAML syntax, here are some quick references for you:
12+
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
13+
# https://learnxinyminutes.com/docs/yaml/
14+
#
15+
# Site settings
16+
# These are used to personalize your new site. If you look in the HTML files,
17+
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
18+
# You can create any custom variable you would like, and they will be accessible
19+
# in the templates via {{ site.myvariable }}.
20+
21+
title: "PSI/J - Python"
22+
23+
description: >- # this means to ignore newlines until "baseurl:"
24+
Portable Submission Interface for Jobs
25+
A Python abstraction layer over cluster schedulers
26+
baseurl: "/psij-python" # the subpath of your site, e.g. /blog
27+
url: "" # the base hostname & protocol for your site, e.g. http://example.com
28+
twitter_username: jekyllrb
29+
github_username: jekyll
30+
31+
# Build settings
32+
theme: minima
33+
plugins:
34+
- jekyll-feed
35+
36+
# Exclude from processing.
37+
# The following items will not be processed, by default.
38+
# Any item listed under the `exclude:` key here will be automatically added to
39+
# the internal "default list".
40+
#
41+
# Excluded items can be processed by explicitly listing the directories or
42+
# their entries' file path in the `include:` list.
43+
#
44+
# exclude:
45+
# - .sass-cache/
46+
# - .jekyll-cache/
47+
# - gemfiles/
48+
# - Gemfile
49+
# - Gemfile.lock
50+
# - node_modules/
51+
# - vendor/bundle/
52+
# - vendor/cache/
53+
# - vendor/gems/
54+
# - vendor/ruby/
55+
56+
include:
57+
- "**"

0 commit comments

Comments
 (0)