Skip to content

Commit

Permalink
feat: add imprint
Browse files Browse the repository at this point in the history
  • Loading branch information
felixevers committed Dec 18, 2024
1 parent 765fa2c commit fd7424c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on: [push, pull_request]
env:
OUTPUT_DIR: "output"
MAIN_TEX_FOLDER: "src"
IMPRINT_URL: "https://cdn.helpwave.de/imprint.json"
DEPENDENCIES: |
head.tex
version.tex
imprint.tex
logo.svg
jobs:
Expand Down Expand Up @@ -117,6 +119,21 @@ jobs:
run: |
sed -i "s/ffffff/${{ steps.get_commit_hash.outputs.commit_hash }}/" version.tex
- name: Download JSON file
run: |
curl -o imprint.json ${{ env.IMPRINT_URL }}
- name: Replace placeholders in LaTeX file
run: |
FILE_TO_UPDATE="imprint.tex"
for key in $(jq -r 'keys[]' imprint.json); do
value=$(jq -r --arg key "$key" '.[$key]' imprint.json)
placeholder=$(echo $key | tr '.' '_')
sed -i "s|$placeholder|$value|g" $FILE_TO_UPDATE
done
- name: Compile changed LaTeX documents
if: env.changed_files != ''
uses: xu-cheng/latex-action@v3
Expand Down
20 changes: 20 additions & 0 deletions imprint.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
\newcommand{\imprinturl}{imprint_url}

\newcommand{\companyname}{company_name}
\newcommand{\careof}{address.care_of}
\newcommand{\street}{address.street}
\newcommand{\postalcode}{address.postal_code}
\newcommand{\city}{address.city}
\newcommand{\registrationnumber}{commercial_register.registration_number}

\newcommand{\imprint}{
\href{\imprinturl}{
{\small\color{gray}
\companyname\\
\careof
\street\\
\postalcode\ \city\\
\registrationnumber
}
}
}
9 changes: 2 additions & 7 deletions src/nda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
\includesvg[width=0.2\linewidth]{logo.svg}\\[4ex]
{\Huge \sffamily Vertraulichkeitsvereinbarung}\\[2ex]
\textcolor{gray}{{\large \sffamily zwischen}}\\[2ex]
{\small
helpwave GmbH \\
mit Sitz in Aachen \\
HRB 27480 \\
(nachfolgend „Inhaber“)
}\\[2ex]
{\textcolor{gray}{{\large \sffamily und}}}\\[2ex]
{\imprint \\ (nachfolgend „Inhaber“)}\\[2ex]
{\textcolor{gray}{{\large \sffamily und}}}\\[2ex]
{\small

\begin{Form}
Expand Down

0 comments on commit fd7424c

Please sign in to comment.