AlenkaF opened a new pull request, #275: URL: https://github.com/apache/arrow-site/pull/275
This PR inserts a script element into all `.html` files which calls a `/docs/versionwarning.js` file. The file adds a version warning to the `.html` page if the file path matches any of the 4 criteria: - the page is under developers section in stable release - the page is in the docs for arrow version older then 4.0 - the page is under developers section and in the docs for older arrow version (but at least 4.0) - the page is in the docs for older arrow version (but at least 4.0) Each of these warnings has its own warning message. **This PR is a part of Jira to GitHub migration work.** ## Hot to test the code locally? 1. Checkout any commit from `arrow-site/asf-site` other than this one 2. Save [versionwarning.js ](https://gist.github.com/AlenkaF/1f3e734b1ff2c5fa2b4ae808345aaa94) to `arrow-site/docs/` folder 3. Run next code snippet in the terminal (for MacOS, should be a bit different for Linux/Wind) from the **arrow-site/docs** folder. You will have to check/correct numbers 6&7 from the snippet. My path to `arrow-site/docs` is `/Users/alenkafrim/repos/arrow-site/docs` and is a "length" of 5 so numbers I used down bellow were 6&7. If the length of you path is 7 then you need to change 6 with 8 and 7 with 9 😬 I am searching for a shell function to give the length and I can automate this step =) ``` # Run this from the arrow-site/docs/ folder (check the numbers 6&7!) sed -i '' "s/'arrow.apache.org'/''/" versionwarning.js sed -i '' "s/\[2\]/\[6\]/" versionwarning.js sed -i '' "s/\[3\]/\[7\]/" versionwarning.js # insert the JS file into all the html files in /docs find . -iname "*.html" | xargs sed -i '' '/<\/body>/ i\ <script type="text/javascript" src="$(pwd)/versionwarning.js"></script>' ``` --- This is the visual from my local tests:     -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
