-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace absolute path with relative path in index.html
- Loading branch information
1 parent
9d4bec8
commit c83c364
Showing
2 changed files
with
31 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
|
||
# replace absolute path with relative path in index.html | ||
print('Replacing absolute path with relative path in index.html...') | ||
with open('index.html', 'r', encoding='utf-8') as f: | ||
content = f.read() | ||
content = content.replace('"/', '"') | ||
with open('index.html', 'w', encoding='utf-8') as f: | ||
f.write(content) | ||
print('Done!') | ||
print() | ||
|
||
# deploy to GitHub Pages | ||
print('Deploying to GitHub Pages...') | ||
os.system('git checkout deploy') | ||
os.system('git add .') | ||
os.system('git commit -m "replace absolute path with relative path in index.html"') | ||
os.system('git push origin deploy') | ||
print('Done!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters