{"id":27169396,"url":"https://github.com/samdmarshall/pewpewthespells-com","last_synced_at":"2025-04-09T06:36:43.830Z","repository":{"id":30316589,"uuid":"85230450","full_name":"samdmarshall/pewpewthespells-com","owner":"samdmarshall","description":"website platform for pewpewthespells.com","archived":false,"fork":false,"pushed_at":"2022-12-09T05:35:17.000Z","size":627,"stargazers_count":5,"open_issues_count":9,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T13:47:05.374Z","etag":null,"topics":["jester","linkcheck","nim","web-server"],"latest_commit_sha":null,"homepage":"https://pewpewthespells.com","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samdmarshall.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-16T18:45:04.000Z","updated_at":"2023-03-18T08:57:12.000Z","dependencies_parsed_at":"2023-01-11T15:37:18.733Z","dependency_job_id":null,"html_url":"https://github.com/samdmarshall/pewpewthespells-com","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdmarshall%2Fpewpewthespells-com","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdmarshall%2Fpewpewthespells-com/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdmarshall%2Fpewpewthespells-com/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdmarshall%2Fpewpewthespells-com/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samdmarshall","download_url":"https://codeload.github.com/samdmarshall/pewpewthespells-com/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247993937,"owners_count":21030045,"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":["jester","linkcheck","nim","web-server"],"created_at":"2025-04-09T06:36:01.891Z","updated_at":"2025-04-09T06:36:43.813Z","avatar_url":"https://github.com/samdmarshall.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The pewpewthespells.com Website Stack\r\n\r\n## Background\r\n\r\nThis repos contains the entirity of the technology stack that runs [pewpewthespells.com](https://pewpewthespells.com). It consists of primarily static content that is processed by `rite` using a set of rules to prepare it for being viewed on the web. This content is then served by `ritual`, which is a web-server powered by the [Jester](https://github.com/dom96/jester) web framework.\r\n\r\n## Building\r\n\r\n### 1. Building the Tools\r\n\r\nAll of the code is written in Nim and uses [Nimble](https://github.com/nim-lang/nimble) (the Nim package manager) to build both the content generator and the web framework that is used to serve content. To build the tools, run the following command:\r\n\r\n```shell\r\n$ nimble build\r\n```\r\n\r\nThis will generate binaries for both `rite` and `ritual`.\r\n\r\n### 2. Preparing Content\r\n\r\nTo prepare content for the web, you will need to create a `sitemap.toml` file that describes the following:\r\n\r\n```toml\r\n[root]\r\ndirectory = \"site/\"\r\n\r\n[export]\r\ndirectory = \"/var/www/example.com/public_html/\"\r\nbase_url = \"https://example.com/\"\r\nrss = \"blog/\"\r\n\r\n[[rules]]\r\ninput = \".md\"\r\noutput = \".html\"\r\ncommand = \"pandoc --from markdown+grid_tables --to html5 --include-in-header=%self%/header.html --highlight-style=pygments --email-obfuscation=references \\\"%input%\\\" --output \\\"%output%\\\" --template=%self%/html.template\"\r\n```\r\n\r\nThere are a couple of special strings that can be used to substitute into the `rule.command` string:\r\n\r\n* `%input%`, this is the path to the input file\r\n* `%output%`, this is the path to the output file\r\n* `%self%`, this is the path to the directory that the sitemap file is in\r\n\r\n### 3. Processing Content\r\n\r\nOnce the `sitemap.toml` file is configured with all of the content for the site, it will need to be processed by `rite`. To do this, run `./rite` and pass it a single argument of the path to the `sitemap.toml` file. When processing content `rite` will output what files it is currently generating. If `rite` encounters an error, then it will print out an error message and quit immediately.\r\n\r\n### 4. Serving Content\r\n\r\nAll content is served by `ritual`. To start serving the website content, run `./ritual` with a single argument of the same `sitemap.toml` path you passed when running `rite`. This will use the sitemap file to determine the location of the exported content to serve and serve it statically.\r\n\r\n## Additional Tools\r\n\r\n### nginx\r\nWhile all content can be served directly by `ritual` using the Jester framework, it doesn't offer many of the common features of web-servers (such as logging and certificates). To do these things, I am running `nginx` as a reverse proxy to the `ritual` Jester application. This is to enhance the security and provice a more common interface for things like LetsEncrypt.\r\n\r\nI have included a copy of my `nginx` configuration file for reference to demonstrate how this works.\r\n\r\n### linkcheck\r\nTo validate that all of the links on my website are working and pointed at valid locations; i wrote a small tool to check that for me [linkcheck](https://github.com/samdmarshall/linkcheck). This software is also written in nim, and should just require a `nimble build` to build it once cloned locally. It takes a single parameter of a http server address to check, eg: `./linkcheck \"http://localhost:5000/\" \r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamdmarshall%2Fpewpewthespells-com","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamdmarshall%2Fpewpewthespells-com","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamdmarshall%2Fpewpewthespells-com/lists"}