alpha p3
This commit is contained in:
118
README.md
118
README.md
@@ -1,127 +1,17 @@
|
|||||||
# Fes
|
# Fes
|
||||||
|
|
||||||
A lightweight static site generator built with Go and Lua. Write your websites in Lua and generate beautiful HTML with a modern dark theme.
|
A lightweight, static, and opinionated microframework.
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- 🚀 **Simple & Fast**: Minimal setup, fast development workflow
|
|
||||||
- 🎨 **Beautiful Default Theme**: Modern dark theme with clean typography
|
|
||||||
- 📝 **Lua-Powered**: Write your site logic in Lua for flexibility
|
|
||||||
- ⚙️ **TOML Configuration**: Simple configuration via `Fes.toml`
|
|
||||||
- 🔧 **Easy CLI**: Two simple commands to get started
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
- Go 1.25.4 or later
|
|
||||||
- Git (for author name detection)
|
|
||||||
|
|
||||||
### Build from Source
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://git.vxserver.dev/fSD/fes.git
|
|
||||||
cd fes
|
|
||||||
go build -o fes
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Create a New Project
|
This is the `fes new <?>` output
|
||||||
|
|
||||||
```bash
|
|
||||||
fes new <project_dir>
|
|
||||||
```
|
|
||||||
|
|
||||||
This creates a new project directory with:
|
|
||||||
- `www/index.lua` - Your main Lua file
|
|
||||||
- `Fes.toml` - Project configuration
|
|
||||||
|
|
||||||
### Run Development Server
|
|
||||||
|
|
||||||
```bash
|
|
||||||
fes run <project_dir> [-p <port>]
|
|
||||||
```
|
|
||||||
|
|
||||||
Starts a local development server (default port: 3000).
|
|
||||||
|
|
||||||
Example:
|
|
||||||
```bash
|
|
||||||
fes run my-site -p 8080
|
|
||||||
```
|
|
||||||
|
|
||||||
## Project Structure
|
|
||||||
|
|
||||||
```
|
|
||||||
my-site/
|
|
||||||
├── Fes.toml # Project configuration
|
|
||||||
└── www/
|
|
||||||
└── index.lua # Main Lua file
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Edit `Fes.toml` to configure your site:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[site]
|
|
||||||
name = "My Site"
|
|
||||||
version = "0.0.1"
|
|
||||||
authors = ["Your Name"]
|
|
||||||
|
|
||||||
[fes]
|
|
||||||
version = "1.0.0"
|
|
||||||
CUSTOM_CSS = "" # Optional custom CSS
|
|
||||||
```
|
|
||||||
|
|
||||||
## Writing Your Site
|
|
||||||
|
|
||||||
Your `www/index.lua` file should use the Fes API to build your site:
|
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
local fes = require("fes")
|
local fes = require("fes")
|
||||||
local site = fes.site_builder()
|
local site = fes.fes()
|
||||||
|
|
||||||
site:h1("Hello, World!")
|
site:h1("Hello, World!")
|
||||||
site:h2("Welcome to Fes")
|
|
||||||
site:custom("<p>This is a custom HTML paragraph.</p>")
|
|
||||||
|
|
||||||
return site
|
return site
|
||||||
```
|
```
|
||||||
|
|
||||||
### Available Methods
|
This can be ran with `fes run .` where `.` is the location of the Fes.toml
|
||||||
|
|
||||||
- `site:h1(text)` - Heading 1
|
|
||||||
- `site:h2(text)` - Heading 2
|
|
||||||
- `site:h3(text)` - Heading 3
|
|
||||||
- `site:h4(text)` - Heading 4
|
|
||||||
- `site:h5(text)` - Heading 5
|
|
||||||
- `site:h6(text)` - Heading 6
|
|
||||||
- `site:custom(html)` - Insert custom HTML
|
|
||||||
- `site:version()` - Get site version from config
|
|
||||||
|
|
||||||
### Standard Library
|
|
||||||
|
|
||||||
Access version information via `fes.std`:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
local fes = require("fes")
|
|
||||||
local site = fes.site_builder()
|
|
||||||
|
|
||||||
site:h2("Fes version: " .. fes.std.fes_version())
|
|
||||||
site:h2("Site version: " .. fes.std.site_version())
|
|
||||||
|
|
||||||
return site
|
|
||||||
```
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
See the `test/` directory for a complete example project.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
ISC License
|
|
||||||
|
|
||||||
Copyright (c) 2025 fSD
|
|
||||||
|
|
||||||
See `COPYING` for full license text.
|
|
||||||
|
|||||||
3
TODO
3
TODO
@@ -1,2 +1,3 @@
|
|||||||
Make this static ( cannot find core.std everywhere )
|
|
||||||
Add an interval element
|
Add an interval element
|
||||||
|
Add a way to pass data to sites on load via fes.bus
|
||||||
|
Fire emoji default favicon
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ function M.fes(header, footer)
|
|||||||
version = site_config.version or "",
|
version = site_config.version or "",
|
||||||
title = site_config.title or "Document",
|
title = site_config.title or "Document",
|
||||||
copyright = site_config.copyright or "© The Copyright Holder",
|
copyright = site_config.copyright or "© The Copyright Holder",
|
||||||
|
favicon = "/image/favicon.ico",
|
||||||
header = header or [[
|
header = header or [[
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="{{FAVICON}}">
|
||||||
<title>{{TITLE}}</title>
|
<title>{{TITLE}}</title>
|
||||||
<style>
|
<style>
|
||||||
html, body {
|
html, body {
|
||||||
@@ -100,7 +102,7 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
color: #dfe9ee;
|
color: #dfe9ee;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,7 +371,7 @@ em, i {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
margin-top: 28px !important; /* <— Makes it reappear */
|
margin-top: 28px !important;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -409,7 +411,9 @@ for name, func in pairs(std) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M:build()
|
function M:build()
|
||||||
local header = self.header:gsub("{{TITLE}}", self.title or "Document")
|
local header = self.header
|
||||||
|
header = header:gsub("{{TITLE}}", self.title or "Document")
|
||||||
|
header = header:gsub("{{FAVICON}}", self.favicon or "")
|
||||||
local footer = self.footer:gsub("{{COPYRIGHT}}", self.copyright or "© The Copyright Holder")
|
local footer = self.footer:gsub("{{COPYRIGHT}}", self.copyright or "© The Copyright Holder")
|
||||||
return header .. table.concat(self.parts, "\n") .. footer
|
return header .. table.concat(self.parts, "\n") .. footer
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user