render.sh: add fractional compilation
main.html.m4: fix css import, add hr elements cp README.MD in/doc.md mv main.css main.scss
This commit is contained in:
parent
fb7e77183f
commit
31141ee3dd
|
@ -1,3 +1,4 @@
|
|||
body {
|
||||
font-family: sans-serif;
|
||||
margin-left: 2em;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
# Atlas48's Neocites Archives
|
||||
Welcome to the technical documentation for my [Neocities](https://neocities.org) page, which also contains a rudimentary static site generator cobbled together out of unix tools
|
||||
and Ruby scripts
|
||||
|
||||
# License
|
||||
All markup is licensed under the Creative Commons [Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) license.
|
||||
Any runnable computer code or Sass/CSS definitions are licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
# Specification
|
||||
## Dependencies
|
||||
You will need the following tools to render and upload the site
|
||||
- [neo-cli](https://neo-cli.neocities.org/)
|
||||
- [RedCloth](http://redcloth.org/)
|
||||
- [org-ruby](http://github.com/bdewey/org-ruby)
|
||||
- [comrak](https://github.com/kivikakk/comrak)
|
||||
## `Makefile`
|
||||
Wraps `render.sh` as well as either `neo` or `rclone`.
|
||||
### Makefile Options
|
||||
#### `list`
|
||||
Lists all components in a heading-annotated list
|
||||
#### `list-{doc,sass,dir,rest}`
|
||||
Lists markup files, sass files, directories, and other files respectively.
|
||||
#### `clean`
|
||||
Removes the `out/` directory that is generated on running of `render.sh`.
|
||||
#### `push`
|
||||
Uploads the site to neocities.org.
|
||||
## `render.sh`
|
||||
The primary worker script, sets up the directory structure, transpiles the markup, then the Sass, then copies the contents of `in/` to `out/`
|
|
@ -1,11 +1,14 @@
|
|||
_Welcome to the Atlas48 Archives!_
|
||||
|
||||
!/img/ucbanner.gif(The First Banner)!
|
||||
!img/ucbanner.gif(HOW DO I USE CSS TO MAKE THIS BOOKSTORE LOOK GOOD?!)!
|
||||
|
||||
Everything's slowly being set up and the like, so you'll only be able to access here unless you know the layout.
|
||||
|
||||
I _may_ make a sitemap, I may not. Just getting the infastructure set up.
|
||||
!img/ucbanner.gif(HALP PLIS.)!
|
||||
|
||||
"!neocities.png(Love this place.)!":https://neocities.org./
|
||||
|
||||
h1. Links.
|
||||
|
||||
h2. D&D
|
||||
|
||||
h1. TODO
|
||||
* find a way to render the org-mode files
|
||||
* maybe make an automated sitemap renderer?
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
dnl template.m4.html v1.2
|
||||
dnl template.m4.html v1.3-p1
|
||||
dnl Part of the tape-and-string suite used to construct the website
|
||||
include(`m4/lib.m4')dnl
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
@include "/css/main.css";
|
||||
@import url("/css/main.css");
|
||||
</style>
|
||||
<title>TITLE</title>
|
||||
</head>
|
||||
<body>
|
||||
<hr />
|
||||
<div class="header">
|
||||
<a href="/">/</a>
|
||||
<a href="/">Home</a>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="content">
|
||||
include(`/dev/stdin')dnl Probably not a good idea, but whatever.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
32
render.sh
32
render.sh
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
# render.sh: part of the tape-and-string framework.
|
||||
# v3.0
|
||||
# v3.1
|
||||
enable -f /usr/lib/bash/csv csv
|
||||
declare -A title
|
||||
while read -r ii; do
|
||||
|
@ -41,12 +41,15 @@ scss=(`find in -type f -name '*.scss'`)
|
|||
rest=(`find in -type f ! \( -name '*.org' -o -name '*.txti' -o -name '*.md' -o -name .hg \)`)
|
||||
dir=(`find in -type d`)
|
||||
|
||||
function dirs {
|
||||
inf "Creating directory structure..."
|
||||
echo ${dir[@]}
|
||||
for i in ${dir[@]}; do
|
||||
o="${i/in/out}"
|
||||
mkdir -pv $o
|
||||
done
|
||||
}
|
||||
function docs {
|
||||
inf "Rendering document files..."
|
||||
for i in ${doc[@]}; do
|
||||
o="${i/in/out}"
|
||||
|
@ -57,6 +60,8 @@ for i in ${doc[@]}; do
|
|||
tape $i | m4 -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html
|
||||
fi
|
||||
done
|
||||
}
|
||||
function sass {
|
||||
inf "Rendering sass files..."
|
||||
if test -z "${sass[@]}"; then
|
||||
inf "No .sass files detected, skipping"
|
||||
|
@ -65,7 +70,7 @@ else
|
|||
for i in ${sass[@]}; do
|
||||
o="${i/in/out}"
|
||||
echo "$i => $o"
|
||||
sassc -a $i $o
|
||||
sassc -a $i ${o/sa/c}
|
||||
done
|
||||
fi
|
||||
if test -z "${scss[@]}"; then
|
||||
|
@ -75,8 +80,29 @@ else
|
|||
for i in ${scss[@]}; do
|
||||
o="${i/in/out}"
|
||||
echo "$i => $o"
|
||||
sassc $i $o
|
||||
sassc $i ${o#s}
|
||||
done
|
||||
fi
|
||||
}
|
||||
function other {
|
||||
inf "Copying other files..."
|
||||
cp -rv 'in'/* out/
|
||||
}
|
||||
function all {
|
||||
dirs
|
||||
docs
|
||||
sass
|
||||
other
|
||||
}
|
||||
if test -z "$*"; then
|
||||
all
|
||||
exit 0
|
||||
fi
|
||||
case $1 in
|
||||
dir) dirs;;
|
||||
doc) docs;;
|
||||
s[ac]ss) sass;;
|
||||
other) other;;
|
||||
all) all;;
|
||||
*) all;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue