```
chore: enhance .gitignore and remove obsolete documentation files - Reorganize .gitignore with categorized sections for better maintainability - Add comprehensive ignore patterns for Python, Node.js, databases, logs, and build artifacts - Add project-specific ignore rules for coordinator, explorer, and deployment files - Remove outdated documentation: BITCOIN-WALLET-SETUP.md, LOCAL_ASSETS_SUMMARY.md, README-CONTAINER-DEPLOYMENT.md, README-DOMAIN-DEPLOYMENT.md ```
This commit is contained in:
67
apps/trade-exchange/build.py
Normal file
67
apps/trade-exchange/build.py
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Build script for AITBC Trade Exchange
|
||||
Combines CSS and HTML for production deployment
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
def build_html():
|
||||
"""Build production HTML with embedded CSS"""
|
||||
print("🔨 Building AITBC Exchange for production...")
|
||||
|
||||
# Read CSS file
|
||||
css_path = "styles.css"
|
||||
html_path = "index.html"
|
||||
output_path = "index.html"
|
||||
|
||||
# Backup original
|
||||
if os.path.exists(html_path):
|
||||
shutil.copy(html_path, "index.dev.html")
|
||||
print("✓ Backed up original index.html to index.dev.html")
|
||||
|
||||
# Read the template
|
||||
with open("index.template.html", "r") as f:
|
||||
template = f.read()
|
||||
|
||||
# Read CSS
|
||||
with open(css_path, "r") as f:
|
||||
css_content = f.read()
|
||||
|
||||
# Replace placeholder with CSS
|
||||
html_content = template.replace("<!-- CSS_PLACEHOLDER -->", f"<style>\n{css_content}\n </style>")
|
||||
|
||||
# Write production HTML
|
||||
with open(output_path, "w") as f:
|
||||
f.write(html_content)
|
||||
|
||||
print(f"✓ Built production HTML: {output_path}")
|
||||
print("✓ CSS is now embedded in HTML")
|
||||
|
||||
def create_template():
|
||||
"""Create a template file for future use"""
|
||||
template = """<!DOCTYPE html>
|
||||
<html lang="en" class="h-full">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AITBC Trade Exchange - Buy & Sell AITBC</title>
|
||||
<script src="https://unpkg.com/lucide@latest"></script>
|
||||
<!-- CSS_PLACEHOLDER -->
|
||||
</head>
|
||||
<body>
|
||||
<!-- Body content will be added here -->
|
||||
</body>
|
||||
</html>"""
|
||||
|
||||
with open("index.template.html", "w") as f:
|
||||
f.write(template)
|
||||
|
||||
print("✓ Created template file: index.template.html")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not os.path.exists("index.template.html"):
|
||||
create_template()
|
||||
|
||||
build_html()
|
||||
Reference in New Issue
Block a user