This commit is contained in:
kitsunecafe 2024-02-20 06:42:49 -05:00
parent 2c9d03bc44
commit b040598c56
28 changed files with 1060 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.env
out/

10
generate.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
if [ -f ".env" ]; then
source .env
rm -rf "${OUT}/*"
../roxy-cli/target/debug/roxy_cli ${IN} ${OUT}
echo "$CNAME" > "${OUT}/CNAME"
fi

15
gh-pages.sh Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
if [ -f ".env" ]; then
source .env
rm -rf "$OUT"
git worktree add "$OUT" "$GH_PAGES_BRANCH"
./generate.sh
(cd "$OUT"; git add -f .)
(cd "$OUT"; git commit -m "Built from $(git log '--format=format:%H' main -1)")
git push origin "$GH_PAGES_BRANCH"
git worktree remove "$OUT"
fi

6
in/index.md Normal file
View file

@ -0,0 +1,6 @@
{% extends "../layouts/index.tera" %}
{% block main %}
# Roxy
{% endblock main %}

0
in/index.toml Normal file
View file

View file

@ -0,0 +1,19 @@
{% extends "../../../layouts/topic.tera" %}
{% block content %}
`roxy-cli` uses a configuration file in the root of the project directory, `config.toml`.
```toml
[roxy]
slug_word_limit = 8 # the max word limit for a slug
[syntect]
theme = "base16-ocean.dark" # the name of the theme for syntax highlighting
theme_dir = "./themes" # directory to load themes into syntect
```
* `roxy.slug_wold_limit` limits the amount of words during slug generation
* `syntect.theme` is the key that should be used for syntax highlighting
* `syntect.theme_dir` is the directory that should be read and loaded to find syntax themes
{% endblock content %}

View file

@ -0,0 +1,4 @@
title = "Configuration"
type = "page"
order = 0

0
in/pages/guides/index.md Normal file
View file

View file

@ -0,0 +1,4 @@
title = "Guides"
type = "category"
order = 3

13
in/pages/overview.md Normal file
View file

