{"id":13819075,"url":"https://github.com/sitepress/sitepress","last_synced_at":"2025-05-16T04:32:17.609Z","repository":{"id":37887130,"uuid":"67986268","full_name":"sitepress/sitepress","owner":"sitepress","description":"Sitepress ruby gems","archived":false,"fork":false,"pushed_at":"2025-03-12T18:15:02.000Z","size":687,"stargazers_count":352,"open_issues_count":21,"forks_count":19,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T03:03:45.798Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sitepress.cc","language":"Ruby","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/sitepress.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":"support/benchmark_dsl.rb","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-12T07:29:44.000Z","updated_at":"2025-04-08T13:29:42.000Z","dependencies_parsed_at":"2024-08-29T08:31:02.778Z","dependency_job_id":"b6b45616-501d-4c5f-9b83-8926dd1b9e82","html_url":"https://github.com/sitepress/sitepress","commit_stats":null,"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitepress%2Fsitepress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitepress%2Fsitepress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitepress%2Fsitepress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitepress%2Fsitepress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitepress","download_url":"https://codeload.github.com/sitepress/sitepress/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254469310,"owners_count":22076478,"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-08-04T08:00:39.322Z","updated_at":"2025-05-16T04:32:17.602Z","avatar_url":"https://github.com/sitepress.png","language":"Ruby","funding_links":[],"categories":["Ruby","Happy Exploring 🤘"],"sub_categories":[],"readme":"# Sitepress\n\nSitepress is a file-backed website content manager that can be embedded in popular web frameworks like Rails, run stand-alone, or be compiled into static sites. Its useful for marketing pages or small websites that you need to deploy within your web frameworks.\n\nIt features:\n\n* Wide support for templates incuding Erb, Haml, Slim, and more.\n* Static site compilation to S3, Netlify, etc.\n* Embedable in Rails monoliths\n* Frontmatter\n* Page models\n* Helpers\n\n[![Build status](https://github.com/sitepress/sitepress/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/sitepress/sitepress/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/14edce5d81e1892d2836/maintainability)](https://codeclimate.com/github/sitepress/sitepress/maintainability)\n\n## Installation\n\n### Rails Installation\n\nIt all starts by running the following from the root of your rails project:\n\n```ruby\nbundle add sitepress-rails\n```\n\nThen follow the instructions in the [Sitepress Rails](./sitepress-rails) gem.\n\n### Standalone Installation\n\nInstall the Sitepress gem on your system:\n\n    $ gem install sitepress\n\nThen create a new site:\n\n    $ sitepress new my-site\n\nSitepress will create a new site and download and install the gems it needs. Once that's done run:\n\n    $ cd my-site\n\nThen start the Sitepress development server:\n\n    $ sitepress server\n\nYou should then see the site at http://localhost:8080/. Time to start building something beautiful!\n\n# Features\n\nSitepress implements a subset of the best features from the [Middleman](http://www.middlemanapp.com/) static site generator including the Site and Parsers::Frontmatter.\n\n## Frontmatter\n\nFrontmatter is a way to attach metadata to content pages. Its a powerful way to enable a team of writers and engineers work together on content. The engineers focus on reading values from frontmatter while the writers can change values.\n\n```haml\n---\ntitle: This is a swell doc\nmeta:\n  keywords: this, is, a, test\nbackground_color: #0f0\n---\n\n%html\n  %head\n    %meta(name=\"keywords\" value=\"#{current_page.data.dig(\"meta\", \"keywords\")}\")\n  %body(style=\"background: #{current_page.data[\"background_color\"]};\")\n    %h1=current_page.data[\"title\"]\n    %p And here's the rest of the content!\n```\n\n## Site\n\nThe Site accepts a directory path\n\n```irb\n\u003e site = Sitepress::Site.new(root_path: \"spec/pages\")\n=\u003e #\u003cSitepress::Site:0x007fcd24103710 @root=#\u003cPathname:spec/pages\u003e, @request_path=#\u003cPathname:/\u003e\u003e\n```\n\nThen you can request a resource by request path:\n\n```irb\n\u003e resource = site.get(\"/test\")\n=\u003e #\u003cSitepress::Resource:0x007fcd2488a128 @request_path=\"/test\", @content_type=\"text/html\", @file_path=#\u003cPathname:spec/pages/test.html.haml\u003e, @frontmatter=#\u003cSitepress::Parsers::Frontmatter:0x007fcd24889e80 @data=\"title: Name\\nmeta:\\n  keywords: One\", @body=\"\\n!!!\\n%html\\n  %head\\n    %title=current_page.data[\\\"title\\\"]\\n  %body\\n    %h1 Hi\\n    %p This is just some content\\n    %h2 There\\n\"\u003e\u003e\n```\n\nAnd access the frontmatter data (if available) and body of the template.\n\n```irb\n\u003e resource.data\n=\u003e {\"title\"=\u003e\"Name\", \"meta\"=\u003e{\"keywords\"=\u003e\"One\"}}\n\u003e resource.body\n=\u003e \"\\n!!!\\n%html\\n  %head\\n    %title=current_page.data[\\\"title\\\"]\\n  %body\\n    %h1 Hi\\n    %p This is just some content\\n    %h2 There\\n\"\n```\n\n### Resource globbing\n\nThe Site API is a powerful way to query content via resource globbing. For example, if you have a folder full of files but you only want all `.html` files within the `docs` directory, you'd do something like:\n\n```haml\n%ol\n  -site.resources.glob(\"docs/*.html*\").each do |page|\n    %li=link_to page.data[\"title\"], page.request_path\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/sitepress/sitepress.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitepress%2Fsitepress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitepress%2Fsitepress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitepress%2Fsitepress/lists"}