Commit 74e4627e authored by PoroCYon's avatar PoroCYon

basic CSS stuff

parent db7e92d7
out/
stc/mathjax.js
ningau.sh
......@@ -7,39 +7,45 @@
default: all
DATE="$(shell date "+%B%e, %Y")"
DATE="$(shell date "+%B %e, %Y")"
MAINTITLE="lo kibystu pe la poros"
MATHJAX=https://github.com/mathjax/MathJax/raw/master/MathJax.js
PANDOC ?= pandoc
PDMARKDOWN="markdown_github+raw_tex+yaml_metadata_block+table_captions+implicit_figures+simple_tables+multiline_tables+grid_tables+tex_math_dollars+fenced_code_attributes+inline_code_attributes+markdown_attribute+fancy_lists+all_symbols_escapable+superscript+subscript+header_attributes-emoji"
PDFLAGS=-s --ascii -S -M date=$(DATE) \
-V maintitle=$(MAINTITLE) -c /stc/style.css --mathjax=/stc/mathjax.js \
--template=tpl/template -H tpl/header.html -B tpl/before.html -A tpl/after.html
SCSSC ?= sassc
PDMARKDOWN="markdown_github+smart+raw_tex+yaml_metadata_block+table_captions+implicit_figures+simple_tables+multiline_tables+grid_tables+tex_math_dollars+fenced_code_attributes+inline_code_attributes+markdown_attribute+fancy_lists+all_symbols_escapable+superscript+subscript+header_attributes-emoji"
PDFLAGS=-s --ascii -M date=$(DATE) \
-V maintitle=$(MAINTITLE) -c /stc/style-light.css --mathml \
--template=tpl/template -H tpl/header.html #-B tpl/before.html -A tpl/after.html
INPUT_FILES=$(shell find src/ -type f -name "*.md")
OUTPUT_FILES=$(patsubst src/%.md, out/%.html, $(INPUT_FILES))
newmathjax:
wget "$(MATHJAX)" -O stc/mathjax.js
%:
%/:
mkdir -p "$@"
out/%.html: src/%.md
$(PANDOC) $(PDFLAGS) -f $(PDMARKDOWN) -t html "$<" -o "$@"
stc/mathjax.js:
wget "$(MATHJAX)" -O "$@"
out/stc/%.css: sty/%.scss
$(SCSSC) -t compact -M "$<" "$@"
all: out/ $(wildcard stc/*) stc/mathjax.js $(wildcard tpl/*.html) $(OUTPUT_FILES)
all: out/stc/ $(wildcard stc/*) $(wildcard tpl/*.html) \
out/stc/style-dark.css out/stc/style-light.css \
$(OUTPUT_FILES)
@cp -vr stc/ out/
clean:
@rm -rvf out/
distclean: clean
@rm -v stc/mathjax.js
.PHONY: default all clean distclean newmathjax
ningau.sh:
@echo "This is a remote update mechanism. Implementation is an exercise for the reader."
install: ningau.sh
@./ningau.sh
test: all
cd out/ && python3 -m http.server 8080
.PHONY: default all clean distclean newmathjax install
function cookie_get(name) {
var value = "; " + document.cookie,
parts = value.split("; " + name + "=");
if (parts.length == 2) {
return parts.pop().split(";").shift();
}
}
function cookie_create(value) {
var d = new Date();
d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000));
document.cookie = value + "; expires=" + d.toUTCString();
}
function toggle_theme() {
var links = document.getElementsByTagName("link");
for (var i = 0; i < links.length; i++) {
if (links[i].href.indexOf("stc/style-dark.css") !== -1) {
links[i].href = links[i].href.replace("dark", "light");
cookie_create("pcy_theme=solarized_light");
break;
}
if (links[i].href.indexOf("stc/style-light.css") !== -1) {
links[i].href = links[i].href.replace("light", "dark");
cookie_create("pcy_theme=solarized_dark");
break;
}
}
}
window.onload = function (_) {
var theme = cookie_get("pcy_theme");
if (theme === "solarized_dark") {
toggle_theme();
}
}
$base03: #002b36;
$base02: #073642;
$base01: #586e75;
$base00: #657b83;
$base0: #839496;
$base1: #93a1a1;
$base2: #eee8d5;
$base3: #fdf6e3;
$yellow: #b58900;
$orange: #cb4b16;
$red: #dc322f;
$magenta: #d33682;
$violet: #6c71c4;
$blue: #268bd2;
$cyan: #2aa198;
$green: #859900;
@mixin rebase($rebase03,$rebase02,$rebase01,$rebase00,$rebase0,$rebase1,$rebase2,$rebase3)
{
background-color:$rebase03;
color:$rebase0;
* { color:$rebase0; }
h1,h2,h3,h4,h5,h6 { color:$rebase1; border-color: $rebase0; }
a, a:active, a:visited { color: $rebase1; }
}
@mixin accentize($accent) {
a, a:active, a:visited, code.url { color: $accent; }
h1,h2,h3,h4,h5,h6 {color:$accent}
}
html * {
color-profile: sRGB;
rendering-intent: auto;
}
@import "solarized-base";
html, .dark { @include rebase($base03,$base02,$base01,$base00,$base0,$base1,$base2,$base3) }
@import "solarized-base";
html, .light { @include rebase($base3,$base2,$base1,$base0,$base00,$base01,$base02,$base03) }
@import "solarized-dark";
a {
color: $blue !important;
}
.maintable {
border-collapse: collapse;
border: none;
table-layout: fixed;
}
.left {
width: 20%;
}
.middle {
width: 55%;
}
.right {
padding-right: 10%;
}
.title {
text-decoration: none;
}
.ccimg {
border-width: 0px;
}
@import "solarized-light";
a {
color: $blue !important;
}
.maintable {
border-collapse: collapse;
border: none;
table-layout: fixed;
}
.left {
width: 20%;
}
.middle {
width: 55%;
}
.right {
padding-right: 10%;
}
.title {
text-decoration: none;
}
.ccimg {
border-width: 0px;
}
......@@ -41,11 +41,38 @@ $endfor$
$toc$
</div>
$endif$
$body$
<br />
$if(date)$
<p>Last update: $date$</p>
$endif$
<table class="maintable">
<tr>
<td class="left"></td>
<td>
<h3><a href="/index.html" class="title">lo kibystu pe la poros</a></h3>
</td>
</tr>
<tr>
<td class="left"></td>
<td class="middle">
$body$
</td>
<td class="right">
<p><a href="javascript:toggle_theme();">Toggle theme</a></p>
<br />
<p>Days without lynx compatibility: 0</p>
<br />
<p><a href="https://gitlab.com/PoroCYon/kibystu">Website source and SSG</a></p>
<br />
<h3>license</h3>
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
<img alt="Creative Commons License" class="ccimg" src="/stc/cc-by-sa.png" />
</a>
<br />
This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
<hr />
$if(date)$
<p>Last update: $date$</p>
$endif$
</td>
</tr>
</table>
$for(include-after)$
$include-after$
$endfor$
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment