{"id":23274601,"url":"https://github.com/ianwold/metalsharp","last_synced_at":"2026-02-02T21:49:58.720Z","repository":{"id":74932304,"uuid":"154747426","full_name":"IanWold/Metalsharp","owner":"IanWold","description":"A tiny and extendable C# library for generating static sites, inspired by Metalsmith","archived":false,"fork":false,"pushed_at":"2024-11-04T14:08:45.000Z","size":290,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-13T11:56:32.009Z","etag":null,"topics":["csharp","dotnet","dotnet-standard","metalsharp","metalsmith","static-site","static-site-generator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IanWold.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-25T22:55:27.000Z","updated_at":"2022-12-05T14:46:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7ee31bf-2540-4c8f-a3ca-26fa319a64a0","html_url":"https://github.com/IanWold/Metalsharp","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/IanWold/Metalsharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FMetalsharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FMetalsharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FMetalsharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FMetalsharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IanWold","download_url":"https://codeload.github.com/IanWold/Metalsharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FMetalsharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29021031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T18:51:31.335Z","status":"ssl_error","status_checked_at":"2026-02-02T18:49:20.777Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["csharp","dotnet","dotnet-standard","metalsharp","metalsmith","static-site","static-site-generator"],"created_at":"2024-12-19T20:14:05.153Z","updated_at":"2026-02-02T21:49:58.704Z","avatar_url":"https://github.com/IanWold.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://raw.githubusercontent.com/IanWold/Metalsharp/master/Metalsharp.png)\n\n[![](https://img.shields.io/nuget/vpre/Metalsharp.svg?logo=nuget\u0026logoColor=white\u0026style=flat-square)](https://www.nuget.org/packages/Metalsharp/)\n[![AppVeyor Build](https://img.shields.io/appveyor/ci/ianwold/metalsharp.svg?logo=appveyor\u0026logoColor=white\u0026style=flat-square)](https://ci.appveyor.com/project/IanWold/metalsharp)\n[![AppVeyor tests](https://img.shields.io/appveyor/tests/ianwold/metalsharp.svg?logo=appveyor\u0026logoColor=white\u0026style=flat-square)](https://ci.appveyor.com/project/IanWold/metalsharp/build/tests)\n[![Discord](https://img.shields.io/discord/517023630224523274.svg?logo=discord\u0026logoColor=white\u0026style=flat-square)](https://discord.gg/KwBtSan)\n\nA tiny and extendable C# library for generating static sites, inspired by [Metalsmith](http://www.metalsmith.io/). Metalsharp is guided by three basic principles:\n\n1. **Small footprint**: Use the smallest amount of code necessary,\n1. **Extendable**: Make it as easy as possible for anyone to develop and release plugins, and\n1. **Approachable**: Maintain thorough documentation to keep the code easy to read and the library easy to learn\n\nGenerating a website from a directory is as simple as the following (from [ExampleWebsite](https://github.com/IanWold/Metalsharp/tree/master/Metalsharp.Examples/Metalsharp.ExampleWebsite)):\n\n```c#\nnew MetalsharpDirectory(\"Site\")\n    .Use\u003cFrontmatter\u003e()\n    .Use(new Drafts())\n    .UseMarkdown()\n    .AddOutput(\"Static\")\n    .Build();\n```\n\n## Getting Started\n\nTo get Metalsharp, you can either build it from source, or get it on [NuGet](https://www.nuget.org/packages/Metalsharp/).\n\n```plaintext\nPM\u003e Install-Package Metalsharp -Version 0.9.0-rc.1\n```\n\n\u003e Note that you will need NuGet 4.3.0 or higher to install Metalsharp with NuGet.\n\n### Configuring a Metalsharp Project Directory\n\nIt is recommended that a Metalsharp project use something like the following directory structure.\n\n```text\nProjectFolder\n├── Site\n│   ├── SomeFile.md\n│   └── SomeOtherFile.md\n├── Static\n│   └── style.css\n└── README.md\n```\n\nHere we have a project in a `ProjectFolder` directory. At that level, you can place files irrelevant to the resultant website. Site content can go in a `Site` folder, and content that will be copied right through to the output can go in a `Static` folder. None of these are requirements, and as your mileage varies you can implement whichever structure you need.\n\n### Using Metalsharp\n\nLet's walk though the example at the top. The [quickstart](https://github.com/IanWold/Metalsharp/blob/master/Metalsharp.Documentation/quickstart.md) can give you a more thorough glimpse at Metalsharp, and there's also a tutorial to [create a practical website](https://github.com/IanWold/Metalsharp/blob/master/Metalsharp.Documentation/tutorial-website.md).\n\n1. Instantiate a new `MetalsharpProject` with the directory containing the files you want to manipulate:\n\n```c#\nnew MetalsharpProject(\"Site\")\n```\n\n2. You can add a plugin by referencing its type if it has an empty constructor, like the `Frontmatter` plugin. This one will add a file's frontmatter to its metadata:\n\n```c#\n.Use\u003cFrontmatter\u003e()\n```\n\n3. If a plugin does not have an empty constructor, or if you prefer this syntax, you'll either need to use a provided extension method, or instantiate the plugin yourself. The `Drafts` plugin (one of the [example plugins](https://github.com/IanWold/Metalsharp/tree/master/Metalsharp.Examples/Metalsharp.ExamplePlugin)) removes files marked as drafts.\n\n```c#\n.Use(new Drafts())\n```\n\n4. And if an extension to `Metalsharp` exists for a plugin, as does for [all the plugins that come with Metalsharp](https://github.com/IanWold/Metalsharp/blob/master/Metalsharp/Plugins/MetalsharpExtensions.cs), you can use that extension method. `Markdown` converts Markdown files in the input to HTML files in the output.\n\n```c#\n.UseMarkdown()\n```\n\n5. Finally, we've got a `Static` folder with files we want to copy right through to the output, so let's include those in the output:\n\n```c#\n.AddOutput(\"Static\")\n```\n\n6. When you've configured your plugin pipeline, call `Build` to execute the stack:\n\n```c#\n.Build();\n```\n\n## Creating a Custom Plugin\n\nCreating a Metalsharp plugin is very easy. [This tutorial](https://github.com/IanWold/Metalsharp/blob/master/Metalsharp.Documentation/tutorial-plugin.md) demonstrates how to develop and publish a plugin. Fundamentally, all you need to do is implement [`IMetalsharpPlugin`](https://github.com/IanWold/Metalsharp/blob/master/Metalsharp/Interfaces/IMetalsharpPlugin.cs). Below is the code for the `Markdown` plugin:\n\n```c#\npublic class Markdown : IMetalsharpPlugin\n{\n    public void Execute(MetalsharpDirectory project)\n    {\n        foreach (var file in project.InputFiles)\n        {\n            var name = Path.GetFileNameWithoutExtension(file.Path);\n            var text = Markdig.Markdown.ToHtml(file.FileText);\n            project.OutputFiles.Add(new OutputFile(name + \".html\", text) { Metadata = file.Metadata });\n        }\n    }\n}\n```\n\n## Docs\n\n[Metalsharp.Documentation](https://github.com/IanWold/Metalsharp/blob/master/Metalsharp.Documentation/README.md) houses generated API docs and hand-written tutorials.\n\nThe source code is fullly documented with XML comments, and [XmlDocToMarkdown](https://github.com/ianwold/XmlDocToMarkdown) is used to generate a markdown dump of all the API documentation.\n\nIf you notice any issues or potential improvements in the documentation or tutorials, please edit the file(s) and submit a PR, it would be a huge help! If you don't have the time or skill to do that, then opening an issue would be awesome too.\n\nIf you have a question or need help using Metalsharp, please do not open an issue. Rather, head on over to the [Metalsharp Discord](https://discord.gg/HrxyfFP) for general questions and help.\n\n## Contributing\n\nIf you'd like to contribute, please do! Open an Issue, submit a PR, I'm happy however you want to contribute.\n\n## Roadmap\n\n`v0.9.0-rc.1` is on NuGet! The current goal is to test the library thoroughly in as many situations as possible to be sure of its design and usability. This will involve generating a GitHub Pages homepage for Metalsharp, and it may involve writing integration tests. `v0.9.0` will be released to Nuget when there is a concensus that Metalsharp is designed correctly.\n\nAfter `v0.9.0`, it's on to `v1.0.0`!\n\n## But why is this necessary?\n\nFun\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianwold%2Fmetalsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianwold%2Fmetalsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianwold%2Fmetalsharp/lists"}