Skip to content

Commit

Permalink
add og:image
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 17, 2024
1 parent 6acfca7 commit 3ce8def
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/og-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
for arg in "$@"; do
link=$(grep --only-matching --extended-regexp --max-count 1 '"[^"]+/banner.png' "$arg")
[ "$link" != "" ] && sed -i "/<head>/a \ <meta property=\"og:image\" content=\"${link}\" />" "$arg"
done
exit 0
4 changes: 4 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ jobs:
container: ghcr.io/carapace-sh/carapace
steps:
- uses: actions/checkout@v4

- name: "build docs"
run: mdbook build docs

- name: "add og:image"
run: sh .github/og-image.sh docs/book/html/*.html

- name: "push gh-pages"
if: github.ref == 'refs/heads/master'
run: |
Expand Down

0 comments on commit 3ce8def

Please sign in to comment.