Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lustre-labs/ssg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.2
Choose a base ref
...
head repository: lustre-labs/ssg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 823 additions and 153 deletions.
  1. +4 −4 .github/workflows/release.yml
  2. +3 −5 README.md
  3. +12 −10 gleam.toml
  4. +22 −12 manifest.toml
  5. +172 −88 src/lustre/ssg.gleam
  6. +100 −0 src/lustre/ssg/atom.gleam
  7. +83 −25 src/lustre/ssg/djot.gleam
  8. +364 −0 src/lustre/ssg/markdown.gleam.old
  9. +63 −0 src/lustre/ssg/opengraph.gleam
  10. +0 −9 test/lustre_ssg_test.gleam
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -12,17 +12,17 @@ jobs:
- uses: erlef/setup-beam@v1.16.0
with:
otp-version: "26.0.2"
gleam-version: "0.33.0"
gleam-version: "1.4.1"
rebar3-version: "3"

- run: cargo install tomlq
- run: |
if [ "v$(tomlq version -f gleam.toml)" == "${{ github.ref_name }}" ]; then
exit 0
fi
echo "tag does not match version in gleam.toml, refusing to publish"
exit 1
- run: gleam format --check src test
- run: gleam test --target erlang
- run: gleam test --target javascript
- run: gleam format --check src
- run: gleam publish -y
env:
HEXPM_USER: ${{ secrets.HEX_USERNAME }}
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ $ gleam add lustre_ssg --dev

