Skip to content

Commit

Permalink
Added scripts and doc for testing website with Pixi
Browse files Browse the repository at this point in the history
  • Loading branch information
sapetnioc committed Nov 4, 2024
1 parent 64a2492 commit 3d03b86
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ _site/
.jekyll-metadata
.~
Gemfile*
.pixi
pixi.lock

39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,39 @@ Please look at the example and use the same keys.

Note: For the research collection, you will have to add a new `research_<CATEGORY>.md` for new categories.

# Local Install
# Test website modification locally

Jekyll:
First install pixi : [https://pixi.sh](https://pixi.sh)

Then install the website design environment with the following command:

```
git clone https://github.com/neurospin/gaia
```
sudo apt install ruby-dev
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
gem install jekyll bundler
cd $MYPROJECT
bundle init
bundle add jekyll webrick
bundle install

Then the web server can be run from the git source directory with the following command:

```
cd gaia
pixi run gaia-website
```

The first execution will take time to install requirements. The website can be seen using the following URL in a browser : [https://localhost:8080](https://localhost:8080).

To get more options on the web server (for instance changing the port number), one can use:

```
cd gaia
pixi shell
bundle exec jekyll serve --livereload --port 8080
```


For Bibtex conversion:

- pip install pybtex
- pybtex-convert biblio.bib biblio.yaml
```
pybtex-convert biblio.bib biblio.yaml
```

# Jekyll

Expand Down
15 changes: 15 additions & 0 deletions neurospin_gaia.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if [ ! -e "$CONDA_PREFIX/share/rubygems/bin/ruby" ]; then
mkdir -p "$CONDA_PREFIX/share/rubygems/bin"
ln -s "$CONDA_PREFIX/bin/ruby" "$CONDA_PREFIX/share/rubygems/bin/ruby"
fi

if [ ! -e "$CONDA_PREFIX/share/rubygems/bin/bundler" ]; then
gem install jekyll bundler csv base64
fi

if [ ! -e "$PIXI_PROJECT_ROOT/Gemfile" ]; then
cd "$PIXI_PROJECT_ROOT"
bundle init
bundle add jekyll webrick
bundle install
fi
19 changes: 19 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[project]
channels = ["conda-forge"]
description = "Neurospin/Baobab/GAIA website"
name = "neurospin_gaia"
platforms = ["linux-64"]
version = "0.1.0"

[tasks]
gaia-website = { cmd="bundle exec jekyll serve --livereload --port 8080"}

[dependencies]
ruby = ">=3.3.3,<4"
gcc = ">=14.1.0,<15"
gxx = ">=14.1.0,<15"
pybtex = ">=0.24.0,<0.25"
gfortran = ">=14.1.0,<15"

[activation]
scripts = ["neurospin_gaia.sh"]

0 comments on commit 3d03b86

Please sign in to comment.