https://github.com/gaetanomatonti/sparkle
Make the web shine. ✨
https://github.com/gaetanomatonti/sparkle
css html spm swift web
Last synced: about 1 year ago
JSON representation
Make the web shine. ✨
- Host: GitHub
- URL: https://github.com/gaetanomatonti/sparkle
- Owner: gaetanomatonti
- License: mit
- Created: 2022-10-14T21:04:47.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2023-02-02T11:00:00.000Z (over 3 years ago)
- Last Synced: 2023-08-03T12:00:23.299Z (almost 3 years ago)
- Topics: css, html, spm, swift, web
- Language: Swift
- Homepage:
- Size: 98.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sparkle
Make the web shine. ✨
> Note that the software provided in this package is still in early development, and APIs are subject to changes.
## Static Site Generation
Sparkle takes advantage of SSG (Static Site Generation) to generate static websites with a DSL powered by Swift.
Static websites are generated at build time and immediately rendered on the client side, shortening the browser's load times.
## Creating a Website
To create a website using Sparkle, create a Swift Package in Xcode, then add Sparkle as a dependency in your `Package.swift`.
```swift
dependencies: [
.package(url: "https://github.com/gaetanomatonti/Sparkle.git", branch: "main")
],
```
Create an executable target that depends on Sparkle.
```swift
targets: [
.executableTarget(
name: "MyWebsite",
dependencies: [
.product(name: "Sparkle", package: "Sparkle")
]
)
]
```
Create `main.swift` in your target's `Source` folder. This is the main entry point of your target. Here you can prompt the generation of your website.
```swift
struct MyWebsite: Site {
var homepage: Page {
Home()
}
}
try MyWebsite().generate()
```
As a result of the generation, files will be created under your package's `Output` directory.
Hooray! You've created your very first website with Sparkle.