{"id":18552463,"url":"https://github.com/andrejewski/smithsonian","last_synced_at":"2025-04-09T22:31:56.514Z","repository":{"id":15076809,"uuid":"17803207","full_name":"andrejewski/smithsonian","owner":"andrejewski","description":"web interface for Metalsmith","archived":false,"fork":false,"pushed_at":"2017-04-10T17:03:05.000Z","size":871,"stargazers_count":35,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T13:11:23.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrejewski.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":"2014-03-16T16:18:13.000Z","updated_at":"2025-02-16T04:19:33.000Z","dependencies_parsed_at":"2022-08-29T11:01:35.980Z","dependency_job_id":null,"html_url":"https://github.com/andrejewski/smithsonian","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejewski%2Fsmithsonian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejewski%2Fsmithsonian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejewski%2Fsmithsonian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejewski%2Fsmithsonian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrejewski","download_url":"https://codeload.github.com/andrejewski/smithsonian/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266487,"owners_count":20910833,"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-06T21:14:18.027Z","updated_at":"2025-04-09T22:31:55.783Z","avatar_url":"https://github.com/andrejewski.png","language":"JavaScript","readme":"Smithsonian\n===========\n\nSmithsonian is a web interface for [Metalsmith](https://github.com/segmentio/metalsmith). If you are already using Metalsmith, adopting Smithsonian could not be easier. Smithsonian extends Metalsmith so the exact same plugin/middleware system works, just swap out Metalsmith for Smithsonian.\n\n```javascript\nMetalsmith = require('metalsmith');\nMetalsmith(__dirname)\n  .use(markdown())\n  .use(templates('handlebars'))\n  .build();\n```\n\n..becomes..\n\n```javascript\nSmithsonian = require('smithsonian');\nSmithsonian(__dirname)\n  .use(markdown())\n  .use(templates('handlebars'))\n  .build() // still builds as expected\n  .listen(8080); // listening on localhost:8080\n```\n\nNote: Smithsonian calls `build()` internally when `listen()` is called.\n\n## New in Version 3\n\nThe third version of Smithsonian brings huge underlying changes with only minor developer facing changes. The most important change is that Smithsonian's file access API is now completely decoupled from the user interface. This means that a custom interface can be used instead. This eliminates the need for the old configuration options. And although now decoupled, the default user interface Standard has been completely visually overhauled and has a lot more features.\n\nTo upgrade from v2 to v3, add the web interface to your Express application, like how the Smithsonian API router is added using `express.use()`. Note: this is only necessary if Smithsonian is nested inside another application.\n\n## Installation\n\n```bash\nnpm install smithsonian\n```\n\n## Usage\n\nSmithsonian can be used as an Express application or as an Express middleware and router inside of an existing Express application. Smithsonian is designed to be completely detached from the rest of the application so there are no side-effects to incorporating Smithsonian into a project.\n\n### Express Server\n\n```javascript\nvar Smithsonian = require('smithsonian');\nSmithsonian(__dirname).listen(3000);\n```\n\n### Express Router\n\n```javascript\nvar express = require('express'),\n    Smithsonian = require('smithsonian');\n\nexpress()\n    .use('/subdirectory', Smithsonian(__dirname).router())\n    .listen(3000);\n```\n\n### Smithsonian Standard\n\n```javascript\nexpress()\n  .use('/smithsonian', require('smithsonian/standard')(API_URL))\n  .listen(3000);\n// where API_URL is wherever the Smithsonian router is mounted.\n```\n\n## Use Cases\n\nSmithsonian is really just a basic file explorer that only works with a Metalsmith source directory. It does not serve the built files; use [http-server](https://github.com/nodeapps/http-server) for that. Smithsonian is really useful for remote deploys and as an administration interface. Smithsonian is like an extremely minimal CMS, but for Metalsmith.\n\nSay you have Metalsmith building static content behind Nginx. Expose Smithsonian (preferably backed by [forever](https://github.com/nodejitsu/forever)) in the Nginx config and you now have an easily accessible administration tool to create, edit, and delete source files. No need to build locally and deploy with git or any other manual tool.\n\nBuilding a simple blog for a company/client? If they can manage plain text, Smithsonian is good enough to hand off to clients.\n\n## Methods\n\nSmithsonian only exposes the plugin system of Metalsmith, which are only `#use()` and `#build()`. All other methods calls outside of Metalsmith plugins will need to use `Smithsonian.metalsmith` which is Smithsonian's Metalsmith instance.\n\nSmithsonian also exposes `#listen()` which will start the web server that serves the interface and `#router()` which returns the Express router middleware.\n\n## Smithsonian Standard\n\nSmithsonian comes with a default web interface called Standard. If a custom design is needed, Smithsonian is completely decoupled from the underlying API.\n\n![List View](https://raw.github.com/andrejewski/smithsonian/master/screenshots/list-view.png)\n![File View](https://raw.github.com/andrejewski/smithsonian/master/screenshots/file-view.png)\n\n## Fin\n\nThanks for using Smithsonian. Or for at least reading this far down into the README.\n\nFollow me on [Twitter](https://twitter.com/compooter) for updates or just for the lolz and please check out my other [repositories](https://github.com/andrejewski) if I have earned it. I thank you for reading.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrejewski%2Fsmithsonian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrejewski%2Fsmithsonian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrejewski%2Fsmithsonian/lists"}