Skip to content

Commit

Permalink
Merge pull request #2 from carapace-sh/og-image
Browse files Browse the repository at this point in the history
add og:image
  • Loading branch information
rsteube authored Sep 17, 2024
2 parents 6acfca7 + 3ce8def commit b475f77
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 b475f77

Please sign in to comment.