Skip to content

Commit

Permalink
replace absolute path with relative path in index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-Turmoil committed Oct 16, 2023
1 parent 9d4bec8 commit c83c364
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
19 changes: 19 additions & 0 deletions deploy.py
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!')
24 changes: 12 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<link rel="stylesheet"
href="https://tonys-studio-1308383348.cos.ap-beijing.myqcloud.com/static/css/barber-shop.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/css/fonts.css">
<link rel="stylesheet" href="/css/effect.css">
<link rel="stylesheet" href="/css/doc.css">
<link rel="stylesheet" href="/css/alertify.min.css">
<link rel="stylesheet" href="/css/index.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/fonts.css">
<link rel="stylesheet" href="css/effect.css">
<link rel="stylesheet" href="css/doc.css">
<link rel="stylesheet" href="css/alertify.min.css">
<link rel="stylesheet" href="css/index.css">

<!-- Clarity -->
<script type="text/javascript">
Expand Down Expand Up @@ -388,12 +388,12 @@ <h3>General</h3>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<script src="/js/prism.js"></script>
<script src="/js/prism-theme.js"></script>
<script src="/js/extension.js"></script>
<script src="/js/alertify.min.js"></script>
<script src="/js/code.js"></script>
<script src="/js/index.js"></script>
<script src="js/prism.js"></script>
<script src="js/prism-theme.js"></script>
<script src="js/extension.js"></script>
<script src="js/alertify.min.js"></script>
<script src="js/code.js"></script>
<script src="js/index.js"></script>
</body>

</html>

0 comments on commit c83c364

Please sign in to comment.