{"id":19615289,"url":"https://github.com/gbih/fsharp-suave-dotliquid-starter","last_synced_at":"2025-10-05T04:44:50.426Z","repository":{"id":176745274,"uuid":"133016619","full_name":"gbih/fsharp-suave-dotliquid-starter","owner":"gbih","description":"Simple hello-world starter for F# Suave and DotLiquid","archived":false,"fork":false,"pushed_at":"2018-05-11T09:35:11.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T17:48:33.322Z","etag":null,"topics":["dotliquid","fsharp","suave"],"latest_commit_sha":null,"homepage":null,"language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbih.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-11T09:04:46.000Z","updated_at":"2019-05-21T03:28:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"36d38062-f87b-492d-b30c-fc1bfeaea841","html_url":"https://github.com/gbih/fsharp-suave-dotliquid-starter","commit_stats":null,"previous_names":["gbih/fsharp-suave-dotliquid-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gbih/fsharp-suave-dotliquid-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2Ffsharp-suave-dotliquid-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2Ffsharp-suave-dotliquid-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2Ffsharp-suave-dotliquid-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2Ffsharp-suave-dotliquid-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbih","download_url":"https://codeload.github.com/gbih/fsharp-suave-dotliquid-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2Ffsharp-suave-dotliquid-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278411251,"owners_count":25982365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotliquid","fsharp","suave"],"created_at":"2024-11-11T10:56:08.069Z","updated_at":"2025-10-05T04:44:50.420Z","avatar_url":"https://github.com/gbih.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick Setup\n\nClone this repo, then:\n```sh\n$ dotnet build\n$ dotnet run\n```\n\n\n# Manual Setup\n\nTo build from scratch:\n```sh\n$ dotnet new console -lang F# -n MyApp\n$ cd MyApp\n$ dotnet add package Suave --version 2.4.0\n$ dotnet add package DotLiquid --version 2.0.262\n$ dotnet add package Suave.DotLiquid --version 2.4.0\n```\n\nNext, setup /templates and /assets folders:\n```sh\n$ mkdir {projectroot}/templates\n$ mkdir {projectroot}/assets\n        \n$ cd templates\n$ touch index.liquid\n```\n\nCreate a sample index.liquid file:\n```\n    \u003ch1\u003e{{model.title}}\u003c/h1\u003e\n```\n\nEdit .fsproj file to allow Suave to serve all files inside /templates and /assets:\n```\n  \u003cItemGroup\u003e\n    \u003cCompile Include=\"Program.fs\" /\u003e\n    \u003cNone Include=\"templates/**/*\" Link=\"views/%(RecursiveDir)%(Filename)%(Extension)\" CopyToOutputDirectory=\"PreserveNewest\" /\u003e\n    \u003c!-- Manually constructing Link metadata, works in classic projects as well --\u003e\n    \u003cNone Include=\"assets/**/*\" Link=\"assets/%(RecursiveDir)%(Filename)%(Extension)\" CopyToOutputDirectory=\"PreserveNewest\" /\u003e\n  \u003c/ItemGroup\u003e\n```\n\nSample Program.fs:\n```fsharp\nopen Suave\nopen Suave.Filters\nopen Suave.Operators\nopen Suave.DotLiquid\nopen System.IO\nopen System.Reflection\n\nlet currentPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)\n\nlet myHomeFolder = Path.Combine(Directory.GetCurrentDirectory(), \"assets\") \n\nlet initDotLiquid () =\n    let templatesDir = Path.Combine(currentPath, \"views\")\n    setTemplatesDir templatesDir\n\nlet cfg = { \n    defaultConfig with\n        bindings = [ HttpBinding.createSimple HTTP \"127.0.0.1\" 8080  ] \n        homeFolder = Some(myHomeFolder)\n      }\n\ntype Model = { title : string }\n\nlet o = { title = \"Hello World\" }\n\n[\u003cEntryPoint\u003e]\nlet main argv =\n    printf \"%s\" myHomeFolder\n    initDotLiquid ()\n    setCSharpNamingConvention ()\n\n    let app = \n        choose [\n            pathRegex \"(.*)\\.(css|png|gif|js|ico)\" \u003e=\u003e Files.browseHome\n            path \"/\" \u003e=\u003e choose [\n                GET \u003e=\u003e page \"index.liquid\" o ]\n            ]\n        \n    startWebServer cfg app\n    0\n```\n\nBuild and run\n```\n$ dotnet build\n$ dotnet run\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbih%2Ffsharp-suave-dotliquid-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbih%2Ffsharp-suave-dotliquid-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbih%2Ffsharp-suave-dotliquid-starter/lists"}