{"id":18952528,"url":"https://github.com/jdan/tinman","last_synced_at":"2025-04-16T01:34:05.656Z","repository":{"id":54564984,"uuid":"21107222","full_name":"jdan/tinman","owner":"jdan","description":"A tiny static-ready blog engine based on the toto library","archived":false,"fork":false,"pushed_at":"2014-08-02T05:22:20.000Z","size":408,"stargazers_count":35,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T05:12:21.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jdan.github.io/tinman/the-shiniest-blog-engine-in-oz","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/jdan.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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":"2014-06-22T22:21:01.000Z","updated_at":"2025-01-20T23:54:58.000Z","dependencies_parsed_at":"2022-08-13T19:50:46.849Z","dependency_job_id":null,"html_url":"https://github.com/jdan/tinman","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Ftinman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Ftinman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Ftinman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Ftinman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdan","download_url":"https://codeload.github.com/jdan/tinman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758419,"owners_count":21156957,"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":[],"created_at":"2024-11-08T13:33:51.187Z","updated_at":"2025-04-16T01:34:05.387Z","avatar_url":"https://github.com/jdan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](https://i.cloudup.com/ovFVGvqIQI.png)\n\nA tiny static-ready blog engine inspired by the\n[toto](http://github.com/cloudhead/toto) library. [The shiniest blog\nengine in Oz!](http://jdan.github.io/tinman/the-shiniest-blog-engine-in-oz/)\n\n```\nnpm install -g tinman\n```\n\n## What is Tinman?\n\nA basic tinman blog looks like this:\n\n```\nexample\n├── articles\n│   └── 2014-06-22-hello-world.md\n└── public\n    └── style.css\n```\n\nSome features include:\n\n* Generate a simple blog with nothing but a few markdown files\n* Serve anything static by placing it in the *public/* directory\n* A comprehensive CLI to handle best-practices for you\n* Customize templates to your heart's desire\n* Run your blog as web server or export it as a static site\n* Add any CSS or JavaScript and have it just work\n\n#### What do I get?\n\nTinman generates a page for each article, and an index page listing your\narticles (sorted by filename). Naming your articles `YYYY-MM-DD-my-title.md`\nwill sort them such that the most recent article is listed first. It\nwill also set the article's date property for you.\n\n## Usage\n\n#### Create a new blog\n\n```bash\n$ tinman create\nBlog title: myblog\n\n  Your blog is ready! To get started:\n\n    cd myblog/\n    tinman server\n\n$ tinman create myblog\n\n# Generate example templates to play with as well\n$ tinman create myblog --with-templates\n```\n\n#### Generate a new article\n\n```bash\n$ tinman new\nTitle: This is my first blog post\n\n  Article generated at: articles/2014-07-05-this-is-my-first-blog-post.md\n```\n\n#### Run your blog on a local webserver\n\n```bash\n$ tinman server\nServer listening on port 3000...\n\n$ tinman server --port 1337\nServer listening on port 1337...\n```\n\n#### Build your blog as a static site\n\n```bash\n$ tinman build\n\n  Blog successfully built to: build/\n\n$ tinman build --output-dir www\n\n  Blog successfully built to: www\n```\n\n## Writing Articles\n\nArticles are written in [Markdown](http://daringfireball.net/projects/markdown/)\nand use YAML Front Matter to set various options.\n\n```markdown\n---\ntitle: Hello, World!\ndate: 2014-06-22\n---\n\nOnce upon a time...\n```\n\nThis article will be accessible at the url `/hello-world` by default\n(based on the article's title). You can customize this option by either:\n\n* Setting the `slug` property, making the article accessible at\n  `/your-slug-here`\n* Setting the `route` property, and completely overriding the slug (i.e.\n  `route: /2014/06/24/musings/my-article`\n\nYou can include any custom options you'd like (i.e. `color: red`) in\nyour YAML Front Matter, and recall it from a custom template.\n\n## Templates\n\nTinman uses [EJS](http://embeddedjs.com/) templates and includes the\nfollowing:\n\n* **article.ejs** for templating an individual article\n* **index.ejs** for the article index page\n* **layout.ejs** which wraps around the other two and renders asset tags\n\nTo customize these templates, pass the `--with-templates` option to\n`tinman create`:\n\n```bash\n$ tinman create myblog --with-templates\n\n  Your blog is ready! To get started:\n\n    cd myblog/\n    tinman server\n\n$ tree myblog\nmyblog\n├── articles\n│   └── 2014-06-22-hello-world.md\n├── public\n│   └── style.css\n├── templates\n│   ├── article.ejs\n│   ├── index.ejs\n│   └── layout.ejs\n└── tinman.json\n```\n\nBeyond the articles directory and sample stylesheet, the\n`--with-templates` option creates a templates directory and a\n`tinman.json` file, instructing Tinman to use these templates instead of the\nones built into it.\n\n#### What data do my templates receive?\n\nThe **article template** receives all properties of the article as defined in\nthe YAML Front Matter. The content of the article is stored as `body`. Some\nextra fields include:\n\n* **summary**: the first paragraph of the rendered article\n* **filename**: self-explanatory\n* **date**: the date either extracted from the filename or from the\n  `date` property of the article's Front Matter\n\nThe **index template** has access to the array `articles`, which holds\nevery article in your blog.\n\nThe **layout template** receives a `body`, which contains the rendered HTML of\nthe page it contains (either an article page or the index). This template also\nhas access to two strings, `stylesheets` and `scripts`, which store the CSS/JS\nresource tags generated automatically based on the contents of your public\ndirectory.\n\n## Plugins\n\nPlugins are small helper modules that **all** templates can access, allowing\nyou to add extra functionality to your blog. An example plugin may look\nlike the following:\n\n```javascript\n// hello.js\nmodule.exports = function (name) {\n  return \"Hello, \" + name + \"!\";\n};\n```\n\nWhich you can then access in any template like so:\n\n```html\n\u003ctitle\u003e\u003c%= plugins.greeting(\"Jordan\") %\u003e\u003c/title\u003e\n```\n\n#### How do I load a plugin?\n\nIn order for Tinman to appropriately load your plugins, you need to\npopulate the `plugins` object in your `tinman.json` file. You'll notice\nthis file is generated for you automatically when you create a new blog\nusing the `--with-templates` option.\n\n```json\n{\n  \"title\": \"Jordan's awesome blog\",\n  \"plugins\": {\n    \"greeting\": \"./hello\"\n  }\n}\n```\n\nEach entry in `plugins` consists of two items, the identifier that your\ntemplate will be able to call (i.e. `plugins.greeting`) and a require\nstring (just as you would pass to `require()` in node).\n\n```javascript\n{\n  \"plugins\": {\n    \"ms\": \"ms\",         // load \"ms\" from node_modules/\n    \"other\": \"./blah\"   // load \"blah.js\" locally as \"other\"\n  }\n}\n```\n\nJust remember to `npm install` any external modules before trying to use\nthem.\n\n## Static Files\n\nTinman will automatically copy static assets (images, stylesheets,\njavascripts) from the \"public\" directory (default: `public/`).\n\nFor instance, you can write the following to **public/css/colors/main.css**:\n\n```css\nbody {\n  color: #222222;\n}\n```\n\nAnd access it like so:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"/css/colors/main.css\"\u003e\n```\n\nYou can follow the same pattern for including images in your articles,\nor even serving static HTML documents.\n\nIn addition, Tinman scans for javascripts (`*.js`) and stylesheets (`*.css`)\nand automatically generates resource tags in the layout template\n(*layout.ejs* is sent both a *scripts* and *stylesheets* string). **You do\nnot need to edit any templates after writing javascripts or stylesheets.**\n\n--\n[MIT Licensed](https://github.com/jdan/tinman/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Ftinman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdan%2Ftinman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Ftinman/lists"}