Created
April 16, 2023 15:01
-
-
Save BlogBlocks/8fd542f794e54fa16f36e06478b16c5c to your computer and use it in GitHub Desktop.
Bash Script to automake gallery,html
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
#!/bin/bash | |
# Define the directory containing the images | |
dir=$(pwd) | |
# Create the HTML header | |
cat <<EOF > gallery.html | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Image Gallery</title> | |
<style> | |
.gallery { | |
display: flex; | |
flex-wrap: wrap; | |
justify-content: center; | |
align-items: center; | |
} | |
.gallery img { | |
width: 250px; | |
height: 250px; | |
object-fit: cover; | |
margin: 10px; | |
} | |
</style> | |
</head> | |
<body> | |
<p>full body cyborg| full-length portrait| detailed face| symmetric| steampunk| cyberpunk| cyborg| intricate detailed| to scale| hyperrealistic| cinematic lighting| digital art| concept art| mdjrny-v4 style</p><br /> | |
<a href="https://huggingface.co/Joeythemonster/anything-midjourney-v-4-1" target="_blank">huggingface.co Joeythemonster anything-midjourney-v-4-1</a><br /> | |
<div class="gallery"> | |
EOF | |
# Loop through each image in the directory and add it to the gallery | |
for file in "$dir"/*.jpg; do | |
echo " <img src=\"$file\">" >> gallery.html | |
done | |
# Create the HTML footer | |
cat <<EOF >> gallery.html | |
</div> | |
</body> | |
</html> | |
EOF | |
echo "Gallery created at gallery.html" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment