{"id":37049451,"url":"https://github.com/wkallhof/iron-beard","last_synced_at":"2026-01-14T05:45:00.686Z","repository":{"id":142565774,"uuid":"143623943","full_name":"wkallhof/iron-beard","owner":"wkallhof","description":"Simple, zero-configuration static site generator written in .NET Core. ","archived":false,"fork":false,"pushed_at":"2022-01-23T04:14:32.000Z","size":127,"stargazers_count":35,"open_issues_count":3,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-08T00:03:31.655Z","etag":null,"topics":["markdown","net-core","razor","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/wkallhof.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-08-05T15:17:53.000Z","updated_at":"2025-01-09T02:39:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"358e479d-f627-4c91-bd96-d1e7acb8b391","html_url":"https://github.com/wkallhof/iron-beard","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/wkallhof/iron-beard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkallhof%2Firon-beard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkallhof%2Firon-beard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkallhof%2Firon-beard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkallhof%2Firon-beard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wkallhof","download_url":"https://codeload.github.com/wkallhof/iron-beard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkallhof%2Firon-beard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28411359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"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":["markdown","net-core","razor","static-site-generator"],"created_at":"2026-01-14T05:45:00.085Z","updated_at":"2026-01-14T05:45:00.679Z","avatar_url":"https://github.com/wkallhof.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IronBeard\n[![NuGet][nuget-badge]][nuget] [![Release Status](https://github.com/wkallhof/iron-beard/actions/workflows/release.yml/badge.svg)](https://github.com/wkallhof/iron-beard/actions/workflows/release.yml)\n\n[nuget]: https://www.nuget.org/packages/IronBeard/\n[nuget-badge]: https://img.shields.io/nuget/v/IronBeard.svg?style=flat-square\u0026label=nuget\n[appveyor]: https://ci.appveyor.com/project/wkallhof/iron-beard/branch/master\n[appveyor-badge]: https://ci.appveyor.com/api/projects/status/xf9ra9257yclw3gg/branch/master?svg=true\n\nA simple and easy to use cross-platform static site generator built with .NET Core. IronBeard processes your Razor `.cshtml` files, markdown `.md` files into full `.html` files ready for static hosting on services like Amazon S3.\n\nIronBeard maintains your folder structure and copies static assets like images, JS, and CSS into their respective directories to maintain the correct linking on the generated site.\n\nAdding a `beard.json` file to your project root allows for further configuration (see below).\n\n## Features\n- [x] Support for recursive folder and file structures\n- [x] Markdown Processor (with extensions: see [Markdig](https://github.com/lunet-io/markdig))\n- [x] Razor Processor\n- [x] Static File Processor\n- [x] Razor Layout Support (wraps other razor files and markdown markup)\n- [x] Markdown metadata (YAML Frontmatter support in markdown)\n- [x] Razor metadata (YAML Frontmatter support with Razor comments)\n- [x] HTML Formatting to clean up file output. \n- [x] URL correction (properly handles relative routes and root folder routing (index.html etc.))\n- [x] Global configuration file\n- [x] Rich CLI output\n- [x] Valid system errors codes (useful for automation)\n- [x] Watch command for automatic rebuilding on file or directory change\n\n\n## Get started\n\nDownload the [.NET 6 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) or newer.\nOnce installed, run this command:\n\n```\ndotnet tool install --global IronBeard\n```\nThis will install the `beard` command globally on your machine.\n\nThe simplest way to build a static site is by running the following in your project directory\n\n```\nbeard\n```\n\nIt will scan your current directory for site files and generate a `www` folder in your current directory with the generated static site.\n\n## Serving Local\nRather than re-invent the wheel here and include a built in static server, it is recommended that you use [dotnet-serve](https://github.com/natemcmaster/dotnet-serve), a \"Simple command-line HTTPS server for the .NET Core CLI\" by [Nate McMaster](https://github.com/natemcmaster). \n\nJust like IronBeard, you can install it via `dotnet tool`:\n```\ndotnet tool install --global dotnet-serve\n```\nand use it to serve your generated site using the CLI:\n\n```\ndotnet serve ./www\n```\n\nwhere `./www` is your output directory\n\n## Example\n\nSee the [Samples](./samples) directory for sample projects that can be built with IronBeard.\n\n### Example Structure\n\n```\n.\n├── beard.json                  # IronBeard configuration file in the root\n├── index.cshtml                # Main homepage file\n├── shared                      # Standard Shared folder, common in .NET templating\n│   ├── _Layout.cshtml          # Standard _Layout.cshtml file\n│   ├── Partials                # Full Partials support\n|   |   └── ...\n│   └── ...\n├── articles                    # Any level of folder testing\n│   ├── foo-bar.md              # Markdown file support\n│   ├── lorem-ipsum.cshtml      # Razor File support for more complex pages\n│   └── ...\n├── assets                      # Standard assets folder structure. Include CSS, JS, Images, etc.\n│   ├── site.css                \n│   ├── site.js\n│   ├── images\n|   |   └── ...\n│   └── ...        \n└── ...\n```\n\n## Usage\n\n```\nUsage: beard [options] [command]\n\nOptions:\n  --version     Show version information\n  -?|-h|--help  Show help information\n\nCommands:\n  generate      Generates a static site from the files in the given directory\n  watch         Watch a directory for changes and rebuild automatically\n```\n\n## Generate\nGenerate is the main and default command for IronBeard. This will take in your provided input folder (defaults to the current directory) and generate your static site into the provided output folder (defaults to `./www`);\n\n```\nGenerates a static site from the files in the given directory\n\nUsage: beard generate [options]\n\nOptions:\n  -i|--input \u003cPATH\u003e   Provide the root directory where Iron Beard should look for files to generate a static site from.\n  -o|--output \u003cPATH\u003e  Provide the directory where Iron Beard should write the static site to.\n  -?|-h|--help        Show help information\n```\n\n## Watch\nWatch is similary to Generate (the paramaters are all the same), but once it is done generating, it will continue to watch your input directory for changes. When any changes are detected, it will automatically re-generate the static site.\n```\nWatch a directory for changes and rebuild automatically\n\nUsage: beard watch [options]\n\nOptions:\n  -i|--input \u003cPATH\u003e   Provide the root directory where Iron Beard should look for files to generate a static site from.\n  -o|--output \u003cPATH\u003e  Provide the directory where Iron Beard should write the static site to.\n  -?|-h|--help        Show help information\n```\n\n## Configuration\nIronBeard allows for further configuration by adding a `beard.json` configuration file in the root of your project.\nThe default configuration is as follows:\n\n```\n{\n    \"Config\" : {\n        \"SiteTitle\" : \"Razor Markdown Sample\",\n        \"IndexFileName\" : \"index\",\n        \"LayoutFileName\" : \"_Layout\",\n        \"StaticExtensionIgnoreList\" : [\".cshtml\", \".md\", \".DS_Store\", \".json\" ],\n        \"ExcludeHtmlExtension\": true,\n        \"EnableMarkdownExtensions\": false\n    }\n}\n```\n\n* `SiteTitle` : This is the title to display for your generated site. This will be propagated to things like the browser tab.\n\n* `IndexFileName` : This is the file name that should be display as the root in any directory. For example, if you had a `/projects` folder and you wanted a page to represent your projects, you'd put a file `/projects/index.cshtml` into that directory, which will be loaded when a user goes to `/projects` in their browser\n\n* `LayoutFileName` : This is the layout file used to wrap your `.cshtml` and `.md` files. IronBeard will look for this file to determine the layout to use.\n\n* `StaticExtensionIgnoreList` : This array should hold the list of extensions you want the static processor to ignore. If it is _not_ in this list, the files will be copied into the output directory.\n\n* `ExcludeHtmlExtension` : Defaults to `true`, this will not write out the `.html` extension for your generated HTML pages. This provides cleaner routing : `/articles/article` vs `/articles/article.html`. Special work may need to be done to ensure your static host sets the correct `content-type` for your uploaded files to `text/html`. Some rely on the extension to determine this, which these html files will not have. Setting this to false will write out the `.html` extensions as well as update the `Url` property to include the extension so you can navigate your static site locally without the use of a static file server.\n\n* `EnableMarkdownExtensions` : Defaults to `false`, enables markdown extensions (see [Markdig](https://github.com/lunet-io/markdig)).\n\n## ViewContext\n\nRazor files can take advantage of the `ViewContext` model that is automatically passed in to each view file while rendering by appending `@model IronBeard.Core.Features.Generator.ViewContext` to the top of the Razor file.\n\nThe ViewContext contains the following useful properties\n```\npublic class ViewContext\n{\n    public OutputFile Current {get;set;}                    #Access the current page's model, including MetaData (see below)\n    public IEnumerable\u003cOutputFile\u003e Siblings { get; set; }   #Access the current page's sibling pages\n    public IEnumerable\u003cOutputFile\u003e Children { get; set; }   #Access the current page's children pages (sub directories)\n    public IEnumerable\u003cOutputFile\u003e All { get; set; }        #Access HTML pages in the site\n}\n```\n\n### Example\n```\n@using System.Linq\n@model IronBeard.Core.Features.Generator.ViewContext\n@{\n    var articles = Model.Siblings.Where(x =\u003e x.Metadata.ContainsKey(\"Title\"));\n}\n\n@if(articles.Any())\n{\n    \u003ch2\u003eArticles\u003c/h2\u003e\n    \u003cul\u003e\n        @foreach(var article in articles){\n            \u003cli\u003e\u003ca href=\"@article.Url\"\u003e@article.Metadata[\"Title\"]\u003c/a\u003e\u003c/li\u003e\n        }\n    \u003c/ul\u003e\n}\n```\n\n## Partials\nPartials are fully supported in IronBeard. However, it is important to note that the pathing to the partial should be relative to the root of the application and not the current file. For example\n\n#### Bad:\n```\n\u003cpartial name=\"../../shared/partials/_articles.cshtml\" /\u003e\n```\n\n#### Good:\n```\n\u003cpartial name=\"/shared/partials/_articles.cshtml\" /\u003e\n```\n\n\n## Metadata\n\nIronBeard supports YAML Frontmatter in both Markdown and Razor files. This YAML is processed and exposed on the Model passed into all Razor views via each page's `Metadata` property. However, the syntax is slightly different between the two file types:\n\n#### Razor\nI found it important to be able to specify the metadata for a Razor anywhere in the document, so there is no requirement that the frontmatter be defined at the very top of the file. Instead, it uses Razor Comments with a `META` attached to the opening. Everything between the `@*META` and `*@` is processed as YAML.\n```\n@*META\nTitle: Posita vixque alis\nTags: Article\n*@\n```\n\n#### Markdown\nThe YAML format here follows standards on requiring the frontmatter to be defined at the very beginning of the file. \n```\n---\nTitle: Posita vixque alis\nTags: Article\n---\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwkallhof%2Firon-beard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwkallhof%2Firon-beard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwkallhof%2Firon-beard/lists"}