diff --git a/.github/workflows/neocities.yml b/.github/workflows/neocities.yml
index d06148f..d9fbd5c 100644
--- a/.github/workflows/neocities.yml
+++ b/.github/workflows/neocities.yml
@@ -18,18 +18,21 @@ jobs:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
+ genhtml: ${{ steps.genhtml.outputs.genhtml }}
steps:
- uses: actions/checkout@v4
- name: create matrix
id: matrix
run: |
cd ${{ github.workspace }}
- echo "
" > public/posts.html
test=$(./compile.sh)
echo "matrix=$test" >> $GITHUB_OUTPUT
- - name: check posts.html
+ - name: genhtml
+ id: genhtml
run: |
- cat public/posts.html
+ cd ${{ github.workspace }}
+ test=$(./genhtml.sh)
+ echo "genhtml=$test" >> $GITHUB_OUTPUT
build:
needs: [ setup ]
@@ -48,10 +51,6 @@ jobs:
source: ${{ matrix.value.source }}
output: ${{ matrix.value.dest }}
github-corners: https://github.com/jaywcjlove/markdown-to-html-cliA
- - name: generate posts.html entries
- run:
- echo "- ${{ matrix.value.name }}
" >> public/posts.html
- cat public/posts.html
deploy:
needs: [ build ]
@@ -59,9 +58,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: finish posts.html
+ env:
+ genhtml: ${{ needs.setup.outputs.genhtml }}
run: |
- echo "
" >> ${{ github.workspace }}/public/posts.html
- cat ${{ github.workspace }}/public/posts.html
+ echo "$genhtml" > ${{ github.workspace}}/public/posts.html
#TODO this turns up empty right now. gotta figure that shit out i think
- name: Deploy to neocities
uses: bcomnes/deploy-to-neocities@v1
diff --git a/genhtml.sh b/genhtml.sh
new file mode 100755
index 0000000..959b7c3
--- /dev/null
+++ b/genhtml.sh
@@ -0,0 +1,15 @@
+html=''
+for entry in notes/*
+do
+ filename=$(basename "$entry" .md)
+ timestamp=`git log --format=%ad --date=format:'%Y-%m-%d' -- $entry`
+ dest="/posts/$timestamp"
+ dest+="_$filename"
+ dest+=".html"
+ html+="- $timestamp"
+ html+="_$filename
"
+done
+html+="
"
+echo $html
+