```gleam
import gleam/list
import gleam/map
import gleam/io
// Some data for your site
@@ -49,10 +48,9 @@ import app/page/post
import lustre/ssg
pub fn main() {
let posts = map.from_list({
use post <- list.map(posts.all())
#(post.id, post)
})
let posts =
list.map(posts.all(), fn(post) { #(post.id, post) })
|> dict.from_list()
let build = ssg.new("./priv")
|> ssg.add_static_route("/", index.view())
22 changes: 12 additions & 10 deletions gleam.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
name = "lustre_ssg"
version = "0.3.2"
version = "0.9.0"
description = "A simple static site generator for Lustre projects."

licences = ["MIT"]
repository = { type = "github", user = "lustre-labs", repo = "lustre_ssg" }
repository = { type = "github", user = "lustre-labs", repo = "ssg" }
links = [
{ title = "Website", href = "https://lustre.build" },
{ title = "Sponsor", href = "https://github.com/sponsors/hayleigh-dot-dev" },
{ title = "Website", href = "https://lustre.build" },
{ title = "Sponsor", href = "https://github.com/sponsors/hayleigh-dot-dev" },
]
gleam = ">= 0.33.0"

[dependencies]
gleam_stdlib = "~> 0.34"
lustre = "~> 3.0"
simplifile = "~> 1.0.0"
jot = "~> 0.2"
tom = "~> 0.3"
filepath = ">= 1.0.0 and < 2.0.0"
gleam_regexp = ">= 1.0.0 and < 2.0.0"
gleam_stdlib = ">= 0.34.0"
jot = "1.1.0"
lustre = ">= 4.3.5 and < 5.0.0"
simplifile = ">= 2.0.1 and < 3.0.0"
temporary = ">= 1.0.0 and < 2.0.0"
tom = ">= 1.0.0 and < 2.0.0"

[dev-dependencies]
gleeunit = "~> 1.0"
34 changes: 22 additions & 12 deletions manifest.toml
Original file line number Diff line number Diff line change
@@ -2,18 +2,28 @@
# You typically do not need to edit this file

packages = [
{ name = "gleam_stdlib", version = "0.34.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1FB8454D2991E9B4C0C804544D8A9AD0F6184725E20D63C3155F0AEB4230B016" },
{ name = "gleeunit", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D364C87AFEB26BDB4FB8A5ABDE67D635DC9FA52D6AB68416044C35B096C6882D" },
{ name = "jot", version = "0.2.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "jot", source = "hex", outer_checksum = "D92294CFC110CBEC6CE3CE8CD4E42B25164970B749446B5E065F285B98F4B279" },
{ name = "lustre", version = "3.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "11498F93008E6935E78DC4F40A3ED3D84366283BDB012413704B48B0B0822E37" },
{ name = "simplifile", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0BD6F0E7DA1A7E11D18B8AD48453225CAFCA4C8CFB4513D217B372D2866C501C" },
{ name = "tom", version = "0.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0831C73E45405A2153091226BF98FB485ED16376988602CC01A5FD086B82D577" },
{ name = "envoy", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "envoy", source = "hex", outer_checksum = "95FD059345AA982E89A0B6E2A3BF1CF43E17A7048DCD85B5B65D3B9E4E39D359" },
{ name = "exception", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "exception", source = "hex", outer_checksum = "F5580D584F16A20B7FCDCABF9E9BE9A2C1F6AC4F9176FA6DD0B63E3B20D450AA" },
{ name = "filepath", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "67A6D15FB39EEB69DD31F8C145BB5A421790581BD6AA14B33D64D5A55DBD6587" },
{ name = "gleam_crypto", version = "1.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "8AE56026B3E05EBB1F076778478A762E9EB62B31AEEB4285755452F397029D22" },
{ name = "gleam_erlang", version = "0.33.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "A1D26B80F01901B59AABEE3475DD4C18D27D58FA5C897D922FCB9B099749C064" },
{ name = "gleam_json", version = "2.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "C55C5C2B318533A8072D221C5E06E5A75711C129E420DD1CE463342106012E5D" },
{ name = "gleam_otp", version = "0.16.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "FA0EB761339749B4E82D63016C6A18C4E6662DA05BAB6F1346F9AF2E679E301A" },
{ name = "gleam_regexp", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "A3655FDD288571E90EE9C4009B719FEF59FA16AFCDF3952A76A125AF23CF1592" },
{ name = "gleam_stdlib", version = "0.52.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "50703862DF26453B277688FFCDBE9DD4AC45B3BD9742C0B370DB62BC1629A07D" },
{ name = "jot", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "jot", source = "hex", outer_checksum = "F3F87E452FAF1BBAD600C71969E6E239903BD19B5B64350B6A78F4C898DE675E" },
{ name = "lustre", version = "4.6.3", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "BDF833368F6C8F152F948D5B6A79866E9881CB80CB66C0685B3327E7DCBFB12F" },
{ name = "simplifile", version = "2.2.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0DFABEF7DC7A9E2FF4BB27B108034E60C81BEBFCB7AB816B9E7E18ED4503ACD8" },
{ name = "temporary", version = "1.0.0", build_tools = ["gleam"], requirements = ["envoy", "exception", "filepath", "gleam_crypto", "gleam_stdlib", "simplifile"], otp_app = "temporary", source = "hex", outer_checksum = "51C0FEF4D72CE7CA507BD188B21C1F00695B3D5B09D7DFE38240BFD3A8E1E9B3" },
{ name = "tom", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0910EE688A713994515ACAF1F486A4F05752E585B9E3209D8F35A85B234C2719" },
]

[requirements]
gleam_stdlib = { version = "~> 0.34" }
gleeunit = { version = "~> 1.0" }
jot = { version = "~> 0.2" }
lustre = { version = "~> 3.0" }
simplifile = { version = "~> 1.0.0" }
tom = { version = "~> 0.3" }
filepath = { version = ">= 1.0.0 and < 2.0.0" }
gleam_regexp = { version = ">= 1.0.0 and < 2.0.0" }
gleam_stdlib = { version = ">= 0.34.0" }
jot = { version = "1.1.0" }
lustre = { version = ">= 4.3.5 and < 5.0.0" }
simplifile = { version = ">= 2.0.1 and < 3.0.0" }
temporary = { version = ">= 1.0.0 and < 2.0.0" }
tom = { version = ">= 1.0.0 and < 2.0.0" }
Loading