Skip to content

Instantly share code, notes, and snippets.

@BlogBlocks
Created April 16, 2023 15:01
Show Gist options
  • Save BlogBlocks/8fd542f794e54fa16f36e06478b16c5c to your computer and use it in GitHub Desktop.
Save BlogBlocks/8fd542f794e54fa16f36e06478b16c5c to your computer and use it in GitHub Desktop.
Bash Script to automake gallery,html
#!/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