https://github.com/troublete/go-csi
client side include – include remote snippets in files
https://github.com/troublete/go-csi
Last synced: 3 months ago
JSON representation
client side include – include remote snippets in files
- Host: GitHub
- URL: https://github.com/troublete/go-csi
- Owner: troublete
- License: mit
- Created: 2023-11-07T21:50:09.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-07T21:50:43.000Z (over 1 year ago)
- Last Synced: 2025-01-03T16:33:28.118Z (5 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSI
> Client Side Include## Introduction
As opposed to server side includes (SSI); this tooling aims to allow the include of responses (e.g. remote HTML document
partials) in
local ones. It might be generally useful for static site generation when used in conjunction with a headless/hybrid CMS.## Get Started
Since it might be generally useful for `HTML` generation here an example of the usage in `HTML`, but in general the
interpreter reads any document regardless of extension. And includes whatever the `HTTP GET` request returns.```html
```
The `` will be replaced with whatever a `HTTP GET` request will fetch from the following
host.Error occurring during request or URL parsing will be output as log messages and the content will be replaced by an
empty string.## Tooling Binaries
### build
```bash
go run ./cmd/build/ --help
Usage of ...
-file string
the file to convert
```This will process the input file and output the content, with processing of the CSI snippets to stdout.
### watch
```bash
go run ./cmd/watch/ --help
Usage of ...
-file string
the file to convert
-out string
the target to output (default "out.html")
```This will process the input file and will on every change; process and store the processed file as defined in `out`.
### serve
```bash
go run ./cmd/serve/ --help
Usage of ...
-file string
the file to convert
-port string
the target port to listen (default "4321")
```This will process the file (similar to watch) and serve it on `127.0.0.1:*port*`.
## Building
```bash
make build # will create all binaries in a ./dist directory
```## License
MIT