Skip to content

Commit

Permalink
Adjust to replace all relations
Browse files Browse the repository at this point in the history
  • Loading branch information
jhcoll committed Oct 23, 2023
1 parent 2c3dc47 commit 93f55a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Generate Read More related
on:
push:
branches:
- automate-read-more
- gh-pages
pull_request:
branches:
- gh-pages
Expand All @@ -22,4 +22,11 @@ jobs:
- run: npm install
- run: npm run compute-embeddings --OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}
- run: npm run generate-related
- uses: stefanzweifel/git-auto-commit-action@v5
- name: Create New Pull Request
if: steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@v4
with:
title: Auto Compressed Images
branch-suffix: timestamp
commit-message: Auto Compressed Images
body: ${{ steps.calibre.outputs.markdown }}
2 changes: 1 addition & 1 deletion scripts/generate-related/blog-metadata.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ data.forEach((d, i) => {
- ${filenameToUrl(sortedDistances[0].item.file)}
- ${filenameToUrl(sortedDistances[1].item.file)}`;

fs.appendFileSync("./_data/related.yml", output + "\n");
fs.writeFileSync("./_data/related.yml", output + "\n");
}

});
3 changes: 1 addition & 2 deletions scripts/generate-related/compute-embeddings.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ const summarisePost = async (post) => {
};

(async () => {
console.log(process.cwd());
const paths = await glob("./_posts/**/2023-*.*").then((paths) => {
const paths = await glob("./_posts/**/*.*").then((paths) => {
return paths;
});

Expand Down

0 comments on commit 93f55a2

Please sign in to comment.