mirror of
https://github.com/greflm13/StaticGalleryBuilder.git
synced 2026-02-05 02:59:27 +00:00
themes moved to folder
This commit is contained in:
@@ -49,7 +49,7 @@ The script supports several command-line options to customize its behavior. Belo
|
||||
- `-l LICENSE, --license LICENSE`: Specify a license for the content. Options are `cc-zero`, `cc-by`, `cc-by-sa`, `cc-by-nd`, `cc-by-nc`, `cc-by-nc-sa`, and `cc-by-nc-nd`.
|
||||
- `-a AUTHOR, --author AUTHOR`: Specify the author of the content.
|
||||
- `-t TITLE, --title TITLE`: Specify the title for the root directory HTML file.
|
||||
- `--theme THEME`: Specify the relative link to a custom CSS theme file. Default is `.static/default.css`.
|
||||
- `--theme THEME`: Specify the path to a custom CSS theme file. Default is `themes/default.css`.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ _ROOTTITLE = "Pictures"
|
||||
_STATICFILES = os.path.join(os.path.abspath(os.path.dirname(__file__)), "files")
|
||||
_FAVICON = ".static/favicon.ico"
|
||||
_STYLE = ".static/global.css"
|
||||
_THEME = ".static/default.css"
|
||||
_THEME = os.path.join(os.path.abspath(os.path.dirname(__file__)), "themes", "default.css")
|
||||
_AUTHOR = "Author"
|
||||
# fmt: off
|
||||
rawext = [".3fr", ".ari", ".arw", ".bay", ".braw", ".crw", ".cr2", ".cr3", ".cap", ".data", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".fff", ".gpr", ".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", ".ptx", ".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".tif", ".tiff", ".x3f"]
|
||||
@@ -123,7 +123,7 @@ def listfolder(folder: str, title: str):
|
||||
title=title,
|
||||
favicon=f"{args.webroot}{_FAVICON}",
|
||||
stylesheet=f"{args.webroot}{_STYLE}",
|
||||
theme=f"{args.webroot}{urllib.parse.quote(args.theme)}",
|
||||
theme=f"{args.webroot}.static/theme.css",
|
||||
root=args.webroot,
|
||||
parent=parent,
|
||||
header=header,
|
||||
@@ -180,7 +180,7 @@ def main():
|
||||
parser.add_argument("-l", "--license", help="License", default=None, required=False, choices=["cc-zero", "cc-by", "cc-by-sa", "cc-by-nd", "cc-by-nc", "cc-by-nc-sa", "cc-by-nc-nd"], dest="license")
|
||||
parser.add_argument("-a", "--author", help="Author", default=_AUTHOR, required=False, type=str, dest="author")
|
||||
parser.add_argument("-t", "--title", help="Title", default=_ROOTTITLE, required=False, type=str, dest="title")
|
||||
parser.add_argument("--theme", help="Relative link to CSS theme file", default=_THEME, required=False, type=str, dest="theme")
|
||||
parser.add_argument("--theme", help="Path to CSS theme file", default=_THEME, required=False, type=str, dest="theme")
|
||||
parser.add_argument("--fancyfolders", help="Use fancy folders instead of default apache ones", action="store_true", default=False, required=False, dest="fancyfolders")
|
||||
args = parser.parse_args()
|
||||
# fmt: on
|
||||
@@ -205,6 +205,7 @@ def main():
|
||||
|
||||
print("Copying static files...")
|
||||
shutil.copytree(_STATICFILES, os.path.join(args.root, ".static"), dirs_exist_ok=True)
|
||||
shutil.copyfile(args.theme, os.path.join(args.root, ".static", "theme.css"))
|
||||
|
||||
if args.non_interactive:
|
||||
print("Generating html files...")
|
||||
|
||||
@@ -22,4 +22,8 @@
|
||||
body {
|
||||
color: #e8e6e3;
|
||||
background-color: #181a1b;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0042dd;
|
||||
}
|
||||
Reference in New Issue
Block a user