diff options
author | ubq323 <ubq323@ubq323.website> | 2023-04-15 04:11:20 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-04-15 04:11:20 +0100 |
commit | 5358e5164e29aee379e58c2408110caf78eb8fd8 (patch) | |
tree | 5203e4f340037acb91b6937b2e712a55cb0dd293 | |
parent | b66a5abb3a8dce90b7aee1add23d8bcc9240420e (diff) |
bloggous things. infrastructure.
-rw-r--r-- | blog/test-post.lua | 27 | ||||
-rwxr-xr-x | build.sh | 3 | ||||
-rw-r--r-- | h.lua | 45 | ||||
-rw-r--r-- | head.html | 7 |
4 files changed, 60 insertions, 22 deletions
diff --git a/blog/test-post.lua b/blog/test-post.lua new file mode 100644 index 0000000..c6cbd84 --- /dev/null +++ b/blog/test-post.lua @@ -0,0 +1,27 @@ +require'h' + +head = mkhead'reblogcca' + + + +top = header { + img({id='me',src='/me.png'},''), + h1 'rebecca blog', + p [[ there is some text here ]], +} + +breadcrumbs = bcrumb { + + {'< home','/'}, + {'rebecca blog','/blog'}, + {'what do i mean by "telephone"'} +} + +sect = section { + h2 'what do i mean by "telephone"'; + p(blorem()); +} + +print(html{ + head, top, breadcrumbs, sect, +}) @@ -32,11 +32,10 @@ md () { } bpn index -#cf icons cf bg.png cf me.png md blog/ -bpn blog/first_post +bpn blog/test-post cf 4d.html @@ -88,7 +88,7 @@ function qw(s) for a in s:gmatch("%w+") do table.insert(t,a) end return t end -local tnames = qw"h1 h2 p b ul li dl dt dd div section header figure figcaption img title" +local tnames = qw"h1 h2 p b ul ol li dl dt dd div section header figure figcaption img title nav" for _,n in ipairs(tnames) do _G[n] = tagfn(n) end @@ -110,22 +110,33 @@ function mkhead(t) } end --- the box at the top with the cool picture of me in, etc --- presumably the same on all pages -site_top = header { - img({id="me",src="/me.png"},""), - h1 "ubq323's website", - p [[rebecca, "ubq323" (she/her, 20) - eminently engromulent]], -} +function mktopbox(imgsrc,name,rest) + return header { + img({id='me',src=imgsrc},''), + h1(name), + rest + } +end +function bcrumb(items) + -- items are {text,href} + local lis = {} + for _,it in ipairs(items) do + if it[2] then + table.insert(lis, li(a(it[1],it[2]))) + else + table.insert(lis,li(it[1])) + end + end + return nav( + {class='breadcrumb',['aria-label']='Breadcrumb'}, + ol(lis) + ) +end -function blogpost(meta, content) - -- creates a whole page +-- the box at the top with the cool picture of me in, etc +-- presumably the same on all pages +site_top = mktopbox('/me.png',"ubq323's website", + p [[rebecca, "ubq323" (she/her, 20) - eminently engromulent]] +) - return { - mkhead(meta.title), - site_top, - section(content), - -- maybe footer? - } -end @@ -12,7 +12,8 @@ header {display:grid;grid-template-columns:1fr 3fr;} #me {max-width:100%;grid-row: 1/3;grid-column:1;margin:auto} header * {margin:auto} header p {padding:1em} - -#things {display:flex} -#things div {flex:1;border:1px solid black} +.breadcrumb {font-size:smaller;} +.breadcrumb ol {list-style:none;padding-left:1em} +.breadcrumb li {display:inline;} +.breadcrumb li+li::before {content:"|\00a0";padding:4px;} </style> |