{"id":16167899,"url":"https://github.com/kylecorry31/static-site-generator","last_synced_at":"2025-04-07T06:17:38.808Z","repository":{"id":238136732,"uuid":"795957489","full_name":"kylecorry31/static-site-generator","owner":"kylecorry31","description":"A simple static site generator for blog style websites","archived":false,"fork":false,"pushed_at":"2024-05-04T14:07:29.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T10:23:05.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/kylecorry31.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":"2024-05-04T14:05:16.000Z","updated_at":"2024-05-04T14:07:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f81c4e4-91d8-41c4-8433-2f37eee5d6d0","html_url":"https://github.com/kylecorry31/static-site-generator","commit_stats":null,"previous_names":["kylecorry31/static-site-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2Fstatic-site-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2Fstatic-site-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2Fstatic-site-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2Fstatic-site-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylecorry31","download_url":"https://codeload.github.com/kylecorry31/static-site-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964866,"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-10-10T03:09:48.138Z","updated_at":"2025-04-07T06:17:38.785Z","avatar_url":"https://github.com/kylecorry31.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static Site Generator\nA simple static site generator for blog style websites.\n\n## Dependencies\n- Python 3\n- Install the required packages with `pip install -r requirements.txt`\n\n## Usage\n1. Fork this repository\n2. Update the content in the `sample` directory to your liking\n3. Optionally rename the `sample` directory to something else and update the 'source' entry in `config.yaml`\n4. Run `py build.py` to generate the site\n5. The generated site will be in the _site directory\n\nOptionally, you can run `py watch.py` run a local server and automatically rebuild the site when changes are made. It will host at http://localhost:8000.\n\n## Configuration\nThe configuration is stored in `config.yaml`. The following options are available:\n- `title`: The title of the site. This can be referenced in templates as `{{ title }}`\n- `description`: A description of the site. This can be referenced in templates as `{{ description }}`\n- `source`: The directory where the source files are stored. Defaults to `src`\n- `destination`: The directory where the generated site will be stored. Defaults to `_site`\n- `base_url`: The base URL of the site. This can be referenced in templates as `{{ base_url }}`. All relative URLs will use the base URL as the root.\n\n## Content\n\n### HTML\nHTML files are copied to the destination directory, and any mustache tags are replaced with the corresponding values from the configuration file.\n\n### Markdown\nMarkdown files are converted to HTML and then processed as HTML files.\n\n### Collections\nCollections are groups of pages that can be accessed in templates. For example, a collection of blog posts could be accessed in a template as `{{ collections.posts }}`.\n\nTo create a collection, just create a new folder in the source directory and add md files to it. The folder name will be the collection name and you can access the collection in templates as `{{ collections.\u003ccollection_name\u003e }}`.\n\nYou can create an index.html file in the collection directory to create an index page at the root of the collection folder.\n\nYou can create an _item.html file in the collection directory to create a template for each item in the collection, otherwise a simple dump of the content is used (or the _default template if provided).\n\n#### Items\nThe items are markdown files in the collection directory. Each item needs to have a `title` property. Optionally, you can add a `date` property to sort the items by date. The date should be in the format `YYYY-MM-DD`. You can also add a `category` property to categorize the items. See `sample/things` for an example.\n\nAny other properties you add to the item will be available in the template for the item.\n\n#### Properties\nThe following properties are available on collections:\n- `items`: A list of all the items in the collection that you can loop through. Items are sorted by `date` in descending order if the property exists on the item, otherwise, they will be sorted by `title` in ascending order.\n- `categories`: If your items contain a `category` property, this will be a list of all the unique categories. Each category contains a `name` and a list of `items` that belong to that category. See `sample/things` for an example.\n\n### Includes\nYou can create reusable HTML snippets in the `_includes` directory. These can be included in other files using the mustache syntax `{{{ filename-without-extension }}}`.\n\n### Defaults\nYou can create default layouts for items by creating an `_item.html` file in the `_defaults` directory. This will be used as the template for each item in the collection rather than a simple dump of the content. This can be overridden by creating an `_item.html` file in the collection's directory.\n\n\n### Example\nYou can find a live example at https://github.com/kylecorry31/kylecorry31.github.io","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylecorry31%2Fstatic-site-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylecorry31%2Fstatic-site-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylecorry31%2Fstatic-site-generator/lists"}