diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64c81d8840bbaa9ad934eafdf7e6e622cb420df8..d49cd133d4e84df95e714050f52f427b821c4212 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,11 @@ stages: - prepare - deploy + - 🧽 clean -image: docker:stable +image: docker:20.10.20 services: - - docker:dind + - docker:20.10.20-dind variables: DOCKER_HOST: tcp://docker:2376 @@ -22,11 +23,42 @@ pub: pages: stage: deploy - image: monachus/hugo + image: + name: klakegg/hugo:ext-alpine + entrypoint: ["/bin/sh", "-c"] script: - - hugo + - hugo -v artifacts: paths: - public - only: - - master + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + environment: + name: production + url: "https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/${CI_PROJECT_NAME}" + +# Deploy temporary env on MR +pages:preview: + extends: pages + variables: + HUGO_UGLYURLS: "true" + artifacts: + expire_in: 2 week + rules: + - if: $CI_MERGE_REQUEST_IID + environment: + name: preview/${CI_COMMIT_REF_NAME} + url: "https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts/public/index.html" + on_stop: pages:preview:stop + +pages:preview:stop: + stage: 🧽 clean + rules: + - if: $CI_MERGE_REQUEST_IID + when: manual + allow_failure: true + environment: + name: preview/${CI_COMMIT_REF_NAME} + action: stop + script: + - echo "🧽 clean MR environment [preview/${CI_COMMIT_REF_NAME}]" \ No newline at end of file diff --git a/README.md b/README.md index 580790dccc2992d9fc0b80914aa0cddf8aa2dcf5..1dfb77dec1ade8a54af81a96eaaa56a2dafe417b 100644 --- a/README.md +++ b/README.md @@ -3,33 +3,47 @@ Howto ## Render on your personnal computer the site? -* Install Hugo, https://gohugo.io/getting-started/installing -* Clone this project : `git clone --recurse-submodules git@forgemia.inra.fr:eq-record/record-team.git` +* Clone this project : +``` +$ git clone --recurse-submodules git@forgemia.inra.fr:eq-record/record-team.git +``` * Go inside the root folder +``` +$ cd record-team/ +``` +* Convert RECORD.bib into json: + +``` +$ docker run --rm --volume "$(pwd):/data" pandoc/core data/RECORD.bib -t csljson -o data/RECORD.json +``` * Launch the site locally, and you should get some thing like this: ``` -$ cd record-team/ -$ hugo server --disableFastRender +$ docker run --rm -it \ + -v $(pwd):/src \ + -p 1313:1313 \ + klakegg/hugo:ext-alpine \ + server --disableFastRender Start building sites … - - | EN --------------------+----- - Pages | 7 - Paginator pages | 0 - Non-page files | 0 - Static files | 11 - Processed images | 0 - Aliases | 0 - Sitemaps | 1 - Cleaned | 0 +hugo v0.107.0-2221b5b30a285d01220a26a82305906ad3291880+extended linux/amd64 BuildDate=2022-11-24T13:59:45Z VendorInfo=hugoguru + + | FR | EN +-------------------+----+----- + Pages | 12 | 12 + Paginator pages | 0 | 0 + Non-page files | 0 | 0 + Static files | 12 | 12 + Processed images | 0 | 0 + Aliases | 2 | 1 + Sitemaps | 2 | 1 + Cleaned | 0 | 0 Built in 21 ms -Watching for changes in /home/pchabrier/DEVS/record-team/{archetypes,content,data,layouts,static,themes} -Watching for config changes in /home/pchabrier/DEVS/record-team/config.toml -Environment: "development" +Watching for changes in /src/{archetypes,content,data,layouts,static,themes} +Watching for config changes in /src/config.toml +Environment: "DEV" Serving pages from memory -Web Server is available at http://localhost:1313/record-team/ (bind address 127.0.0.1) +Web Server is available at //localhost:1313/ (bind address 0.0.0.0) Press Ctrl+C to stop ``` diff --git a/config.toml b/config.toml index 3334c8929fbb14119e2eb605d4a43b3643998b20..4b509b2d99fbda1873413bacc91b6d09c9d1e6ad 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,8 @@ -baseURL = "https://eq-record.pages.mia.inra.fr/record-team/" languageCode = "en-us" theme = "ezhil" +relativeURLs = true +CanonifyURLs=true + [languages] [languages.fr]