lots of updates
This commit is contained in:
@@ -10,7 +10,9 @@ Use pip or similar to install from source.
|
|||||||
|
|
||||||
ex.
|
ex.
|
||||||
|
|
||||||
`pip3 install --user --upgrade https://bitbucket.org/MoonQ/mirva/get/tip.tar.gz`
|
`pip3 install --user --upgrade https://bitbucket.org/MoonQ/mirva/get/master.zip`
|
||||||
|
|
||||||
|
or `pipx install https://bitbucket.org/MoonQ/mirva/get/master.zip`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class Mirva:
|
|||||||
self.create_posts()
|
self.create_posts()
|
||||||
self.write_index()
|
self.write_index()
|
||||||
self.write_mediums()
|
self.write_mediums()
|
||||||
|
print("Gallery written.")
|
||||||
|
|
||||||
def create_config(self):
|
def create_config(self):
|
||||||
|
|
||||||
@@ -41,6 +42,7 @@ class Mirva:
|
|||||||
"title": "",
|
"title": "",
|
||||||
"sub_title": "",
|
"sub_title": "",
|
||||||
"intro": "",
|
"intro": "",
|
||||||
|
"image_size": 850
|
||||||
}
|
}
|
||||||
config_changed = True
|
config_changed = True
|
||||||
|
|
||||||
@@ -86,6 +88,10 @@ class Mirva:
|
|||||||
"--config", default=False, action="store_true", help="Write config and exit"
|
"--config", default=False, action="store_true", help="Write config and exit"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--force", default=False, action="store_true", help="Force regeneration of middle sized images"
|
||||||
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"folder",
|
"folder",
|
||||||
type=str,
|
type=str,
|
||||||
@@ -193,9 +199,9 @@ function create_button(direction, to) {{
|
|||||||
|
|
||||||
return """
|
return """
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<div class="navigation"></div>
|
<div class="navigation"> </div>
|
||||||
<div class=center><a href="{image}"><img class=post_image src=".med/{image}.jpg"></a></div>
|
<div class=center><a href="{image}"><img class=post_image src=".med/{image}.jpg"></a></div>
|
||||||
<p class="meta"><span class="name">{title}</span></p>
|
<div class="meta"><div class="name">{title}</div></div>
|
||||||
<div style="clear: both;"> </div>
|
<div style="clear: both;"> </div>
|
||||||
<div class="entry">{content}</div>
|
<div class="entry">{content}</div>
|
||||||
</div>""".format(
|
</div>""".format(
|
||||||
@@ -235,14 +241,31 @@ function create_button(direction, to) {{
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# TODO: config image res
|
r = self.config["SITE"].get("image_size", 850)
|
||||||
# TODO opts: force recreation
|
link = str(r).lower() == "link"
|
||||||
r = 850
|
if link:
|
||||||
force = False
|
r = 0
|
||||||
|
|
||||||
|
|
||||||
|
force = self.options.force
|
||||||
for f in self.file_list:
|
for f in self.file_list:
|
||||||
res = "{:d}x{:d}>".format(r, r)
|
res = "{:d}x{:d}>".format(int(r), int(r))
|
||||||
outfile = os.path.join(".med", "{}.jpg".format(f))
|
outfile = os.path.join(".med", "{}.jpg".format(f))
|
||||||
if not os.path.exists(outfile) or force:
|
if force:
|
||||||
|
try:
|
||||||
|
os.remove(outfile)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if not os.path.exists(outfile):
|
||||||
|
if link:
|
||||||
|
|
||||||
|
os.symlink(
|
||||||
|
"../{}".format(f),
|
||||||
|
outfile
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
|
||||||
convargs = [
|
convargs = [
|
||||||
"convert",
|
"convert",
|
||||||
"-define",
|
"-define",
|
||||||
|
|||||||
@@ -109,10 +109,15 @@ a:hover {
|
|||||||
/* Page */
|
/* Page */
|
||||||
|
|
||||||
#page {
|
#page {
|
||||||
width: 90vw;
|
width: calc(100vw - 128px);
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0px 0px 0px 0px;
|
padding: 0px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
#page {
|
||||||
|
width: 100vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#page-bgtop {
|
#page-bgtop {
|
||||||
padding: 20px 0px;
|
padding: 20px 0px;
|
||||||
@@ -124,14 +129,14 @@ a:hover {
|
|||||||
/* Content */
|
/* Content */
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
width: 90vw;
|
width: 100%;
|
||||||
padding: 30px 0px 0px 0px;
|
padding: 30px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post {
|
.post {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
border-top: lightgray dashed;
|
border-top: lightgray dashed 2px;
|
||||||
padding-top: 5px;
|
padding-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-bgtop {
|
.post-bgtop {
|
||||||
@@ -154,8 +159,7 @@ a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.post .meta {
|
.post .meta {
|
||||||
/* margin-bottom: 30px;*/
|
padding: 5px 0px 5px 0px;
|
||||||
padding: 5px 0px 15px 0px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
@@ -163,6 +167,7 @@ a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.post .meta .name {
|
.post .meta .name {
|
||||||
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post .meta .posted {
|
.post .meta .posted {
|
||||||
@@ -172,8 +177,7 @@ a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.post .entry {
|
.post .entry {
|
||||||
padding: 0px 0px 20px 0px;
|
padding: 0px 5px 20px 5px;
|
||||||
padding-bottom: 20px;
|
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,15 +188,20 @@ a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
display: block;
|
display: table;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post_image {
|
.post_image {
|
||||||
max-height: 95vh;
|
max-height: calc(100vh - 60px);
|
||||||
max-width: 90vw;
|
max-width: calc(100vw - 128px);
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
.post_image {
|
||||||
|
max-width: 100vw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Footer */
|
/* Footer */
|
||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
@@ -221,28 +230,28 @@ a:hover {
|
|||||||
/* navi */
|
/* navi */
|
||||||
|
|
||||||
.navigation {
|
.navigation {
|
||||||
height: 20px;
|
height: 27px;
|
||||||
margin-bottom: 5px;
|
float: right;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
.navigation {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.navigation_button {
|
.navigation_button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
margin-left: 10px;
|
||||||
box-shadow: 4px 4px 5px #888888;
|
box-shadow: 4px 4px 5px #888888;
|
||||||
}
|
}
|
||||||
.navigation_button:hover {
|
.navigation_button:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-shadow: 2px 2px 2px #888888;
|
box-shadow: 2px 2px 2px #888888;
|
||||||
}
|
}
|
||||||
@media only screen and (max-width: 800px) {
|
|
||||||
.navigation_button {
|
|
||||||
margin-top: 20px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.float_up {
|
.float_up {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.float_down {
|
.float_down {
|
||||||
float: right;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -6,12 +6,12 @@ setup(
|
|||||||
],
|
],
|
||||||
package_data={'':['resources/*']},
|
package_data={'':['resources/*']},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
version = '20210819',
|
version = '20210820',
|
||||||
description = 'A tool to create a web gallery from a folder of images.',
|
description = 'A tool to create a web gallery from a folder of images.',
|
||||||
author = 'Ville Rantanen',
|
author = 'Ville Rantanen',
|
||||||
author_email = 'ville.q.rantanen@gmail.com',
|
author_email = 'ville.q.rantanen@gmail.com',
|
||||||
url = 'https://bitbucket.org/MoonQ/mirva',
|
url = 'https://bitbucket.org/MoonQ/mirva',
|
||||||
download_url = 'https://bitbucket.org/MoonQ/mirva/get/tip.tar.gz',
|
download_url = 'https://bitbucket.org/MoonQ/mirva/get/master.zip',
|
||||||
keywords = ['album', 'generator', 'javascript'],
|
keywords = ['album', 'generator', 'javascript'],
|
||||||
classifiers = [],
|
classifiers = [],
|
||||||
license = 'MIT',
|
license = 'MIT',
|
||||||
|
|||||||
Reference in New Issue
Block a user