Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Oct 18, 2024
1 parent 035056d commit 542adb4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/PublishDev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: Upload wombatSetup.js to dev drive
run: |
ls -lah javascript/dist
curl -f -u "${{ secrets.DEV_DRIVE_WEBDAV_CREDENTIALS }}" -T javascript/dist/wombatSetup.js -sw '%{http_code}' https://dev.kiwix.org/zimscraperlib/
curl -u "${{ secrets.DEV_DRIVE_WEBDAV_CREDENTIALS }}" -T javascript/dist/wombatSetup.js -sw '%{http_code}' "https://dev.kiwix.org/zimscraperlib/"
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ repos:
- id: prettier
args:
- --config
- .prettierrc.json
- javascript/.prettierrc.json
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

3 changes: 3 additions & 0 deletions javascript/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.py
src/fuzzyRules.js
test/fuzzyRules.js
File renamed without changes.
30 changes: 30 additions & 0 deletions src/zimscraperlib/rewriting/templates/head_insert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% autoescape false %} {% set urlsplit = url | urlsplit %}

<!-- WB Insert -->
<script src="{{ static_prefix }}wombat.js"></script>
<script src="{{ static_prefix }}wombatSetup.js"></script>
<script>
// Get the current url we are serving from.
// We cannot know it at zim creation as it depends of our server.
const current_url = (function () {
var href = new URL(window.location.href);
href.hash = '';

return href.toString();
})();

const wbinfo = wombatSetup.getWombatInfo(
current_url,
'{{ orig_host }}',
'{{ orig_scheme }}',
'{{ orig_url }}',
current_url.substring(0, current_url.length - '{{ path }}'.length),
);

if (window && window._WBWombatInit) {
window._WBWombatInit(wbinfo);
}
</script>
{% endautoescape %}

<!-- End WB Insert -->

0 comments on commit 542adb4

Please sign in to comment.