Skip to content

Commit

Permalink
Merge pull request #29 from skipgu/JekyllFixLinks
Browse files Browse the repository at this point in the history
A JS Script injection to make sure the exam redirects work correctly
  • Loading branch information
20Attila03 authored Apr 16, 2024
2 parents 1815e54 + d365a0c commit 3e7bd5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
with:
source: ./
destination: ./_site
- name: Insert JS snippet
run: |
find ./_site -name '*.html' -exec sed -i 's|</body>|<script>document.addEventListener("DOMContentLoaded", function() {const links = document.querySelectorAll("a[href^=\\"./exams/\\"]");links.forEach(link => {const code = link.getAttribute("href").slice(8);link.href = `https://github.com/skipgu/past-exams/tree/main/exams/${code}`;});});</script>\n</body>|g' {} +
- name: Upload artifact
uses: actions/upload-pages-artifact@v2

Expand Down

0 comments on commit 3e7bd5a

Please sign in to comment.