Skip to content

Commit

Permalink
env-informed site root
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfect5th committed Jan 21, 2024
1 parent 2829650 commit 4fbb317
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ jobs:
run: |
sudo apt update
sudo apt install markdown
./convert.sh
echo $url
SITE_ROOT="/simple-site" ./convert.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mkdir -p ./_site
for FILE in $FILES; do
HTML_PATH=$(echo "$FILE" | sed -e 's/\.md$/\.html/' | sed -e 's/^\.\/markdown/\.\/_site/')
echo "Creating $HTML_PATH"
cat ./templates/base.html > "$HTML_PATH"
sed -e "s:{{SITE_ROOT}}:$SITE_ROOT:g" ./templates/base.html > "$HTML_PATH"
markdown --html4tags "$FILE" >> "$HTML_PATH"
cat ./templates/close.html >> "$HTML_PATH"
done
Expand Down
4 changes: 2 additions & 2 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8">
<title>Simple Site</title>
<meta name="description" content="A simple, markdown-derived website.">
<link rel="stylesheet" href="/css/base.css">
<script src="/js/main.js"></script>
<link rel="stylesheet" href="{{SITE_ROOT}}/css/base.css">
<script src="{{SITE_ROOT}}/js/main.js"></script>
</head>
<body>
<!-- intentionally unterminated -->

0 comments on commit 4fbb317

Please sign in to comment.