Skip to content

Commit

Permalink
Rename to xiteup
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Sep 7, 2021
1 parent 5747438 commit 2b3e89d
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 21 deletions.
65 changes: 59 additions & 6 deletions README.md
@@ -1,18 +1,71 @@
# siteup
[![Actions Status](https://github.com/bcomnes/siteup/workflows/tests/badge.svg)](https://github.com/bcomnes/siteup/actions)
# xiteup
[![Actions Status](https://github.com/bcomnes/xiteup/workflows/tests/badge.svg)](https://github.com/bcomnes/xiteup/actions)

WIP - nothing to see here
`xiteup` builds websites with html, md, css and javascript.

Still a WIP, but you can look at [test-project](./test-project/) and `xiteup` dependents for some examples how `xiteup` can work.


`xiteup` means "siteup", which is sort of like "markup", which is related to "markdown", which inspired the project [`sitedown`](https://ghub.io/sitedown) which is the spiritual successor to this tool.

```console
npm install siteup
npm install xiteup
```

## Usage

``` js
import { siteup } from 'siteup'
``` console
$ xiteup --help
Usage: xiteup [options]

Example: xiteup --src website --dest public

--src, -s path to source directory (default: "src")
--dest, -d path to build destination directory (default: "public")
--watch, -w build and watch the src folder for additional changes
--help, -h show help
--version, -v show version information
xiteup (v0.0.11)
```

`xiteup` builds a `src` directory into a `dest` directory (default: `public`).

`xiteup` builds 'pages', which can either be `md`, `html` or `js` pages.

### Pages

- `md` pages are commonmark markdown pages.
- `html` pages are static, inner-html fragments that get inserted as-is into the page layout.
- `js` pages are a js file that exports an async function that resolves into an inner-html fragment that is inerted into the page layout. It is the only page that can access variables during rendering.

#### Page Files

All pages can have a `client.js` and a `style.css` file inside of their associated folder.
These are uniquely built and loaded on their associated page.
The `client.js` page bundles are bundle split with every other client side javascript entry-point.
The `style.css` page is not de-duplicated or split with other style files.

Each page can also have a `page.vars.js` file that exports a `default` function that contains page specific variables.

#### `md` pages

- `md` pages have two types: a `README.md` in a folder, or a loose `whatever-name-you-want.md` file.
- `md` pages can have yaml frontmatter, with variables that are accessible to the page layout when building.
- Frontmatter variables have higher precedence over `page.vars.js` or `global.vars.js`variables.
- You can include html in markdown files, so long as you adhere to the allowable markdown syntax around html tags.


#### `html` pages

`html` pages are named `page.html` inside an associated page folder.
`html` pages are the simplest page type in `xiteup`. They let you build with raw html for when you don't want that page to have access to markdown features. Some pages are better off with just raw `html`.

#### `js` pages

`js` pages are files inside a page folder called `page.js`.

...WIP

## License

MIT
18 changes: 9 additions & 9 deletions bin.js
Expand Up @@ -7,7 +7,7 @@ import { resolve, join } from 'node:path'
import desm from 'desm'
import process from 'node:process'

import { SiteUp } from './index.js'
import { Xiteup } from './index.js'

const __dirname = desm(import.meta.url)

Expand Down Expand Up @@ -61,10 +61,10 @@ async function run () {

if (argv.help) {
const pkg = await getPkg()
console.log(`siteup (v${pkg.version})`)
console.log('Usage: siteup [options]\n')
console.log(' Example: siteup --src website --dest public\n')
console.log('Usage: xiteup [options]\n')
console.log(' Example: xiteup --src website --dest public\n')
clopts.print()
console.log(`xiteup (v${pkg.version})`)
process.exit(0)
}
const cwd = process.cwd()
Expand All @@ -73,14 +73,14 @@ async function run () {

// TODO validate input a little better

const siteup = new SiteUp(src, dest, cwd)
const xiteup = new Xiteup(src, dest, cwd)

process.once('SIGINT', quit)
process.once('SIGTERM', quit)

async function quit () {
if (siteup.watching) {
const results = await siteup.stopWatching()
if (xiteup.watching) {
const results = await xiteup.stopWatching()
console.log(results)
console.log('watching stopped')
}
Expand All @@ -89,11 +89,11 @@ async function run () {
}

if (!argv.watch) {
const results = await siteup.build()
const results = await xiteup.build()
console.log(results)
console.log('done')
} else {
const initialResults = await siteup.watch()
const initialResults = await xiteup.watch()
console.log(initialResults)
}
}
Expand Down
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -5,7 +5,7 @@ import chokidar from 'chokidar'

import { build } from './lib/builder.js'

export class SiteUp {
export class Xiteup {
constructor (src, dest, cwd = process.cwd(), opts = {}) {
assert(src, 'src is a required argument')
assert(dest, 'dest is a required argument')
Expand Down
14 changes: 9 additions & 5 deletions package.json
@@ -1,19 +1,21 @@
{
"name": "@bret/siteup",
"name": "xiteup",
"description": "WIP - nothing to see here",
"version": "0.0.11",
"type": "module",
"exports": {
"import": "./index.js"
},
"bin": {
"xiteup": "./bin.js",
"siteup": "./bin.js"
},
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io)",
"bugs": {
"url": "https://github.com/bcomnes/siteup/issues"
"url": "https://github.com/bcomnes/xiteup/issues"
},
"dependencies": {
"@datadog/browser-rum": "^3.2.0",
"async-folder-walker": "^2.0.1",
"autoprefixer": "^10.3.1",
"cheerio": "^1.0.0-rc.10",
Expand All @@ -23,6 +25,7 @@
"desm": "^1.1.0",
"esbuild": "^0.12.15",
"js-yaml": "^4.1.0",
"local-storage-proxy": "^3.0.3",
"markdown-it": "^12.2.0",
"markdown-it-abbr": "^1.0.4",
"markdown-it-deflist": "^2.1.0",
Expand All @@ -39,27 +42,28 @@
"postcss-nesting": "^8.0.1",
"postcss-url": "^10.1.3",
"pretty": "^2.0.0",
"uhtml": "^2.7.6",
"uhtml-ssr": "^0.7.4",
"webassert": "^3.0.2"
},
"devDependencies": {
"auto-changelog": "^2.0.0",
"dependency-cruiser": "^10.1.1",
"gh-release": "^6.0.0",
"mine.css": "^4.5.0",
"mine.css": "^4.6.1",
"mkdirp": "^1.0.4",
"npm-run-all2": "^5.0.0",
"rimraf": "^3.0.2",
"snazzy": "^9.0.0",
"standard": "^16.0.0",
"tap": "^15.0.1"
},
"homepage": "https://github.com/bcomnes/siteup",
"homepage": "https://github.com/bcomnes/xiteup",
"keywords": [],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/bcomnes/siteup.git"
"url": "https://github.com/bcomnes/xiteup.git"
},
"scripts": {
"prepublishOnly": "git push --follow-tags && gh-release -y",
Expand Down

0 comments on commit 2b3e89d

Please sign in to comment.