new fix
This commit is contained in:
18
.github/workflows/neocities.yml
vendored
18
.github/workflows/neocities.yml
vendored
@@ -18,18 +18,21 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.matrix.outputs.matrix }}
|
matrix: ${{ steps.matrix.outputs.matrix }}
|
||||||
|
genhtml: ${{ steps.genhtml.outputs.genhtml }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: create matrix
|
- name: create matrix
|
||||||
id: matrix
|
id: matrix
|
||||||
run: |
|
run: |
|
||||||
cd ${{ github.workspace }}
|
cd ${{ github.workspace }}
|
||||||
echo "<ul class=posts>" > public/posts.html
|
|
||||||
test=$(./compile.sh)
|
test=$(./compile.sh)
|
||||||
echo "matrix=$test" >> $GITHUB_OUTPUT
|
echo "matrix=$test" >> $GITHUB_OUTPUT
|
||||||
- name: check posts.html
|
- name: genhtml
|
||||||
|
id: genhtml
|
||||||
run: |
|
run: |
|
||||||
cat public/posts.html
|
cd ${{ github.workspace }}
|
||||||
|
test=$(./genhtml.sh)
|
||||||
|
echo "genhtml=$test" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: [ setup ]
|
needs: [ setup ]
|
||||||
@@ -48,10 +51,6 @@ jobs:
|
|||||||
source: ${{ matrix.value.source }}
|
source: ${{ matrix.value.source }}
|
||||||
output: ${{ matrix.value.dest }}
|
output: ${{ matrix.value.dest }}
|
||||||
github-corners: https://github.com/jaywcjlove/markdown-to-html-cliA
|
github-corners: https://github.com/jaywcjlove/markdown-to-html-cliA
|
||||||
- name: generate posts.html entries
|
|
||||||
run:
|
|
||||||
echo "<li class=\"post\"><a href=\"${{ matrix.value.dest }}\">${{ matrix.value.name }}</a></li>" >> public/posts.html
|
|
||||||
cat public/posts.html
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
@@ -59,9 +58,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: finish posts.html
|
- name: finish posts.html
|
||||||
|
env:
|
||||||
|
genhtml: ${{ needs.setup.outputs.genhtml }}
|
||||||
run: |
|
run: |
|
||||||
echo "</ul>" >> ${{ github.workspace }}/public/posts.html
|
echo "$genhtml" > ${{ github.workspace}}/public/posts.html
|
||||||
cat ${{ github.workspace }}/public/posts.html
|
|
||||||
#TODO this turns up empty right now. gotta figure that shit out i think
|
#TODO this turns up empty right now. gotta figure that shit out i think
|
||||||
- name: Deploy to neocities
|
- name: Deploy to neocities
|
||||||
uses: bcomnes/deploy-to-neocities@v1
|
uses: bcomnes/deploy-to-neocities@v1
|
||||||
|
15
genhtml.sh
Executable file
15
genhtml.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
html='<ul class="posts">'
|
||||||
|
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+="<li class=\"postli\"><a class=\"posta\" href=\"$dest"
|
||||||
|
html+="\">$timestamp"
|
||||||
|
html+="_$filename</a></li>"
|
||||||
|
done
|
||||||
|
html+="</ul>"
|
||||||
|
echo $html
|
||||||
|
|
Reference in New Issue
Block a user