Hacker News new | past | comments | ask | show | jobs | submit login

Neat! How do I run it? Is it using https://github.com/arclanguage/anarki or something else?



I've tried to keep it Arc-compatible, but I always run it on Anarki.

Run it like `(gensite "path/to/site/base")`. The site root is a folder with the following things in it:

1. a config file `conf.arc`, with config for the site. It has these keys (but I don't think they're all required):

  1. sitename -- title for the homepage

  2. site root -- url; mine is "https://zck.org"

  3. description -- used in the RSS feed.

  4. slogan -- used in the sidebar

  5. navbar-entries-at-top -- extra links at the top, as a hashtable. Mine is ((tagged table ((href "art") (content "my art"))))

  6. mailing-list-cta -- A thing put at the bottom of each page (except the homepage) that is a call-to-action for my mailing list.
2. a folder called `published`. This contains the entries in the site. Each file is the html contents of the body of the entry, and I don't believe it matters what you call the file. Each entry also has a bonus set of options in it, which I'll explain later.

3. a folder `pregenerated` that has things in it copied verbatim over to the output. I use it for things like my favicon, css, images, and some html games (https://zck.org/numberdle/?variant=rationerdle).

4. a folder `frontpage`. This contains entries that do not directly result in a page; they merely result in entries placed on the frontpage and rss feed. They have the same options that the published entries do. I use it for things like announcing when I've given a talk, or launched something that's in `pregenerated`. This can be empty; it just won't generate any entries like this.

5. a folder `codegen`. This folder contains files that contain arc code. Each file, when executed, results in a list of pages. There's some busy work in passing args into it, and getting the results back. Don't start by using this; like `frontpage`, it can be empty, or maybe even nonexistent.

Now, the important part of each page entry -- the "options". This is a serialized arc obj that is put at the top of each entry. It has keys `url-slug`, `title`, `date` (in YYYY-MM-DD format), `navbar` (set it to t to put this entry in the navbar), `frontpage` (the string that gets put in the frontpage for this entry; an <a> link with no href gets set to link to the entry), and `tags` (a list of strings that tag that entry; see https://zck.org/tags).

So my latest entry (https://zck.org/ruby-hashmap-syntax) looks like:

``` file begins

((url-slug ruby-hashmap-syntax) (title "til: Ruby's hashmap syntax") (date "2024-03-20") (navbar t) (frontpage "Ruby's hash syntax is confusing. There are two different syntaxes, and they <a>work surprisingly differently</a>.") (tags ("til" "ruby")))

<div> <p>I was writing some Ruby for the first time, and I made a hashmap with some data in it.</p>

```rest of file snipped

The arc hashtable is not printed as part of the html output; it's only used for its values, and the page itself starts after it. In this case, the page starts at the <div> tag.

I write my blog in Emacs org files, for which I've also written my own org-mode exporter (https://hg.sr.ht/~zck/ox-zhtml). I've done this because the built-in html exporter creates some really ugly html. You shouldn't be able to tell what html exporter created your html; the org one puts in a lot of "org" properties that are terrible.

I'd love to know if you get this working! Feel free to email if you want to talk off-thread or get more help. I'm sure there is more I missed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: