From 6cb58a3c0847eabb228faf3e222543fa0a23fcbc Mon Sep 17 00:00:00 2001 From: Sheikh Date: Wed, 24 Jan 2024 19:03:04 -0400 Subject: [PATCH] fix: relocate template directory in resumake module directory fixes missing templates issue for PyPI --- .gitattributes | 2 +- .github/workflows/resume.yml | 8 ++++---- src/resumake/builder/__main__.py | 2 +- src/{ => resumake}/template/index.html | 0 src/{ => resumake}/template/resume.css | 0 src/{ => resumake}/template/resume.html | 0 src/{ => resumake}/template/resume.theme.css | 0 7 files changed, 6 insertions(+), 6 deletions(-) rename src/{ => resumake}/template/index.html (100%) rename src/{ => resumake}/template/resume.css (100%) rename src/{ => resumake}/template/resume.html (100%) rename src/{ => resumake}/template/resume.theme.css (100%) diff --git a/.gitattributes b/.gitattributes index 3f2e974..d77cc21 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ # ignore template files from language statistics -src/template/* linguist-vendored \ No newline at end of file +src/resumake/template/* linguist-vendored \ No newline at end of file diff --git a/.github/workflows/resume.yml b/.github/workflows/resume.yml index a01f5dd..fce583d 100644 --- a/.github/workflows/resume.yml +++ b/.github/workflows/resume.yml @@ -8,9 +8,9 @@ on: - "resume/*.py" - ".github/workflows/resume.yml" - "src/resumake/utils.py" - - "src/template/resume.css" - - "src/template/resume.html" - - "src/template/index.html" + - "src/resumake/template/resume.css" + - "src/resumake/template/resume.html" + - "src/resumake/template/index.html" # Allows running this workflow manually from the Actions tab workflow_dispatch: @@ -34,7 +34,7 @@ jobs: export PYTHONPATH=$PYTHONPATH:$PWD/src/ python3 -m resumake.builder ${RESUME_SCRIPT} -o ./static/assets FILENAME=$(basename $(ls ./static/assets/Resume_*.pdf) .pdf) - echo | pandoc -t html --template=./src/template/index.html --metadata title="${FILENAME}" --variable filename="${FILENAME}" -o ./static/index.html + echo | pandoc -t html --template=./src/resumake/template/index.html --metadata title="${FILENAME}" --variable filename="${FILENAME}" -o ./static/index.html echo "skip=false" >> "${GITHUB_OUTPUT}" else echo "File '${RESUME_SCRIPT}' not found. Couldn't build resume." diff --git a/src/resumake/builder/__main__.py b/src/resumake/builder/__main__.py index 23dfa15..5c74919 100755 --- a/src/resumake/builder/__main__.py +++ b/src/resumake/builder/__main__.py @@ -33,7 +33,7 @@ def parse_args() -> argparse.Namespace: # resolve path to default template template_dir = os.path.realpath( os.path.join( - os.path.dirname(os.path.realpath(__file__)), "../../template" + os.path.dirname(os.path.realpath(__file__)), "../template" ) ) diff --git a/src/template/index.html b/src/resumake/template/index.html similarity index 100% rename from src/template/index.html rename to src/resumake/template/index.html diff --git a/src/template/resume.css b/src/resumake/template/resume.css similarity index 100% rename from src/template/resume.css rename to src/resumake/template/resume.css diff --git a/src/template/resume.html b/src/resumake/template/resume.html similarity index 100% rename from src/template/resume.html rename to src/resumake/template/resume.html diff --git a/src/template/resume.theme.css b/src/resumake/template/resume.theme.css similarity index 100% rename from src/template/resume.theme.css rename to src/resumake/template/resume.theme.css