{"id":23160977,"url":"https://github.com/steverandy/metalsmith-marko","last_synced_at":"2025-04-04T19:28:05.499Z","repository":{"id":57295611,"uuid":"79688296","full_name":"steverandy/metalsmith-marko","owner":"steverandy","description":"Metalsmith plugin to render files with Marko templates","archived":false,"fork":false,"pushed_at":"2017-03-04T03:24:34.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T22:35:13.137Z","etag":null,"topics":["marko","metalsmith","metalsmith-plugin","template"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/steverandy.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}},"created_at":"2017-01-22T02:41:08.000Z","updated_at":"2017-01-22T16:38:55.000Z","dependencies_parsed_at":"2022-08-27T12:21:19.398Z","dependency_job_id":null,"html_url":"https://github.com/steverandy/metalsmith-marko","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steverandy%2Fmetalsmith-marko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steverandy%2Fmetalsmith-marko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steverandy%2Fmetalsmith-marko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steverandy%2Fmetalsmith-marko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steverandy","download_url":"https://codeload.github.com/steverandy/metalsmith-marko/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247236876,"owners_count":20906207,"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","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":["marko","metalsmith","metalsmith-plugin","template"],"created_at":"2024-12-17T23:12:58.408Z","updated_at":"2025-04-04T19:28:05.484Z","avatar_url":"https://github.com/steverandy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# metalsmith-marko\n\nA Metalsmith plugin to render files with [Marko](http://markojs.com/) templates.\n\nIt supports rendering source files with templates and layouts. By default it looks for layout files in `layouts` directory. You need to set the `layout` in source file frontmatter section in order to render it in a layout. Optionally, you can set `defaultLayout` in plugin options.\n\n## Installation\n\n```\n$ npm install metalsmith-marko\n```\n\n## Usage\n\n### Without Options\n\n```javascript\nlet marko = require(\"metalsmith-marko\")\n\nmetalsmith.use(marko())\n```\n\n### With Options\n\n```javascript\nlet marko = require(\"metalsmith-marko\")\n\nmetalsmith.use(marko({\n  layoutsDirectory: \"layouts\",\n  defaultLayout: \"default.html\",\n  pattern: [\"**/*.marko\", \"**/*.html\"],\n  compilerOptions: {\n    writeToDisk: false,\n    preserveWhitespace: true\n  }\n}))\n```\n\n### Default Options\n\n```javascript\nlayoutsDirectory: \"layouts\",\npattern: [\"**/*.marko\"],\ncompilerOptions: {\n  writeToDisk: false,\n  preserveWhitespace: true\n}\n```\n\n### Templates\n\n`layouts/default.html.marko`\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003ctitle\u003e${data.title}\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  $!{data.contents}\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n`pages/index.html.marko`\n\n```html\n\u003carticle\u003e\n  \u003ch1\u003eHeading\u003c/h1\u003e\n  \u003cdiv for(page in data.pages)\u003e${page.title}\u003c/div\u003e\n\u003c/article\u003e\n```\n\n\n## License\n\n[MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteverandy%2Fmetalsmith-marko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteverandy%2Fmetalsmith-marko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteverandy%2Fmetalsmith-marko/lists"}