initial commit...
This commit is contained in:
parent
1ec2828f58
commit
1831e2393f
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
<!-- Page Footer -->
|
||||
<div class="footer">
|
||||
<p>Fedi: <a rel="me" href="https://chaos.social/@dm2lct">@dm2lct@chaos.social</a></p>
|
||||
<p>QRZ.com: <a href="https://www.qrz.com/db/dm2lct">https://www.qrz.com/db/dm2lct</a></p>
|
||||
<p>hamqth.com: <a href="https://www.hamqth.com/dm2lct">https://www.hamqth.com/dm2lct</a></p>
|
||||
<p>Built with 💜 using <a href="https://github.com/spectrasecure/arise">Arise</a></p>
|
||||
</div>
|
||||
<!-- End Page Footer -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<!doctype html>
|
||||
|
||||
<html lang="{{language}}">
|
||||
<head>
|
||||
<!-- Basic Metadata -->
|
||||
<meta charset="utf-8" />
|
||||
<meta name="HandheldFriendly" content="True" />
|
||||
<meta name="generator" content="Arise" />
|
||||
|
||||
<title>{{title}} · {{global_name}}</title>
|
||||
<meta name="description" content="{{description}}">
|
||||
<meta name="author" content="{{author}}">
|
||||
<meta name="keywords" lang="de" content="chrissy tesar dm2lct optoelektronik freecad kicad informatik elektronik amateurfunk ham radio darc segelfliegen herkules H4 winde Tatra 148 Startwinde akaflieg dresden fotografie linux gpg jabber schrott musik freie software creative commons">
|
||||
|
||||
<!-- End Basic Metadata -->
|
||||
|
||||
<!-- OpenGraph Metadata -->
|
||||
<meta property="og:site_name" content="{{global_name}}" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content="{{title}} · {{global_name}}" />
|
||||
<meta property="og:description" content="{{description}}" />
|
||||
<meta property="og:url" content="{{canonical_url}}" />
|
||||
<meta property="og:image" content="{{canonical_url}}{{thumbnail}}" />
|
||||
<meta property="article:published_time" content="{{published_date}}" />
|
||||
<meta property="article:modified_time" content="{{modified_date}}" />
|
||||
<!-- End OpenGraph Metadata -->
|
||||
|
||||
<!-- Twitter Metadata -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="{{title}} · {{global_name}}" />
|
||||
<meta name="twitter:description" content="{{description}}" />
|
||||
<meta name="twitter:url" content="{{canonical_url}}" />
|
||||
<meta name="twitter:image" content="{{canonical_url}}{{thumbnail}}" />
|
||||
<!-- End Twitter Metadata -->
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/config/favicon/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/config/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/config/favicon/favicon-16x16.png">
|
||||
<link rel="manifest" href="/config/favicon/site.webmanifest">
|
||||
<link rel="mask-icon" href="/config/favicon/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<link rel="shortcut icon" href="/config/favicon/favicon.ico">
|
||||
<meta name="msapplication-TileColor" content="#00aba9">
|
||||
<meta name="msapplication-config" content="/config/favicon/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<!-- End Favicon -->
|
||||
|
||||
<!-- Styesheet+Logo -->
|
||||
<style>
|
||||
html * {font-family:monospace,sans-serif;}
|
||||
body {background: linear-gradient(#2A0A22,black);margin:40px auto;max-width:1024px;padding:0 10px;color:#fff;}
|
||||
a {color:#fff;}
|
||||
hr {color:#fff;}
|
||||
.topbar a {color:#fff; text-decoration:none;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/config/main.css">
|
||||
<div class="logo"><a href="/"><img src="/config/logo.png" /></a></div>
|
||||
<!-- End Styles+Logo -->
|
||||
<div class="header">
|
||||
<a href="/">Chrissys random stuff.</a>
|
||||
</div>
|
||||
|
||||
<!-- Navigation -->
|
||||
<nav class="topbar">
|
||||
<ul>
|
||||
<li><a href="/" >Main</a></li>
|
||||
<li><a href="/projekte">Projects</a></li>
|
||||
<li><a href="/blog">Blog</a></li>
|
||||
<li><a href="/kontakt">Contact</a></li>
|
||||
<li><a href="/rss.xml">RSS-Feed</a></li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
<!-- End Navigation -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
|
|
@ -0,0 +1,293 @@
|
|||
|
||||
/*** Core page styles to set the primary colours and styles to be inherited by everything else ***/
|
||||
|
||||
/* Core Styling */
|
||||
|
||||
:root {
|
||||
/* Sets the colors for the website. */
|
||||
--accent-color: #B404AE;
|
||||
--bg-color: #2A0A22;
|
||||
--bg-color-box: #AAAAAA;
|
||||
--trans_pink: #F5A9B8;
|
||||
--trans_blue: #5BCEFA;
|
||||
}
|
||||
|
||||
html * {
|
||||
font-family:sans-serif;
|
||||
}
|
||||
body{
|
||||
margin:40px auto;
|
||||
max-width:1024px;
|
||||
line-height:1.6;
|
||||
font-size:16px;
|
||||
color:#fff;
|
||||
background-color:linear-gradient(var(--bg-color),black);
|
||||
padding:0 10px;
|
||||
text-align: justify;
|
||||
text-align-last: none;
|
||||
hyphens: auto;
|
||||
}
|
||||
/********************************/
|
||||
/********************************/
|
||||
|
||||
/*** Post styling. This section is for defining markup classes to make it easier to write prettier posts. ***/
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
margin-top:20px;
|
||||
margin-bottom:20px;
|
||||
border-radius:16px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
video {
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color:var(--bg-color);
|
||||
border-radius:16px;
|
||||
padding-left:30px;
|
||||
padding-right:30px;
|
||||
line-height:2em;
|
||||
|
||||
padding-top:1px;
|
||||
padding-bottom:1px;
|
||||
color:#fff;
|
||||
font-family:monospace;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow-x: auto;
|
||||
white-space: pre-wrap;
|
||||
white-space: -moz-pre-wrap;
|
||||
white-space: -pre-wrap;
|
||||
white-space: -o-pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border-left:1px solid var(--accent-color);
|
||||
display:block;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
margin-left: 30px;
|
||||
padding-left: 10px;
|
||||
margin-right: 40px;
|
||||
font-style: italic;
|
||||
color:#46ab3e;
|
||||
}
|
||||
|
||||
hr {
|
||||
color:var(--accent-color);
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
#endline { /* Special kind of <hr> for spacing out footnotes from the rest of a post */
|
||||
color:var(--accent-color);
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: 300px;
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
a:link {
|
||||
text-decoration:underline;
|
||||
color:white;
|
||||
}
|
||||
|
||||
a:visited{
|
||||
text-decoration:underline;
|
||||
color=white;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
color: var(--trans_pink);
|
||||
}
|
||||
|
||||
h1{
|
||||
line-height:1.2
|
||||
}
|
||||
|
||||
h2,h3{
|
||||
padding-top:24px;
|
||||
line-height:1.2
|
||||
}
|
||||
|
||||
/* Style for inline dates. These are configured via a separate include file in /config/content_header.html. See notes on Arise page creation for more details. */
|
||||
.date {
|
||||
padding-bottom:0;
|
||||
margin-bottom:0;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
.date {
|
||||
text-align:right;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 901px) {
|
||||
.date {
|
||||
float:right;
|
||||
margin-left:30px;
|
||||
}
|
||||
}
|
||||
|
||||
/********************************/
|
||||
/********************************/
|
||||
|
||||
|
||||
/*** Modular component styles. Includes styling for the headers, navigation controls, and footer. ***/
|
||||
.header {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
line-height: 48px;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
justify-content: space-between;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: solid 1px var(--accent-color);
|
||||
|
||||
}
|
||||
|
||||
.header a:link
|
||||
{
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.header a:hover {
|
||||
color: white;
|
||||
background: linear-gradient(to right, var(--trans_blue), var(--trans_pink), white, var(--trans_pink), var(--trans_blue));
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Site logo. Styled to responsively move to either left or be centred, depending if the page is being viewed on desktop or mobile respectively. */
|
||||
.logo {
|
||||
margin-bottom:20px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
/* Navbar styling. */
|
||||
.topbar {
|
||||
padding-right:10px;
|
||||
border-top:1px solid var(--accent-color);
|
||||
border-bottom:1px solid var(--accent-color);
|
||||
margin-bottom:20px;
|
||||
text-align:center;
|
||||
}
|
||||
.topbar a {
|
||||
color:#fff;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
nav ul {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: auto;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
border-bottom: solid 1px var(--accent-color);
|
||||
}
|
||||
|
||||
nav li {
|
||||
list-style: none;
|
||||
margin: auto;
|
||||
font-size: 1.5em;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
@media (min-width: 45em) {
|
||||
nav ul {
|
||||
flex-direction: row;
|
||||
text-align: center;
|
||||
}
|
||||
nav li {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Site footer styling */
|
||||
.footer {
|
||||
border-top:2px solid var(--accent-color);
|
||||
font-size:12px;
|
||||
margin-top:120px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
/********************************/
|
||||
/********************************/
|
||||
|
||||
|
||||
/*** Other misc garbage ***/
|
||||
|
||||
/*** Imagelib Stuff ***/
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
/* Create four equal columns that sits next to each other */
|
||||
.column {
|
||||
flex: 25%;
|
||||
max-width: 25%;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.column img {
|
||||
margin-top: 8px;
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Responsive layout - makes a two column-layout instead of four columns */
|
||||
@media screen and (max-width: 800px) {
|
||||
.column {
|
||||
flex: 50%;
|
||||
max-width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
|
||||
@media screen and (max-width: 600px) {
|
||||
.column {
|
||||
flex: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* Arise Index Style */
|
||||
.arise-toc-td {
|
||||
border-width: 1px;
|
||||
border-color: var(--accent-color);
|
||||
border-top-style: solid;
|
||||
text-align: center;
|
||||
padding-right: 10px;
|
||||
padding-bottom: 5px
|
||||
}
|
||||
.arise-toc-th {
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
|
||||
- eingabe: verzeichnisse mit Bildern
|
||||
- ausgabe: verzeichnisse mit html dateien und Thumbnails + verzeichnisse mit Bildern
|
||||
- iteriere über alle Bilder in allen Verzeichnissen
|
||||
- generiere thumbnails
|
||||
- extrahiere exif daten aus Bildern
|
||||
- pro verzeichnis eine html index seite mit thumbnails, Überschrift, description etc.
|
||||
- klick auf Bild: Bild öffnet sich
|
||||
- detailseite: bild in groß, exifdaten + optional Beschreibung wird in neuem tab? geöffnet
|
||||
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
#!/usr/bin/python3
|
||||
"""!@brief:generates static html imagelibrary
|
||||
@author: Luzia Christiane Tesar
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
|
||||
# import exif
|
||||
from PIL import Image
|
||||
import argparse
|
||||
import configparser
|
||||
from pathlib import Path
|
||||
|
||||
BUILD_DIR = Path("./build")
|
||||
CONF_DIR = Path("./conf")
|
||||
|
||||
|
||||
class HTML:
|
||||
def __init__(self, **kwargs):
|
||||
self.header = Path(CONF_DIR / "header.html").read_text()
|
||||
self.footer = Path(CONF_DIR / "footer.html").read_text()
|
||||
for key, value in kwargs.items():
|
||||
setattr(self, key, value)
|
||||
print(self.outfolder)
|
||||
print(BUILD_DIR)
|
||||
|
||||
def setTitle(self, title):
|
||||
return f"""<h1>{title}</h1>\n"""
|
||||
|
||||
def div(self, divclass, data):
|
||||
return f"""<div class="{divclass}">{data}</div>\n"""
|
||||
|
||||
def postImage(self, src, alt=None, width=None, title=None):
|
||||
return f"""<img src="{src}" alt="{alt}" title="{title}" />\n"""
|
||||
|
||||
def link(self, dest, data):
|
||||
return f"""<a href="{dest}">{data}</a>"""
|
||||
|
||||
|
||||
class EXIF:
|
||||
def __init__(self, **kwargs):
|
||||
for key, value in kwargs.items():
|
||||
setattr(self, key, value)
|
||||
|
||||
|
||||
class IMG:
|
||||
def __init__(self, **kwargs):
|
||||
for key, value in kwargs.items():
|
||||
setattr(self, key, value)
|
||||
|
||||
|
||||
|
||||
def createThumb(path, thumbdir):
|
||||
size = 300,300
|
||||
print(thumbdir)
|
||||
for infile in glob.glob(str(path)+"/*.jpg" or str(path)+"/*.png"):
|
||||
print(infile)
|
||||
file = Path(infile).stem
|
||||
ext = Path(infile).suffix
|
||||
with Image.open(infile) as im:
|
||||
im.thumbnail(size)
|
||||
im.save(thumbdir/file, "JPEG")
|
||||
|
||||
def processImage():
|
||||
return
|
||||
|
||||
|
||||
def generateDir(path):
|
||||
Path(BUILD_DIR/path.name).mkdir(parents=True, exist_ok=True)
|
||||
Path(BUILD_DIR/path.name/".thumbnails").mkdir(parents=True, exist_ok=True)
|
||||
return Path(BUILD_DIR/path.name), Path(BUILD_DIR/path.name/".thumbnails")
|
||||
|
||||
def writeHTML():
|
||||
|
||||
with open(f"build/{self.outfolder}/index.html", "w", encoding="utf-8") as file:
|
||||
file.write(self.header)
|
||||
file.write(self.setTitle(self.title))
|
||||
file.write(self.div("row"))
|
||||
for image in glob.glob("eh23" + "/*.jpg"):
|
||||
file.write(self.div("column"))
|
||||
file.write(self.postImage(image))
|
||||
file.write(self.endDiv())
|
||||
file.write(self.endDiv())
|
||||
file.write(self.footer)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="PurrPic",
|
||||
description="Creates a static image gallery from a given Filelist",
|
||||
epilog="Meow! =^.^=",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inpath",
|
||||
type= lambda p: Path(p).absolute(),
|
||||
help="",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--outpath",
|
||||
type= lambda p: Path(p).absolute(),
|
||||
help="",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--start",
|
||||
"-s",
|
||||
type=str,
|
||||
help="",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
print(args.inpath)
|
||||
|
||||
odir, thumbdir = generateDir(args.inpath)
|
||||
createThumb(args.inpath, thumbdir)
|
||||
print(odir, thumbdir)
|
||||
|
||||
# for image in args.inpath:
|
||||
|
||||
|
||||
#index = HTML(outfolder="miau", title="miau")
|
||||
#index.writeHTML()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue