ILY09 / site

0 stars 0 forks source link

python #2

Open ILY09 opened 1 day ago

ILY09 commented 1 day ago

Create a basic website structure with HTML, CSS, and a placeholder image folder.

import os from zipfile import ZipFile

Define the project structure

project_name = "artist_designer_website" base_path = f"/mnt/data/{project_name}" os.makedirs(base_path, exist_ok=True)

File contents

index_html = """<!DOCTYPE html>

[Votre Nom] - Artiste & Designer

Bienvenue dans l'univers de [Votre Nom]

Artiste et Designer

À propos

Bienvenue sur mon site ! Je suis [Votre Nom], un artiste et designer passionné par [vos spécialités].

Portfolio

Découvrez mes œuvres.

Contact







© 2024 [Votre Nom]. Tous droits réservés.

"""

style_css = """body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #f5f5f5; color: #333; } header { background: url('images/background.jpg') no-repeat center center/cover; height: 100vh; display: flex; align-items: center; justify-content: center; color: white; text-align: center; } header h1 { font-size: 4em; margin: 0; } nav { background-color: #333; color: white; padding: 10px 20px; display: flex; justify-content: space-around; } nav a { color: white; text-decoration: none; font-size: 1.2em; } section { padding: 50px 20px; max-width: 1200px; margin: auto; } footer { background-color: #222; color: white; text-align: center; padding: 20px; }"""

Create project structure and write files

with open(os.path.join(base_path, "index.html"), "w") as f: f.write(index_html)

with open(os.path.join(base_path, "style.css"), "w") as f: f.write(style_css)

Create images folder

os.makedirs(os.path.join(base_path, "images"), exist_ok=True)

Add placeholder for images

with open(os.path.join(base_path, "images/placeholder.txt"), "w") as f: f.write("Place your images here.")

Compress the folder into a ZIP file

zip_path = f"{base_path}.zip" with ZipFile(zip_path, 'w') as zipf: for root, dirs, files in os.walk(base_path): for file in files: zipf.write(os.path.join(root, file), os.path.relpath(os.path.join(root, file), base_path))

zip_path

ILY09 commented 1 day ago

git add . git commit -m "Update site" git push