Skip to content

Commit

Permalink
feat: add bibtex to generated app constants
Browse files Browse the repository at this point in the history
  • Loading branch information
alee committed Oct 6, 2023
1 parent 485f268 commit 998b1af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# backups
*~
# docker generated things
_citation.txt
_citation.*
config.mk
secrets/
docker-compose.yml
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ MAIL_API_KEY_PATH=secrets/mail_api_key
BUILD_CONSTANTS_PATH=app/store/modules/_constants.js
BUILD_ID=$(shell git describe --tags --abbrev=1)
CITATION_TXT_FILE=_citation.txt
CITATION_BIB_FILE=_citation.bib

$(CITATION_TXT_FILE):
docker run --rm -v $(PWD):/app citationcff/cffconvert -f apalike -o $(CITATION_TXT_FILE)
docker run --rm -v $(PWD):/app citationcff/cffconvert -f bibtex -o $(CITATION_BIB_FILE)

.PHONY: $(BUILD_CONSTANTS_PATH)
$(BUILD_CONSTANTS_PATH): app/store/modules/_constants.js.template config.mk $(CITATION_TXT_FILE)
echo 'export const CITATION_TXT = "$(shell cat _citation.txt)";' > $(BUILD_CONSTANTS_PATH)
echo 'export const CITATION_TXT = "$(shell cat ${CITATION_TXT_FILE})";' > $(BUILD_CONSTANTS_PATH)
echo 'export const CITATION_BIB = "$(shell cat ${CITATION_BIB_FILE})";' >> $(BUILD_CONSTANTS_PATH)
envsubst < app/store/modules/_constants.js.template >> $(BUILD_CONSTANTS_PATH)
echo 'export const BUILD_ID = "${BUILD_ID}";' >> $(BUILD_CONSTANTS_PATH)

Expand Down
2 changes: 1 addition & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM node:lts-bullseye
FROM node:lts-bookworm

ENV NODE_OPTIONS="--openssl-legacy-provider"

Expand Down
7 changes: 6 additions & 1 deletion app/components/TermsOfUse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

<h2>Example Citation</h2>
<blockquote class="blockquote">{{ citationText }}</blockquote>
<blockquote class="blockquote">{{ citationBibTex }}</blockquote>

<h2>Contact us</h2>
<p class="text-body-1">
Expand Down Expand Up @@ -66,7 +67,7 @@
<script>
import Vue from "vue";
import { Component } from "nuxt-property-decorator";
import { CITATION_TXT } from "@/store/modules/_constants";
import { CITATION_TXT, CITATION_BIB } from "@/store/modules/_constants";
@Component()
class TermsOfUse extends Vue {
Expand All @@ -82,6 +83,10 @@ class TermsOfUse extends Vue {
return CITATION_TXT;
}
get citationBibTex() {
return CITATION_BIB;
}
get termsAcceptedWarehouseKey() {
return "skope:termsAccepted";
}
Expand Down

0 comments on commit 998b1af

Please sign in to comment.