Skip to content

Commit

Permalink
Version from variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
RossBugginsNHS committed Jun 28, 2024
1 parent 09014bf commit d000c05
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ _site
.jekyll-metadata
vendor
node_modules
_config.version.yml
19 changes: 11 additions & 8 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
BASE_URL ?= ""
BASE_URL ?= "/"
VERSION ?= ""
SHELL = /bin/bash

default: install

Expand All @@ -16,15 +18,16 @@ s serve:
build: version
npm run build -- --baseurl $(BASE_URL)

build_existing_version: copyversion
npm run build -- --baseurl $(BASE_URL)

debug: version
npm run debug -- --baseurl $(BASE_URL)

version:
(cd .. && make version)
make copyversion
touch _config.version.yml
if [[ $(VERSION) == "" ]]; then \
(cd .. && make version); \
ver=$$(head -n 1 ../.version 2> /dev/null || echo unknown); \
echo "version: $$ver" > _config.version.yml; \
else \
echo "version: $(VERSION)" > _config.version.yml; \
fi

copyversion:
cp -f ../.version ./_includes/.version
6 changes: 1 addition & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ author: Ross Buggins

## NHS Notify Template Repository Documentation Home Page

{% capture rawContent %}
{% include .version %}
{% endcapture %}

### Version: {{ rawContent }}
### Version: {{ site.version }}
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"private": true,
"engines": {},
"scripts": {
"debug": "JEKYLL_ENV=development BUNDLE_GEMFILE=Gemfile bundle exec jekyll serve --config _config.yml,_config.dev.yml --limit_posts 100 --trace --livereload",
"build": "JEKYLL_ENV=production bundle exec jekyll build --trace"
"debug": "JEKYLL_ENV=development BUNDLE_GEMFILE=Gemfile bundle exec jekyll serve --config _config.yml,_config.dev.yml,_config.version.yml --limit_posts 100 --trace --livereload",
"build": "JEKYLL_ENV=production bundle exec jekyll build --trace --config _config.yml,_config.version.yml"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit d000c05

Please sign in to comment.