{"id":20777225,"url":"https://github.com/sharadcodes/my_py_site","last_synced_at":"2025-07-12T21:34:00.272Z","repository":{"id":52835948,"uuid":"233413539","full_name":"sharadcodes/my_py_site","owner":"sharadcodes","description":"World's smallest static site generator made in Python","archived":false,"fork":false,"pushed_at":"2024-01-11T17:27:15.000Z","size":5089,"stargazers_count":20,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T18:32:35.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://jamstack.org/generators/my_py_site/","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/sharadcodes.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,"zenodo":null}},"created_at":"2020-01-12T15:25:53.000Z","updated_at":"2025-03-02T18:43:48.000Z","dependencies_parsed_at":"2025-04-30T18:39:18.333Z","dependency_job_id":null,"html_url":"https://github.com/sharadcodes/my_py_site","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sharadcodes/my_py_site","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharadcodes%2Fmy_py_site","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharadcodes%2Fmy_py_site/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharadcodes%2Fmy_py_site/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharadcodes%2Fmy_py_site/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharadcodes","download_url":"https://codeload.github.com/sharadcodes/my_py_site/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharadcodes%2Fmy_py_site/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265059343,"owners_count":23705214,"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-17T13:14:33.216Z","updated_at":"2025-07-12T21:34:00.215Z","avatar_url":"https://github.com/sharadcodes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# my_py_site\n\nThe world's smallest and lightweight static site and blog generator for Python lovers.\n\n# HIGHLIGHTS\n  * YML Front matter is supported\n  * Jinja 2 Templates\n  * Almost similary to Jekyll\n  * Deploy on Netlify (Just fork and add it to netlify)\n  * Compatible with Netlify CMS\n  * Made in India :smile:\n\n[my_py_site](https://github.com/sharadcodes/my_py_site) is the most \nsimplest and lightweight static site generator out there, with less than\n90 lines of code.\n\n**[my_py_site](https://github.com/sharadcodes/my_py_site) was made in \njust two hours** but the development will go further and enhancements\nwill be done in the future to make things more easy.\n\nWith approx 90 lines of code it becomes the smallest Static Site \nGenerator which is capable of generating multiple pages, blogs.\n\nThe documentation is going on, although you won't need because it's\nthat simple.\nAfter cloning or downloading the [repo](https://github.com/sharadcodes/my_py_site) just run\n```\npip install -r requirements.txt\npython my_py_site.py\n```\nand the site will be generated.\n\n\n\u003eDeveloper: [Sharad Raj](https://sharadcodes.github.io)\n\n---\n\n## [Live Demo](https://mypysite.netlify.com/)\n\n---\n\n# USAGE\n\n**my_py_site** supports multiple blogs and pages, you dont have to do modify the `my_py_site.py` file.\n\n## Configuration file\n\nThe contents of this file can be accessed from templates which are inside `templates` directory. You will have to use the **Jinja2** syntax for accessing the data of `config.json` file.\n\n### Example\n\n```json\n{\n  \"site\": {\n    \"title\": \"My Awesome Site\",\n    \"author\": \"Sharad Raj\"\n  },\n  \"social\": [\n    {\n      \"site\": \"twitter\",\n      \"id\": \"iamsharadraj\"\n    },\n    {\n      \"site\": \"github\",\n      \"id\": \"sharadcodes\"\n    }    \n  ]\n}\n```\n\nIn the above config you for accessing the value of `title` inside `site` you will do\n```python\n{{data.site.title}}\n```\nin the templates. **data** is global and it is needed for accessing the values of `config.json` file\n\nSimilarly for looping over an array of objects like `social` you will do\n```python\n{% for i in data.social %}\n  {{ i.site }}\n  {{ i.id }}\n{% endfor %}\n```\n[Actual code example](https://github.com/sharadcodes/my_py_site/blob/master/templates/post.html)\n\n**Anything inside `config.json` can be accessed from any of the templates**\n\n## List of collections\n\nAll the meta info about files inside the collections folder can be accessed from any page which is inside `pages` folder.\nThe meta information about files is inside `data.collections` object which is an array of objects. The YML front matter of the page is also available.\n\n### Example\n\nTo access list of articles inside `posts` folder you will do\n```python\n{% for i in data.site.collections %}\n  {{i.url}}\n  {{i.title}}\n  {{i.author}}\n  {{i.date or i.datetime}}\n{%endfor%}\n```\n\n[Actual code example](https://github.com/sharadcodes/my_py_site/blob/master/templates/blog.html)\n\n---\n\n## For any help create an issue in the repo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharadcodes%2Fmy_py_site","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharadcodes%2Fmy_py_site","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharadcodes%2Fmy_py_site/lists"}