From 3043c93d5524a01a19575b0abb6a2a3505cdf919 Mon Sep 17 00:00:00 2001 From: sapetnioc Date: Mon, 4 Nov 2024 18:02:24 +0100 Subject: [PATCH] Added scripts and doc for testing website with Pixi --- .gitignore | 3 +++ README.md | 39 +++++++++++++++++++++++++-------------- neurospin_gaia.sh | 15 +++++++++++++++ pixi.toml | 19 +++++++++++++++++++ 4 files changed, 62 insertions(+), 14 deletions(-) create mode 100644 neurospin_gaia.sh create mode 100644 pixi.toml diff --git a/.gitignore b/.gitignore index 1d64750..d3afcc8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ _site/ .jekyll-metadata .~ Gemfile* +.pixi +pixi.lock + diff --git a/README.md b/README.md index 3b26387..386fa46 100644 --- a/README.md +++ b/README.md @@ -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_.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 diff --git a/neurospin_gaia.sh b/neurospin_gaia.sh new file mode 100644 index 0000000..b37d40a --- /dev/null +++ b/neurospin_gaia.sh @@ -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 diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 0000000..edbde59 --- /dev/null +++ b/pixi.toml @@ -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"] \ No newline at end of file