-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathconsts_datastar_readme.qtpl
67 lines (45 loc) · 2.21 KB
/
consts_datastar_readme.qtpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{% import "github.com/dustin/go-humanize" %}
{%- func datastarREADME(data *ConstTemplateData) -%}
[](https://github.com/starfederation/datastar/releases)
[](https://github.com/starfederation/datastar/blob/main/LICENSE)
[](https://github.com/starfederation/datastar/stargazers)
<p align="center"><img width="200" src="https://data-star.dev/static/images/rocket.webp"></p>
# Datastar
### The hypermedia framework.
Datastar helps you build reactive web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.
Getting started is as easy as adding a single {%s humanize.CommafWithDigits( float64(data.VersionClientByteSizeGzip) / 1024.0, 1) %} KiB script tag to your HTML.
```html
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@v{%s data.Version %}/bundles/datastar.js"></script>
```
Then start adding frontend reactivity using declarative <code>data-*</code> attributes.
```html
<input data-bind-title />
<div data-text="$title.toUpperCase()"></div>
<button data-on-click="@post('/endpoint')">Save</button>
```
Visit the [Datastar Website »](https://data-star.dev/)
Watch the [Videos »](https://www.youtube.com/@data-star)
Join the [Discord Server »](https://discord.com/channels/1296224603642925098/1296224603642925102)
## Getting Started
Read the [Getting Started Guide »](https://data-star.dev/guide/getting_started)
## Contributing
Read the [Contribution Guidelines »](https://github.com/starfederation/datastar/blob/develop/CONTRIBUTING.md)
## Custom Plugins
You can manually add your own plugins to the core:
```html
<script type="importmap">
{
"imports": {
"datastar": "https://cdn.jsdelivr.net/gh/starfederation/datastar@v{%s data.Version %}/bundles/datastar.js"
}
}
</script>
<script type="module">
import { Datastar } from 'datastar'
Datastar.load(
// Look ma’, I made a plugin!
)
Datastar.apply(document.body)
</script>
```
{%- endfunc -%}