{"id":13732571,"url":"https://github.com/errilaz/pocketpress","last_synced_at":"2025-11-14T14:30:18.595Z","repository":{"id":65174129,"uuid":"584942023","full_name":"errilaz/pocketpress","owner":"errilaz","description":"PocketPress SSG","archived":false,"fork":false,"pushed_at":"2023-01-31T18:01:44.000Z","size":164,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T08:15:22.644Z","etag":null,"topics":["livescript","static-site-generator"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/errilaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-03T23:04:43.000Z","updated_at":"2023-01-31T23:03:55.000Z","dependencies_parsed_at":"2023-02-16T22:00:19.758Z","dependency_job_id":null,"html_url":"https://github.com/errilaz/pocketpress","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/errilaz%2Fpocketpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/errilaz%2Fpocketpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/errilaz%2Fpocketpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/errilaz%2Fpocketpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/errilaz","download_url":"https://codeload.github.com/errilaz/pocketpress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238941516,"owners_count":19556012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["livescript","static-site-generator"],"created_at":"2024-08-03T03:00:27.403Z","updated_at":"2025-11-14T14:30:18.521Z","avatar_url":"https://github.com/errilaz.png","language":"TypeScript","funding_links":[],"categories":["Links"],"sub_categories":[],"readme":"# PocketPress\n\n\u003e An extremely static site generator\n\nPocketPress is a little zero-config SSG that produces HTML/CSS from a [LiveScript](https://livescript.net)-based DSL.\n\n## Install\n\n```sh \nnpm install pocketpress\n# or\npnpm add pocketpress\n# or\nyarn add pocketpress\n```\n\n## Usage\n\n```\npocket [options] [path]\n  \n  Options:\n    -o, --output \u003cdir\u003e    Output directory\n    -e, --exclude \u003cdir\u003e   Ignore directory\n    -w, --watch           Enter watch mode\n    -h, --help            Display this message\n```\n\nScans a directory tree and transforms `.html.ls` template files into `.html` files, `.css.ls` into `.css`, and `.md.ls` into `.md`.\n\n## HTML Templates\n\nThe `.html.ls` template file should end in an object containing a `page` property:\n\n```ls\npage:\n  html do\n    body do\n      div \"hello world!\"\n      input type: \"checkbox\"\n      table tbody tr do\n        td \"a cell\"\n        td \"another cell\"\n```\n\nAll HTML elements are pre-defined functions. The `var` element is called `_var` to work with JS syntax.\n\n## Class Syntax Sugar\n\nYou can apply classes directly to the element functions:\n\n```ls\ndiv.red-bold \"this is bold and red!\"\ndiv.red-bold.also-italic \"this has two classes!\"\n```\n\n## Styles\n\nStyle tags can use the `rule` block function, and custom properties with `prop`:\n\n```ls\nstyle do\n  rule \".red-bold\",\n    color \"red\"\n    font-weight bold\n    prop \"-some-nonstandard\" \"value\"\n```\n\nAll CSS properties are pre-defined functions. The `continue` property is called `_continue` to work with JS syntax. Known\nvendor-specific properties are also available (without the leading `-`).\n\n## Inline Styles\n\nYou can also use CSS properties directly on elements:\n\n```ls\ndiv do\n  color \"red\"\n  font-weight \"bold\"\n  \"this is bold and red!\"\n```\n\n## Nested Rules\n\nRules may be nested:\n\n```ls\nrule \".danger\",\n  color \"red\"\n  rule \".icon\",\n    float \"right\"\n```\n\nChild selectors can be combined with the parent selector, similar to Sass and Less.js. This results in a second rule with the selector `.danger.large`:\n\n```ls\nrule \".danger\",\n  color \"red\"\n  rule \"\u0026.large\",\n    font-size \"30px\"\n```\n\nNested selectors with pseudo-classes do the same:\n\n```ls\nrule \"a\",\n  color \"red\"\n  rule \":hover\",\n    text-decoration \"underline\"\n```\n\nPocketPress detects multiple selectors in a rule and will generate the necessary CSS:\n\n```ls\nrule \"input, textarea\",\n  border \"solid 1px gray\"\n  rule \":hover, :focus\",\n    border-color \"black\"\n```\n\n## At-rules\n\nMedia queries and other [at-rules](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule) are supported\nwith the `$` prefix: \n\n```ls\n$media \"(prefers-color-scheme: dark)\",\n  rule \":root\",\n    prop \"--fg\" \"white\"\n    prop \"--bg\" \"black\"\n```\n\n```ls\n$layer do\n  rule \"p\",\n    color \"red\"\n```\n\n## CSS Templates\n\n`.css.ls` files simply use the `stylesheet` function as the top level. Note this must also be the last expression in the file:\n\n```ls\nstylesheet do\n  rule \".danger\",\n    color \"red\"\n    font-weight \"bold\"\n```\n\n## Layouts \u0026 Partials\n\nLayouts and partials can be defined as `.ls` files:\n\n`layout.ls`\n```ls\n(_title, _content) -\u003e\n  html do\n    head\n      title _title\n    body do\n      \"My Site\"\n      main _content\n```\n\n`partial.ls`\n```ls\np \"this is a partial!\"\n```\n\nand used within a `.html.ls` file with `include`:\n\n```ls\nlayout = include \"layout.ls\"\n\npage: layout \"My Page\",\n  \"this is my page!\"\n  include \"partial.ls\"\n```\n\n`include` understands `~/` at the beginning of the path as relative to the site root.\n\n## Page Metadata\n\nMore properties can be specified beside the `page` result. If the `page` is a function,\nthese and other useful properties will be passed to it:\n\n```ls\ndate: \"2023-01-21\"\ntitle: \"This is a blog entry!\"\nsummary: \"This is a summary used in feeds!\"\nauthor: \"errilaz\"\ntags: \u003c[ birthday ]\u003e\nmap: true\nfeed: true\npage: ({ date, title, author, tags, url, site, previous, next }) -\u003e div do\n  h1 \"#title by #author\"\n```\n\n- `date` will be transformed into an instance of `Date`.\n- `url` contains the path to the resulting html file.\n- `site.templates` contains the metadata for all `.html.ls` templates.\n- `site.authors` contains a list of `{ name, templates }` organized by author.\n- `site.tags` contains a list of `{ name, templates }` organized by tag.\n- `previous` and `next` contain the metadata for adjacent dated pages.\n\n## Tag Pages\n\nA file named `[tag].html.ls` will generate a page per tag, passing a `tag` property to\nthe page function. You can use `tag.name` and `tag.templates` to generate a tag index.\n\n```ls\npage: ({ tag }) -\u003e div do\n  h1 \"Articles tagged \\\"#{tag.name}\\\"\"\n  ul tag.templates.map -\u003e\n    li a href: \"#{it.url}\", it.title\n```\n\n## Live Reload\n\n`live-reload!` embeds a script tag in watch mode which will check and reload pages. This is meant to be used with local `file:///` URLs as embedding a web server for this feature seemed excessive. If this is used, please add `.live-reload.js` to your source control ignore file.\n\n`link-to` is a helper function which will, in watch mode, produce `file:` URLs based on root-relative paths. It will append `index.html` to paths ending in `/` (apart from the root `/`). This way links can be followed in watch mode. Outside of watch mode, the trailing slash will simply be dropped. \n\n## Embedded Markdown\n\nMarkdown can be embedded (uses the fast [marked](https://marked.js.org) library):\n\n```ls\nmarkdown \"\"\"\n  - this is a\n  - simple\n  - list!\n\"\"\"\n```\n\n## LiveScript client side\n\n`livescript` embeds a script tag with compiled LiveScript:\n\n```ls\nlivescript \"\"\"\n  console.log \\hello\n\"\"\"\n```\n\n## Other functions\n\n`raw` includes un-escaped HTML content.\n\n`elem` creates a custom element with the given tag and contents.\n\n`load-file` synchronously reads a file relative to the current file. You can use `~/` at the start of the path to refer to the site root.\n\n`quote` is a helper to wrap a CSS string in `\"` characters and escape the contents.\n\n## Site Metadata\n\nPocketPress will look for a `package.json` at the root, and if `pocket.baseUrl` field is populated, will use it to produce `/robots.txt`, `/sitemap.xml`, `/feed.xml` (Atom), and `/feed.json`:\n\n```json\n  \"pocket\": {\n    \"baseUrl\": \"https://example.com\",\n    \"title\": \"Appears as title in feeds\"\n  }\n```\n\nAny page containing the `date` metadata will be included in the feed, unless `feed: false` is also specified. Pages can be opted-in to the sitemap with `map: true`.\n\n## Markdown Document Generator\n\nStandalone `.md` documents can also be generated with `.md.ls` files. This is useful for READMEs containing repeated content or complex tables.\n\nThe `page` property is not used, instead use the `document` function:\n\n```ls\ndont-repeat-yourself = \"something you want to embed over and over\"\n\ndocument do\n  raw \"\"\"\n    # My Project\n  \"\"\"\n  table tbody do\n    tr do\n      td \"easy to maintain tables\"\n      td dont-repeat-yourself\n      td dont-repeat-yourself\n```\n\n## VSCode Settings\n\nFor less clutter, you can collapse generated files in Visual Studio Code with these settings:\n\n```json\n  \"explorer.fileNesting.enabled\": true,\n  \"explorer.fileNesting.patterns\": {\n    \"*.html.ls\": \"$(capture).html\",\n    \"*.css.ls\": \"$(capture).html\",\n    \"*.md.ls\": \"$(capture).md\",\n    \"[tag].html.ls\": \"*.html\",\n    \"index.html.ls\": \"sitemap.xml, robots.txt, feed.json, feed.xml\",\n  },\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferrilaz%2Fpocketpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferrilaz%2Fpocketpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferrilaz%2Fpocketpress/lists"}