{"id":19417746,"url":"https://github.com/chriskempson/netcrafter","last_synced_at":"2025-10-25T10:36:47.394Z","repository":{"id":140675248,"uuid":"190713786","full_name":"chriskempson/netcrafter","owner":"chriskempson","description":"Minimalist, handcrafted, optionally static, HTML websites.","archived":false,"fork":false,"pushed_at":"2022-07-04T10:23:44.000Z","size":52,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T13:41:36.440Z","etag":null,"topics":["cli","css","framework","handcrafted","html","lightweight","netcrafter","php","static-site-generator"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/chriskempson.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":"2019-06-07T08:47:39.000Z","updated_at":"2025-02-25T18:48:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b935ada-733a-42c6-8add-0cb18cb0f4c8","html_url":"https://github.com/chriskempson/netcrafter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chriskempson/netcrafter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskempson%2Fnetcrafter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskempson%2Fnetcrafter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskempson%2Fnetcrafter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskempson%2Fnetcrafter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chriskempson","download_url":"https://codeload.github.com/chriskempson/netcrafter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskempson%2Fnetcrafter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280943386,"owners_count":26417746,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","css","framework","handcrafted","html","lightweight","netcrafter","php","static-site-generator"],"created_at":"2024-11-10T13:11:13.966Z","updated_at":"2025-10-25T10:36:47.357Z","avatar_url":"https://github.com/chriskempson.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![Netcrafter](public/netcrafter.gif)\nFire up your single-core 500Mhz CPU, double-click on your entirely legal copy of Frontpage/Dreamweaver, ready your GIFs, and lovingly craft your small part of the Internet with finger generated HTML and your new best friend - Netcrafter!\n\nNetcrafter is a ~~religious cult~~, ~~life-philosophy~~, way of building websites that unashamedly slaps you in the face with [HTML - the future of the Internet](https://blog.neocities.org/blog/2015/02/27/we-are-the-future.html). The magic of Netcrafter is made possible by a scripting language that has started to gain traction in today's World Wide Web known as [PHP](https://web.archive.org/web/20000301133004/http://php.net/) (Personal Home Page) language. With Netcrafter you'll be churning out cool websites before the dot-com bubble has even burst!\n\n**Scientific Facts:** \n* Netcrafter is lighter than air and fits inside a [single PHP file](https://github.com/chriskempson/netcrafter/blob/master/netcrafter.php) less than 100 SLOC's long and takes up just a few KBs on your floppy disk!\n* Depending of the nature of your ~~adult website~~ life modelling appreciation website, you'll hopefully have no need for PHP on your server of the webs. Just [generate static HTML](#generate-static-html) and be on your merry way to _server-side scripting-less nirvana\u0026trade;_.\n* Recent entirely-fabricated studies show, users of Netcrafter may have lower stress levels and may experience a boost in the production of endorphins. [\u003csup\u003e1\u003c/sup\u003e](#addendum)\n\n## Up and running before your dial-up has time to sync!\nShove this in your post-PHP-CLI-installed terminal:\n\n    git clone git@github.com:chriskempson/netcrafter.git my-first-website\n    cd my-first-website\n    ./serve-website.sh\n\nNext, point a modern browser (e.g. Netscape Navigator, Internet Explorer) at http://localhost:8000. Now, marvel (in awestruck silence) at the breathtakingly stunning welcome page.\n\n## The lowdown\nAn ultra minimalist, ultra simple way of creating the next generation of HTML/CSS/JS websites by hand.\nEssentially the core philosophy of Netcrafter boils down to this:\n\n- Partials - Reusable, small HTML snippets (a la your old friend SSI)\n- Meta Data - Attach and retrieve information to your HTML pages using \\\u003cmeta\\\u003e tags!\n- Plugins - Power up your HTML with quick and dirty PHP hacks\n- Directories - Simply use real directories to structure your website\n- Static HTML - Blazingly fast, next-gen static content generator called WGET\n\n### Partials\nPartials are little snippets of HTML you can reuse across multiple pages just like your friend SSI.\n\n```php\n    \u003c?= partial('navigation') ?\u003e \n```\n### Meta\nYou can add meta data to your HTML pages with... meta tags.\n\n```html\n    \u003cmeta name=\"date\" content=\"2015-10-21\"\u003e\n```\n\nYou can get meta data for the current html page anywhere in your site with:\n\n```php\n    \u003c?= meta('date') ?\u003e\n```\n\nOr grab all available meta data as an array with:\n\n```php\n    \u003c?= meta() ?\u003e\n```\n\nYou might also want to grab meta data for another file:\n\n```php\n    \u003c?= meta_from_file('about.php', 'date') ?\u003e\n```\n\nOr grab all available meta as an array with:\n\n```php\n    \u003c?= meta_from_file('about.php') ?\u003e\n```\n\n### Plugins\nPlugins are simple to use in any of your HTML pages:\n```php\n   \u003c?= years_since('1985') ?\u003e\n```\n\n### Directories\nWant to add a new page? Just add a new directory with an index.php inside it.\n\nAn example directory structure might look like:\n\n    website\n    | partials/\n      | - html.php\n      | - footer.php\n      | - header.php\n      | - navigation.php\n    | plugins/\n      | years-since/\n        | - plugin.php\n    | publc/\n      | about/\n        | - index.php\n      | - index.php\n      | - styles.css\n    ! - webcrafter.php\n\nAn example HTML page might look like:\n```php\n    \u003c?php include $_SERVER['DOCUMENT_ROOT'] . '/../netcrafter.php' ?\u003e\n\n    \u003ctitle\u003eNetcrafter\u003c/title\u003e\n    \n    \u003c?php partial('header') ?\u003e\n    \n    \u003ch1\u003eWelcome\u003c/h1\u003e\n    \n    \u003cp\u003eYou are surfing the information highway!\u003c/p\u003e\n    \n    \u003c?php partial('footer') ?\u003e\n```\n\n### Generate Static HTML\nGenerate static html and check for broken internal links with:\n\n    ./generate_static.sh\n\nProvided your box has wget installed (slap your wrist if it doesn't), this will export a static version of your website to a `static` directory. You can now ssh, rsync, ftp, telnet your site up your server.\n\nWhy not get a huge 1GB of ad-free hosting by grabbing a free account at [Neocities](https://neocities.org) and adding the following to the `./generate_static.sh` script\n\n    neocities push $STATIC_DIR\n\n## Writing Plugins\nTo create a new ~~quick and dirty PHP hack~~ beautifully authored plugin, just add a new directory with a name of your very own choosing to the plugins directory and create a new `plugin.php` file within. All you need to do now is add some lovely code to your shiny new plugin. e.g. a file called `plugins/years_since/plugin.php` might contain the following:\n\n```php\n\u003c?php \n/**\n* Returns a string containing the number of years since a given date\n* e.g. \u003c?= years_since('1985') ?\u003e\n*\n* @param string $string Text to be converted to a date\n*\n* @return string \n*/\nfunction years_since($date) {\n    $date = date('Ymd', strtotime($date));\n    $diff = date('Ymd') - $date;\n    return substr($diff, 0, -4);\n}\n```\n\n## What the Netcrafter?\nI used a few static content generators before but I was always forgetting the [tens](https://learn.cloudcannon.com/jekyll-cheat-sheet/) and [hundreds](https://gohugo.io/documentation/) of features, variables and commands and soon became tired of having to search through documentation. I just wanted to build an HTML website, I didn't care for learning about the varied nuances of a static content generator! So I ended up building my own consisting of a single PHP file and a couple of scripts weighing in at a few KBs. \n\nInitially I set about trying to make a website with HTML/CSS alone like I used to back in the 90's, even saying hello again to that old shady customer Mr. SSI. However, it wasn't long before I saw sense and decided to include a scripting language choosing PHP since it runs on all of my toasters (and my neighbours fridge, (and her neighbours kettle or so I'm told)). However, as HTML is the focus here and since I firmly believe that perfection is achieved not when there is nothing left to add, but when there is nothing left to take away, I tried to use as little PHP as possible when building this.\n\nFor the past year or so I've been enjoying using what is now Netcrafter, or rather, I've been enjoying working on my HTML websites and not having to even think about the fact that I'm using Netcrafter. Now is perhaps the time to share my little creation in the hopes that other HTML lovers will find a place in their heart and their servers for Netcrafter.\n\nGet Netcrafting! /end cheesy sign-off\n\n---\n\n### Addendum\n\u003csup\u003e1\u003c/sup\u003e Although trends may have suggested that Netcrafter use may be addictive, it is important to gain a sense of perspective regarding this matter, therefore I would like to draw your attention to the fact that, as of yet, there have been no cases in which Netcrafter was proven to be a contributing factor to the death of an individual.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriskempson%2Fnetcrafter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchriskempson%2Fnetcrafter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriskempson%2Fnetcrafter/lists"}