diff options
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | gemtexter.conf | 1 | ||||
| -rw-r--r-- | header.html.part | 65 | ||||
| -rw-r--r-- | lib/generate.source.sh | 5 | ||||
| -rw-r--r-- | style.css | 61 |
5 files changed, 69 insertions, 66 deletions
@@ -61,7 +61,7 @@ Whereas you only want to edit the content in the `gemtext` folder directly. The ### Special HTML configuration -You will find the `./header.html.part` and `./footer.html.part` files, they are minimal template files for the HTML generation. +You will find the `./header.html.part` and `./footer.html.part` files, they are minimal template files for the HTML generation. There's also the `style.css` for HTML. ### Special Markdown configuration @@ -109,4 +109,3 @@ I might or might not implement those: * Automatic ToC generation. * Sitemap generation. * More output formats. Gopher? Groff? Plain text? PDF via Pandoc? .sh with interactive menus? -* External CSS file for HTML (so that the style doesn't need to be included in each HTML page again) diff --git a/gemtexter.conf b/gemtexter.conf index 54c6479..c81a0a4 100644 --- a/gemtexter.conf +++ b/gemtexter.conf @@ -7,3 +7,4 @@ declare -xr ATOM_MAX_ENTRIES=42 declare -xr CONTENT_BASE_DIR=../buetow.org-content declare -xr HTML_HEADER=./header.html.part declare -xr HTML_FOOTER=./footer.html.part +declare -xr HTML_CSS_STYLE=./style.css diff --git a/header.html.part b/header.html.part index 1aec379..0d7f506 100644 --- a/header.html.part +++ b/header.html.part @@ -4,69 +4,6 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>%%TITLE%%</title> <link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> -<style type="text/css"> -body { - margin: auto; - padding-left: 10px; - padding-right: 10px; - max-width: 900px; - font-family: sans-serif; - font-size: 18px; - background-color: #222; - color: #ffffef; -} - -h1,h2,h3 { - color: #ffa500 -} - -a { - color: #0ca; - text-decoration: none; -} - -a:hover { - color: #c0f; - text-decoration: none; -} - -li { - color: #00bcd4; -} - -img { - max-width: 600px; - max-height: 400px; - display: block; - margin: auto; -} - -pre { - display: block; - background-color: #111; - color: #66cdaa; - padding: 5px; - overflow-x: auto; -} - -a.textlink:before { - content: " ⇒ "; - padding-left: 2px; -} - -p.quote { - color: #82eefd; -} - -p.quote:before { - content: " « "; - padding-left: 2px; -} - -p.quote:after { - content: " » "; - padding-right: 2px; -} -</style> +<link rel="stylesheet" href="style.css" /> </head> <body> diff --git a/lib/generate.source.sh b/lib/generate.source.sh index 6f042eb..300d92f 100644 --- a/lib/generate.source.sh +++ b/lib/generate.source.sh @@ -120,6 +120,11 @@ generate::fromgmi () { log INFO "Converted $num_gmi_files Gemtext files" + # Add CSS style sheet (for html only). For simplicity, copy style sheet + # file to ./ and to ./gemfeed directories (not to mess with file paths too much). + cp $HTML_CSS_STYLE $CONTENT_BASE_DIR/gemtext/style.css + cp $HTML_CSS_STYLE $CONTENT_BASE_DIR/gemtext/gemfeed/style.css + # Add non-.gmi files to html dir. log VERBOSE "Adding other docs to $*" diff --git a/style.css b/style.css new file mode 100644 index 0000000..3eeced1 --- /dev/null +++ b/style.css @@ -0,0 +1,61 @@ +body { + margin: auto; + padding-left: 10px; + padding-right: 10px; + max-width: 900px; + font-family: "courier new"; + background-color: #ffffff; + color: #000000; +} + +h1,h2,h3 { + color: #55bc90; +} + +a { + color: #174f14; + text-decoration: none; +} + +a:hover { + color: #c0f; + text-decoration: none; +} + +li { + color: #174f14; +} + +img { + max-width: 600px; + max-height: 400px; + display: block; + margin: auto; +} + +pre { + display: block; + background-color: #111; + color: #66cdaa; + padding: 5px; + overflow-x: auto; +} + +a.textlink:before { + content: " ⇒ "; + padding-left: 2px; +} + +p.quote { + color: #174f14; +} + +p.quote:before { + content: " « "; + padding-left: 2px; +} + +p.quote:after { + content: " » "; + padding-right: 2px; +} |
