diff --git a/README.md b/README.md index d24c6cd..2393325 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/generate_html.py b/generate_html.py index c377145..0a9c2ec 100755 --- a/generate_html.py +++ b/generate_html.py @@ -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...") diff --git a/files/default-dark.css b/themes/default-dark.css similarity index 93% rename from files/default-dark.css rename to themes/default-dark.css index b33343e..9caef20 100644 --- a/files/default-dark.css +++ b/themes/default-dark.css @@ -22,4 +22,8 @@ body { color: #e8e6e3; background-color: #181a1b; +} + +a { + color: #0042dd; } \ No newline at end of file diff --git a/files/default.css b/themes/default.css similarity index 100% rename from files/default.css rename to themes/default.css diff --git a/files/monokai-vibrant.css b/themes/monokai-vibrant.css similarity index 100% rename from files/monokai-vibrant.css rename to themes/monokai-vibrant.css