@ -0,0 +1,13 @@
{% extends "../../layouts/topic.tera" %}
{% block content %}
Roxy is a static site generator. The hope is that using it will reduce the amount of boilerplate HTML that usually comes with handwriting static websites.
[roxy-cli](https://fem.mint.lgbt/kitsunecafe/roxy-cli) is a tool written using the [roxy-core](https://fem.mint.lgbt/kitsunecafe/roxy-core) which achieves the above goal by using markdown and templating. The default parsers are
* [pulldown_cmark](https://docs.rs/pulldown-cmark/0.10.0/pulldown_cmark/) for Markdown to HTML
* [Tera](https://docs.rs/tera/1.19.1/tera/index.html) for templating
* [Syntect](https://docs.rs/syntect/5.2.0/syntect/index.html) for syntax highlighting
This tool was written for my use case and there is a high chance it may not support yours. In that case, do some combination of the following things: open an issue against `roxy-cli`, write your own generator using `roxy-core`, or find another generator (it won't hurt my feelings, promise).
{% endblock content %}

4
in/pages/overview.toml Normal file
View file

@ -0,0 +1,4 @@
title = "Overview"
type = "page"
order = 0

84
in/pages/quick-start.md Normal file
View file

@ -0,0 +1,84 @@
{% extends "../../layouts/topic.tera" %}
{% block content %}
## Your first page
We're going to speedrun making your first site with Roxy.
Create a new directory for the project.
```bash
mkdir my-new-site
cd my-new-site
```
Create two direcroties in your new project, one for input and one for output.
```bash
mkdir {input,output}
```
Create a new file with some markdown content in `input` to add a page.
```bash
touch input/index.md
cat << EOF > input/index.md
# Hello, world!
This is my new site!
EOF
```
Build the site with `roxy-cli`.
```bash
roxy-cli ./input/ ./output/
```
Host the content and view it.
```bash
cd output
python3 -m http.server # visit localhost:8000 with your browser
```
## Adding a layout
At the top level of your project, create a new directory and add a new file. We don't want this being built with the rest of the content.
```bash
mkdir layouts
touch layouts/base.tera
```
Let's add some boilerplate HTML to `layouts/base.tera`
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My New Site!</title>
</head>
<body>{% raw -%}
{% block body %}{% endblock body %}{% endraw %}
</body>
</html>
```
The `{% raw %}{% ... %}{% endraw %}` bit is the [Tera templating language](https://keats.github.io/tera/docs/) (it's meant to look like Jinja, if you're familiar with that). This syntax is how we do fun templating things -- in this case, we're creating a `block` that other pages can fill later.
Let's go back to `input/index.md` and use this layout.
```md
{%- raw -%}{% extends "../layouts/base.tera" %}
{% block body %}{% endraw -%}
# Hello, world!
This is my new site!{% raw -%}
{% endblock body %}{% endraw -%}
```
Build the site again, host it, and look at the result. There should be a title that says "My New Site!" and the content should be the same. Check out the `output` folder to get an idea of how Roxy builds and structures files.
Tera has many more features to explore, so I'd highly recommend looking at the [documentation](https://keats.github.io/tera/docs/).
{% endblock content %}

View file

@ -0,0 +1,4 @@
title = "Quick start"
type = "page"
order = 1

108
in/static/css/nav.css Normal file
View file

@ -0,0 +1,108 @@
aside.navigation {
background-color: var(--primary-color);
color: var(--font-color-primary);
padding-left: 2rem;
padding-right: 2rem;
width: 100%;
}
.logo {
display: inline-block;
font-weight: bold;
}
.hamburger {
--size: 4rem;
width: var(--size);
height: var(--size);
cursor: pointer;
float: right;
padding: 36px 20px;
}
.hamburger-line {
background: var(--white);
display: block;
height: 2px;
position: relative;
width: 24px;
}
.hamburger-line::before,
.hamburger-line::after{
background: var(--white);
content: '';
display: block;
height: 100%;
position: absolute;
transition: all .2s ease-out;
width: 100%;
}
.hamburger-line::before{
top: 5px;
}
.hamburger-line::after{
top: -5px;
}
.menu {
max-height: 0;
transition: height .5s ease-out;
overflow: hidden;
}
.logo {
padding-top: 1rem;
}
#menu-toggle {
display: none;
}
#menu-toggle:checked ~ nav.menu {
max-height: 100%;
}
#menu-toggle:checked ~ .hamburger .hamburger-line {
background: transparent;
}
#menu-toggle:checked ~ .hamburger .hamburger-line::before {
transform: rotate(-45deg);
top: 0;
}
#menu-toggle:checked ~ .hamburger .hamburger-line::after {
transform: rotate(45deg);
top: 0;
}
.menu-item-list {
list-style: none;
padding-left: 2rem;
font-size: calc(var(--default-font-size) * 1.1);
border-left: 1px solid var(--softer-white);
line-height: 4rem;
}
.menu-item-list a {
text-decoration: none;
}
/* Desktop styling */
@media only screen and (min-width: 768px) {
aside.navigation {
height: 100%;
max-width: 25rem;
}
.menu {
max-height: 100%;
max-width: 25rem;
}
#menu-toggle, .hamburger {
display: none;
}
}

129
in/static/css/style.css Normal file
View file

@ -0,0 +1,129 @@
@import "/static/fonts/roboto_regular/stylesheet.css";
@import "/static/fonts/spacemono_bold/stylesheet.css";
@import "/static/css/nav.css";
/* Variables */
:root {
--black: #000000;
--soft-black: #181a1b;
--softer-black: #282828;
--softest-black: #323232;
--white: #ffffff;
--soft-white: #d7d3ce;
--softer-white: #969696;
--indigo: #4b0082;
--background-color: var(--soft-black);
--foreground-color: var(--softest-black);
--primary-color: var(--indigo);
--default-font-size: 1.4rem;
--desktop-font-size: 1.8rem;
--font-color-primary: var(--white);
--font-family-paragraph: "robotoregular", sans-serif;
--font-color-secondary: var(--white);
--font-family-header: sans-serif;
--link-color: var(--soft-white);
}
/* Boilerplate */
@media (prefers-reduced-motion: no-preference) {
html {
scroll-behavior: smooth;
}
}
:focus:not(:focus-visible) {
outline: none;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
height: 100%;
text-rendering: optimizeLegibility;
font-kerning: normal;
line-height: 2rem;
}
html {
font-size: 62.5%;
}
a {
text-underline-position: under;
text-decoration-thickness: 8;
}
pre {
padding: 0.5rem;
}
img {
display: block;
max-width: 100%;
}
label,
button,
select,
summary,
[type=radio],
[type=submit],
[type=checkbox] {
cursor: pointer;
}
article ol,
article ul {
list-style-position: inside;
}
/* Styling */
body {
background-color: var(--background-color);
color: var(--font-color-primary);
font-family: var(--font-family-paragraph);
font-size: var(--default-font-size);
-webkit-text-size-adjust: none;
text-size-adjust: none;
display: flex;
flex-direction: column;
}
@media only screen and (min-width: 768px) {
body {
flex-direction: row;
font-size: var(--desktop-font-size);
}
}
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-family-header);
}
main {
padding: 2rem;
width: 100%;
overflow: auto;
padding-bottom: 8rem;
}
a { color: var(--link-color); }
a:hover { color: var(--link-color); }
a:visited { color: var(--link-color); }
a:active { color: var(--link-color); }

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View file

@ -0,0 +1,129 @@
/*Notes about grid:
Columns: 12
Grid Width: 825px
Column Width: 55px
Gutter Width: 15px
-------------------------------*/
.section {margin-bottom: 18px;
}
.section:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;}
.section {*zoom: 1;}
.section .firstcolumn,
.section .firstcol {margin-left: 0;}
/* Border on left hand side of a column. */
.border {
padding-left: 7px;
margin-left: 7px;
border-left: 1px solid #eee;
}
/* Border with more whitespace, spans one column. */
.colborder {
padding-left: 42px;
margin-left: 42px;
border-left: 1px solid #eee;
}
/* The Grid Classes */
.grid1, .grid1_2cols, .grid1_3cols, .grid1_4cols, .grid2, .grid2_3cols, .grid2_4cols, .grid3, .grid3_2cols, .grid3_4cols, .grid4, .grid4_3cols, .grid5, .grid5_2cols, .grid5_3cols, .grid5_4cols, .grid6, .grid6_4cols, .grid7, .grid7_2cols, .grid7_3cols, .grid7_4cols, .grid8, .grid8_3cols, .grid9, .grid9_2cols, .grid9_4cols, .grid10, .grid10_3cols, .grid10_4cols, .grid11, .grid11_2cols, .grid11_3cols, .grid11_4cols, .grid12
{margin-left: 15px;float: left;display: inline; overflow: hidden;}
.width1, .grid1, .span-1 {width: 55px;}
.width1_2cols,.grid1_2cols {width: 20px;}
.width1_3cols,.grid1_3cols {width: 8px;}
.width1_4cols,.grid1_4cols {width: 2px;}
.input_width1 {width: 49px;}
.width2, .grid2, .span-2 {width: 125px;}
.width2_3cols,.grid2_3cols {width: 31px;}
.width2_4cols,.grid2_4cols {width: 20px;}
.input_width2 {width: 119px;}
.width3, .grid3, .span-3 {width: 195px;}
.width3_2cols,.grid3_2cols {width: 90px;}
.width3_4cols,.grid3_4cols {width: 37px;}
.input_width3 {width: 189px;}
.width4, .grid4, .span-4 {width: 265px;}
.width4_3cols,.grid4_3cols {width: 78px;}
.input_width4 {width: 259px;}
.width5, .grid5, .span-5 {width: 335px;}
.width5_2cols,.grid5_2cols {width: 160px;}
.width5_3cols,.grid5_3cols {width: 101px;}
.width5_4cols,.grid5_4cols {width: 72px;}
.input_width5 {width: 329px;}
.width6, .grid6, .span-6 {width: 405px;}
.width6_4cols,.grid6_4cols {width: 90px;}
.input_width6 {width: 399px;}
.width7, .grid7, .span-7 {width: 475px;}
.width7_2cols,.grid7_2cols {width: 230px;}
.width7_3cols,.grid7_3cols {width: 148px;}
.width7_4cols,.grid7_4cols {width: 107px;}
.input_width7 {width: 469px;}
.width8, .grid8, .span-8 {width: 545px;}
.width8_3cols,.grid8_3cols {width: 171px;}
.input_width8 {width: 539px;}
.width9, .grid9, .span-9 {width: 615px;}
.width9_2cols,.grid9_2cols {width: 300px;}
.width9_4cols,.grid9_4cols {width: 142px;}
.input_width9 {width: 609px;}
.width10, .grid10, .span-10 {width: 685px;}
.width10_3cols,.grid10_3cols {width: 218px;}
.width10_4cols,.grid10_4cols {width: 160px;}
.input_width10 {width: 679px;}
.width11, .grid11, .span-11 {width: 755px;}
.width11_2cols,.grid11_2cols {width: 370px;}
.width11_3cols,.grid11_3cols {width: 241px;}
.width11_4cols,.grid11_4cols {width: 177px;}
.input_width11 {width: 749px;}
.width12, .grid12, .span-12 {width: 825px;}
.input_width12 {width: 819px;}
/* Subdivided grid spaces */
.emptycols_left1, .prepend-1 {padding-left: 70px;}
.emptycols_right1, .append-1 {padding-right: 70px;}
.emptycols_left2, .prepend-2 {padding-left: 140px;}
.emptycols_right2, .append-2 {padding-right: 140px;}
.emptycols_left3, .prepend-3 {padding-left: 210px;}
.emptycols_right3, .append-3 {padding-right: 210px;}
.emptycols_left4, .prepend-4 {padding-left: 280px;}
.emptycols_right4, .append-4 {padding-right: 280px;}
.emptycols_left5, .prepend-5 {padding-left: 350px;}
.emptycols_right5, .append-5 {padding-right: 350px;}
.emptycols_left6, .prepend-6 {padding-left: 420px;}
.emptycols_right6, .append-6 {padding-right: 420px;}
.emptycols_left7, .prepend-7 {padding-left: 490px;}
.emptycols_right7, .append-7 {padding-right: 490px;}
.emptycols_left8, .prepend-8 {padding-left: 560px;}
.emptycols_right8, .append-8 {padding-right: 560px;}
.emptycols_left9, .prepend-9 {padding-left: 630px;}
.emptycols_right9, .append-9 {padding-right: 630px;}
.emptycols_left10, .prepend-10 {padding-left: 700px;}
.emptycols_right10, .append-10 {padding-right: 700px;}
.emptycols_left11, .prepend-11 {padding-left: 770px;}
.emptycols_right11, .append-11 {padding-right: 770px;}
.pull-1 {margin-left: -70px;}
.push-1 {margin-right: -70px;margin-left: 18px;float: right;}
.pull-2 {margin-left: -140px;}
.push-2 {margin-right: -140px;margin-left: 18px;float: right;}
.pull-3 {margin-left: -210px;}
.push-3 {margin-right: -210px;margin-left: 18px;float: right;}
.pull-4 {margin-left: -280px;}
.push-4 {margin-right: -280px;margin-left: 18px;float: right;}

View file

@ -0,0 +1,396 @@
@import url('grid_12-825-55-15.css');
/*
CSS Reset by Eric Meyer - Released under Public Domain
http://meyerweb.com/eric/tools/css/reset/
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table,
caption, tbody, tfoot, thead, tr, th, td
{margin: 0;padding: 0;border: 0;outline: 0;
font-size: 100%;vertical-align: baseline;
background: transparent;}
body {line-height: 1;}
ol, ul {list-style: none;}
blockquote, q {quotes: none;}
blockquote:before, blockquote:after,
q:before, q:after {content: ''; content: none;}
:focus {outline: 0;}
ins {text-decoration: none;}
del {text-decoration: line-through;}
table {border-collapse: collapse;border-spacing: 0;}
body {
color: #000;
background-color: #dcdcdc;
}
a {
text-decoration: none;
color: #1883ba;
}
h1{
font-size: 32px;
font-weight: normal;
font-style: normal;
margin-bottom: 18px;
}
h2{
font-size: 18px;
}
#container {
width: 865px;
margin: 0px auto;
}
#header {
padding: 20px;
font-size: 36px;
background-color: #000;
color: #fff;
}
#header span {
color: #666;
}
#main_content {
background-color: #fff;
padding: 60px 20px 20px;
}
#footer p {
margin: 0;
padding-top: 10px;
padding-bottom: 50px;
color: #333;
font: 10px Arial, sans-serif;
}
.tabs {
width: 100%;
height: 31px;
background-color: #444;
}
.tabs li {
float: left;
margin: 0;
overflow: hidden;
background-color: #444;
}
.tabs li a {
display: block;
color: #fff;
text-decoration: none;
font: bold 11px/11px 'Arial';
text-transform: uppercase;
padding: 10px 15px;
border-right: 1px solid #fff;
}
.tabs li a:hover {
background-color: #00b3ff;
}
.tabs li.active a {
color: #000;
background-color: #fff;
}
div.huge {
font-size: 300px;
line-height: 1em;
padding: 0;
letter-spacing: -.02em;
overflow: hidden;
}
div.glyph_range {
font-size: 72px;
line-height: 1.1em;
}
.size10{ font-size: 10px; }
.size11{ font-size: 11px; }
.size12{ font-size: 12px; }
.size13{ font-size: 13px; }
.size14{ font-size: 14px; }
.size16{ font-size: 16px; }
.size18{ font-size: 18px; }
.size20{ font-size: 20px; }
.size24{ font-size: 24px; }
.size30{ font-size: 30px; }
.size36{ font-size: 36px; }
.size48{ font-size: 48px; }
.size60{ font-size: 60px; }
.size72{ font-size: 72px; }
.size90{ font-size: 90px; }
.psample_row1 { height: 120px;}
.psample_row1 { height: 120px;}
.psample_row2 { height: 160px;}
.psample_row3 { height: 160px;}
.psample_row4 { height: 160px;}
.psample {
overflow: hidden;
position: relative;
}
.psample p {
line-height: 1.3em;
display: block;
overflow: hidden;
margin: 0;
}
.psample span {
margin-right: .5em;
}
.white_blend {
width: 100%;
height: 61px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVkAAAA9CAYAAAAH4BojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAO1JREFUeNrs3TsKgFAMRUE/eer+NxztxMYuEWQG3ECKwwUF58ycAKixOAGAyAKILAAiCyCyACILgMgCiCyAyAIgsgAiCyCyAIgsgMgCiCwAIgsgsgAiC4DIAogsACIL0CWuZ3UGgLrIhjMA1EV2OAOAJQtgyQLwjOzmDAAiCyCyAIgsQFtkd2cAEFkAkQVAZAHaIns4A4AlC2DJAiCyACILILIAiCzAV5H1dQGAJQsgsgCILIDIAvwisl58AViyAJYsACILILIAIgvAe2T9EhxAZAFEFgCRBeiL7HAGgLrIhjMAWLIAliwAt1OAAQDwygTBulLIlQAAAABJRU5ErkJggg==);
position: absolute;
bottom: 0;
}
.black_blend {
width: 100%;
height: 61px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVkAAAA9CAYAAAAH4BojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPJJREFUeNrs3TEKhTAQRVGjibr/9QoxhY2N3Ywo50A28IrLwP9g6b1PAMSYTQAgsgAiC4DIAogsgMgCILIAIgsgsgCILIDIAogsACILILIAIguAyAKILIDIAiCyACILgMgCZCnjLWYAiFGvB0BQZJsZAFyyAC5ZAO6RXc0AILIAIguAyAKkRXYzA4DIAogsACILkBbZ3QwALlkAlywAIgsgsgAiC4DIArwVWf8uAHDJAogsACILILIAv4isH74AXLIALlkARBZAZAFEFoDnyPokOIDIAogsACILkBfZZgaAuMhWMwC4ZAE+p4x3mAEgxinAAJ+XBbPWGkwAAAAAAElFTkSuQmCC);
position: absolute;
bottom: 0;
}
.fullreverse {
background: #000 !important;
color: #fff !important;
margin-left: -20px;
padding-left: 20px;
margin-right: -20px;
padding-right: 20px;
padding: 20px;
margin-bottom:0;
}
.sample_table td {
padding-top: 3px;
padding-bottom:5px;
padding-left: 5px;
vertical-align: middle;
line-height: 1.2em;
}
.sample_table td:first-child {
background-color: #eee;
text-align: right;
padding-right: 5px;
padding-left: 0;
padding: 5px;
font: 11px/12px "Courier New", Courier, mono;
}
code {
white-space: pre;
background-color: #eee;
display: block;
padding: 10px;
margin-bottom: 18px;
overflow: auto;
}
.bottom,.last {margin-bottom:0 !important; padding-bottom:0 !important;}
.box {
padding: 18px;
margin-bottom: 18px;
background: #eee;
}
.reverse,.reversed { background: #000 !important;color: #fff !important; border: none !important;}
#bodycomparison {
position: relative;
overflow: hidden;
font-size: 72px;
height: 90px;
white-space: nowrap;
}
#bodycomparison div{
font-size: 72px;
line-height: 90px;
display: inline;
margin: 0 15px 0 0;
padding: 0;
}
#bodycomparison div span{
font: 10px Arial;
position: absolute;
left: 0;
}
#xheight {
float: none;
position: absolute;
color: #d9f3ff;
font-size: 72px;
line-height: 90px;
}
.fontbody {
position: relative;
}
.arialbody{
font-family: Arial;
position: relative;
}
.verdanabody{
font-family: Verdana;
position: relative;
}
.georgiabody{
font-family: Georgia;
position: relative;
}
/* @group Layout page
*/
#layout h1 {
font-size: 36px;
line-height: 42px;
font-weight: normal;
font-style: normal;
}
#layout h2 {
font-size: 24px;
line-height: 23px;
font-weight: normal;
font-style: normal;
}
#layout h3 {
font-size: 22px;
line-height: 1.4em;
margin-top: 1em;
font-weight: normal;
font-style: normal;
}
#layout p.byline {
font-size: 12px;
margin-top: 18px;
line-height: 12px;
margin-bottom: 0;
}
#layout p {
font-size: 14px;
line-height: 21px;
margin-bottom: .5em;
}
#layout p.large{
font-size: 18px;
line-height: 26px;
}
#layout .sidebar p{
font-size: 12px;
line-height: 1.4em;
}
#layout p.caption {
font-size: 10px;
margin-top: -16px;
margin-bottom: 18px;
}
/* @end */
/* @group Glyphs */
#glyph_chart div{
background-color: #d9f3ff;
color: black;
float: left;
font-size: 36px;
height: 1.2em;
line-height: 1.2em;
margin-bottom: 1px;
margin-right: 1px;
text-align: center;
width: 1.2em;
position: relative;
padding: .6em .2em .2em;
}
#glyph_chart div p {
position: absolute;
left: 0;
top: 0;
display: block;
text-align: center;
font: bold 9px Arial, sans-serif;
background-color: #3a768f;
width: 100%;
color: #fff;
padding: 2px 0;
}
#glyphs h1 {
font-family: Arial, sans-serif;
}
/* @end */
/* @group Installing */
#installing {
font: 13px Arial, sans-serif;
}
#installing p,
#glyphs p{
line-height: 1.2em;
margin-bottom: 18px;
font: 13px Arial, sans-serif;
}
#installing h3{
font-size: 15px;
margin-top: 18px;
}
/* @end */
#rendering h1 {
font-family: Arial, sans-serif;
}
.render_table td {
font: 11px "Courier New", Courier, mono;
vertical-align: middle;
}

View file

@ -0,0 +1,12 @@
@font-face {
font-family: 'robotoregular';
src: url('roboto-regular-webfont.eot');
src: url('roboto-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('roboto-regular-webfont.woff') format('woff'),
url('roboto-regular-webfont.ttf') format('truetype'),
url('roboto-regular-webfont.svg#robotoregular') format('svg');
font-weight: normal;
font-style: normal;
}

23
includes/macros.html Normal file
View file

@ -0,0 +1,23 @@
{% macro menu_items(key="") %}
{% for page in pages | get(key=key, default=pages) | unzip | filter(attribute="1.order") | sort(attribute="1.order") %}
{% set parent = key %}
{% set key = page.0 %}
{% set value = page.1 %}
{% if value.type and value.type == "page" %}
<li><a href="{{value.path}}">{{value.title}}</a></li>
{% elif value.type and value.type == "category" %}
{% set next = [parent, key] | join(sep=".") | trim_start_matches(pat=".") %}
</menu>
<details open>
<summary>
{{value.title}}
</summary>
<menu class="menu-item-list">
{{ self::menu_items(key=next) }}
</menu>
</details>
<menu class="menu-item-list">
{% endif %}
{% endfor %}
{% endmacro category %}

View file

@ -0,0 +1,2 @@
<input type="checkbox" id="menu-toggle"/>
<label class="hamburger" for="menu-toggle"><span class="hamburger-line"></span></label>

14
includes/nav.html Normal file
View file

@ -0,0 +1,14 @@
{% import "macros.html" as macros %}
<aside class="navigation">
<div class="logo">
<h1>Roxy</h1>
</div>
{% include "menu-toggle.html" %}
<nav class="menu">
<menu class="menu-item-list">
{{ macros::menu_items() }}
</menu>
</nav>
</aside>

27
inotify.sh Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
if [ -f ".env" ]; then
source .env
if [ -z "$(which inotifywait)" ]; then
echo "inotifywait not installed."
echo "In most distros, it is available in the inotify-tools package."
exit 1
fi
counter=0;
function execute() {
counter=$((counter+1))
echo "Detected change n. $counter"
"$@"
}
echo "watching $WATCH"
inotifywait --recursive --monitor --format "%e %w%f" \
--event modify,move,create,delete $(echo $WATCH) \
| while read changed; do
echo $changed
"$@"
done
fi

18
layouts/base.tera Normal file
View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{% block title %}Roxy{% endblock title %}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
{% endblock head %}
</head>
<body>
{% block body %}
{% endblock body %}
</body>
</html>

11
layouts/index.tera Normal file
View file

@ -0,0 +1,11 @@
{% extends "../layouts/base.tera" %}
{% import "../includes/macros.html" as macros %}
{% block body %}
{% include "../includes/nav.html" %}
<main>
{% block main %}
{% endblock main %}
</main>
{% endblock body %}

9
layouts/topic.tera Normal file
View file

@ -0,0 +1,9 @@
{% extends "index.tera" %}
{% block main %}
<h1>{% block title %}{{ this.title }}{% endblock title %}</h1>
<div>
{% block content %}{% endblock content %}
</div>
{% endblock main %}

17
start.sh Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
terminate() {
pkill -9 -P "$build" > /dev/null
}
if [ -f ".env" ]; then
source .env
trap terminate SIGHUP SIGINT SIGQUIT SIGTERM
./inotify.sh "./generate.sh" &
build=$!
./generate.sh
cd "$OUT"
python3 -m http.server
fi