{"id":13879603,"url":"https://github.com/pgharts/trusty-cms","last_synced_at":"2025-05-16T18:07:30.315Z","repository":{"id":16341672,"uuid":"19091433","full_name":"pgharts/trusty-cms","owner":"pgharts","description":"TrustyCMS is a modern, Ruby on Rails-driven CMS that can be extended for any business needs.","archived":false,"fork":false,"pushed_at":"2025-05-07T20:45:19.000Z","size":18081,"stargazers_count":23,"open_issues_count":42,"forks_count":36,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-07T21:37:15.659Z","etag":null,"topics":["cms","cms-framework","hacktoberfest","rails","ruby"],"latest_commit_sha":null,"homepage":"","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/pgharts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2014-04-24T01:26:41.000Z","updated_at":"2025-04-21T14:31:12.000Z","dependencies_parsed_at":"2023-12-13T20:07:17.913Z","dependency_job_id":"0d87a941-4ab1-4e4b-a39f-73947cc85255","html_url":"https://github.com/pgharts/trusty-cms","commit_stats":{"total_commits":3219,"total_committers":120,"mean_commits":26.825,"dds":0.804287045666356,"last_synced_commit":"c51c6ab2a4cc272bc32a997e58b403effdc3ade1"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgharts%2Ftrusty-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgharts%2Ftrusty-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgharts%2Ftrusty-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgharts%2Ftrusty-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgharts","download_url":"https://codeload.github.com/pgharts/trusty-cms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582907,"owners_count":22095518,"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":["cms","cms-framework","hacktoberfest","rails","ruby"],"created_at":"2024-08-06T08:02:26.473Z","updated_at":"2025-05-16T18:07:30.292Z","avatar_url":"https://github.com/pgharts.png","language":"Ruby","readme":"## Welcome to TrustyCMS\n\n[![Gem Version](https://badge.fury.io/rb/trusty-cms.svg)](http://badge.fury.io/rb/trusty-cms)\n\nTrustyCMS is a branch of Radiant CMS. Its goal is to pull the Radiant framework into Rails 7 with minimal changes to its\ninfrastructure.\n\nTrustyCMS is a no-fluff, open source content management system designed for\nsmall teams. It is similar to Textpattern or MovableType, but is a general\npurpose content management system (not just a blogging engine). TrustyCMS is a\nRails engine and is built to be installed into an existing Rails 7 application as a gem.\n\nCircleCI: [![CircleCI](https://circleci.com/gh/pgharts/trusty-cms/tree/master.svg?style=shield)](https://circleci.com/gh/pgharts/trusty-cms/tree/master)\n\nCodeClimate: [![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/codeclimate/codeclimate)\n\nTrustyCMS features:\n\n* An elegant user interface\n* The ability to arrange pages in a hierarchy with drag and drop\n* Flexible templating with layouts, snippets, page parts, and a custom tagging\n  language\n* A simple user management/permissions system\n* Support for Markdown and Textile as well as traditional HTML (it's easy to\n  create other filters)\n* An advanced plugin system\n* Asset management \u0026 searching\n* Serve multiple sites (domains) from a single instance\n* Social sharing buttons\n* Reusable bits of content (Snippets)\n* Allows Rails controllers/actions to use Trusty CMS layouts as their \"layout\"\n* Operates in two modes: dev and production depending on the URL\n* A caching system which expires pages every 5 minutes\n* Built using Ruby on Rails (version 7)\n\n## License\n\nTrustyCMS is released under the MIT license. The Radiant portions of the\ncodebase are copyright (c) John W. Long and Sean Cribbs; anything after the\nfork is copyright (c) Pittsburgh Cultural Trust. A copy of the MIT license can\nbe found in the LICENSE file.\n\n## Installation and Setup\n\nTrustyCMS is a traditional Ruby on Rails engine, meaning that you can\nconfigure and run it the way you would a normal gem, like [Devise](https://github.com/plataformatec/devise).\n\nSee the INSTALL.md file for more instructions.\n\n### Installation\n\nPrerequisites:\n\n* A Github account and Git ([Github has some really good instructions](https://help.github.com/articles/set-up-git))\n* Ruby 3.1 or higher\n* A Rails application (currently supports version 7.0)\n* Bundler\n* MySQL\n* [PhantomJS \u003e= 1.8.1](https://github.com/teampoltergeist/poltergeist/tree/v1.5.0#installing-phantomjs)\n\nSteps:\n\n1. Fork this repository to your Github account.\n1. Clone your fork to your machine.\n1. `cd` into the directory you just cloned into.\n1. Follow the INSTALL.md instructions to setup an empty app with TrustyCMS installed. To modify TrustyCMS,\n   point your dependency to the local path of your fork.\n\n   gem 'trusty-cms', path: '../trusty-cms'\n\n1. Set up your databases in your Rails application:\n\n        bundle exec rake db:create\n        bundle exec rake db:migrate\n\n1. Run the tests to make sure they pass (If they don't, file a bug!):\n\n        rspec\n\n### Preview Custom Page Types\n\nTrustyCMS supports a preview feature for standard page types. However, this functionality may not work out of the box for custom page types. To enable the preview feature for your custom page types, follow these steps:\n\n1. In your application, create the following initializer file: `config/initializers/preview_page_types.rb`\n2. Inside this file, define a `PREVIEW_PAGE_TYPES` array constant with the names of the page types you’d like to enable the Preview button for, for example:\n\n   ```ruby\n   PREVIEW_PAGE_TYPES = %w[\n     BlogPage\n     FacilityPage\n     FileNotFoundPage\n   ].freeze\n   ```\n   \n3. Test the Preview button with each custom page type. If a page type does not preview correctly, remove it from the list.\n\n### Custom Page Type Routes Setup\nAdditional configuration is required to ensure correct URL generation in the admin interface — specifically for the \"Edit Page\" dropdown and the \"Save and View Draft\" functionality.\n\nTo enable this, create the following initializer: `config/initializers/page_type_routes.rb`\n\nIn this file, define a `CUSTOM_PAGE_TYPE_ROUTES` hash constant that maps custom Page model class names to the corresponding route segments defined in your `config/routes.rb` file. For example, the BlogPage model maps to the route `get 'blog/:slug'`, so its route segment is `'blog'`.\n\nFor custom Page models that rely on default routing behavior, define a `DEFAULT_PAGE_TYPE_ROUTES` array listing their class names. TrustyCMS will use these mappings to correctly build page URLs for use in the admin UI.\n\n```ruby\nCUSTOM_PAGE_TYPE_ROUTES = {\n  BlogPage: 'blog',\n  DonationPage: 'donate',\n  ExhibitionPage: 'exhibit',\n  NonTicketedEventPage: 'event',\n  PackagePage: 'package',\n  PersonPage: 'biography',\n  ProductionPage: 'production',\n  VenuePage: 'venues',\n}.freeze\n\nDEFAULT_PAGE_TYPE_ROUTES = %w[\n  ConstituencyPage\n  FacilityPage\n  FileNotFoundPage\n  RailsPage\n].freeze\n```\n\n### Page Status Refresh Setup\n\nTo ensure **Scheduled Pages** automatically update their status to **Published** after their designated **Publish Date \u0026 Time**, follow these steps to set up an automated refresh using **AWS Lambda** and **EventBridge**.  \n\n**1. Generate a Bearer Token**  \nOpen a Rails console and run the following command:  \n```bash\nrails c\n```  \nThen generate a token:  \n```ruby\nSecureRandom.base58(24)\n```  \n\n**2. Store the Token in Rails Credentials**  \nTo store your token securely, edit your Rails credentials by running the following command:\n```bash\nbin/rails encrypted:edit config/credentials.yml.enc\n```\nThen, add the token to your credentials file under the `trusty_cms` namespace:\n```yaml\ntrusty_cms:\n  page_status_bearer_token: '\u003cyour bearer token\u003e'\n```\n\n**3. Add Google Tag Manager Container ID (Optional)**\nIf you'd like to enable trusty-cms to submit Google Tag Manager data for tracking admin page activity (this does not include public-facing pages), add your Google Tag Manager Container ID to the `trusty_cms` section of your `credentials.yml.enc` file:\n ```yaml\ntrusty_cms:\n  page_status_bearer_token: '\u003cyour bearer token\u003e'\n  gtm_container_id: 'GTM-xxxxxx'\n```\n\n**4. Create a Ruby Lambda Function in AWS**  \n- Log into **AWS Lambda** and create a **new Ruby Lambda function**.  \n- Note the **Ruby version** used, as you'll need it locally.  \n- Use [rbenv](https://github.com/rbenv/rbenv) to manage the Ruby version locally:  \n  ```bash\n  rbenv install 3.3.0\n  rbenv local 3.3.0\n  ```\n\n**5. Write the Lambda Function Code**  \nIn your local development environment:  \n- Create a new folder and open it in your IDE.  \n- Save the following code in a file named `lambda_handler.rb`:  \n\n```ruby\nrequire 'httparty'\n\ndef lambda_handler(event:, context:)\n  uri = ENV['API_ENDPOINT']\n  token = ENV['BEARER_TOKEN']\n\n  response = HTTParty.post(\n    uri,\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': \"Bearer #{token}\"\n    }\n  )\n\n  if response.success?\n    puts \"Success: #{response.body}\"\n  else\n    puts \"Error: #{response.code} - #{response.message}\"\n  end\nend\n```\n\n**6. Install Dependencies**  \nRun the following commands in your terminal:  \n```bash\ngem install bundler\nbundle init\n```  \nAdd the dependency to your `Gemfile`:  \n```ruby\ngem 'httparty'\n```  \nInstall dependencies locally:  \n```bash\nbundle config set --local path 'vendor/bundle'\nbundle install\n```\n\n**7. Package the Lambda Function**  \nArchive your function and dependencies:  \n```bash\nzip -r lambda_package.zip .\n```\n\n**8. Upload to AWS Lambda**  \n- In **AWS Lambda**, open your function.  \n- Select **Upload From \u003e .zip file**.  \n- Upload the `lambda_package.zip` file.  \n\n**9. Configure Environment Variables**  \nIn the AWS Lambda Configuration: \n- Go to **Environment Variables** \u003e **Edit**.  \n- Add the following:  \n  - `API_ENDPOINT`: `\u003cyour-url\u003e/page-status/refresh`  \n  - `BEARER_TOKEN`: `\u003cyour bearer token\u003e`  \n\n**10. Set Up EventBridge Trigger**  \n- In **Configuration Settings \u003e Triggers**, create a **new EventBridge Trigger**.  \n- Set the **Schedule** to match your desired **page status refresh frequency**.  \n\nYour setup is now complete, and **Scheduled Pages** will automatically update their status via the AWS Lambda and EventBridge integration.\n\n### Contributing to TrustyCMS\n\nWhen you're ready to make a change:\n\n1. Add the pgharts fork as a git remote called \"upstream\":\n   `git remote add upstream https://github.com/pgharts/trusty-cms.git` so that you can keep up with changes that other\n   people make.\n1. Fetch the remote you just added: `git fetch upstream`.\n1. Start a new branch for the change you're going to make. Name it something having to do with the changes, like \"\n   fix-queries\" if you are going to try to fix some queries. Base this branch on `upstream/master` by running\n   `git checkout -b fix-queries upstream/master`.\n1. Make your changes and commit them. Please include tests!\n1. Run the tests and make sure they pass.\n1. Push your changes to your github fork: `git push origin fix-queries`.\n1. Send a pull request to the pgharts fork.\n\n## Support\n\nAll of the development for TrustyCMS happens on Github:\n\nhttps://github.com/pgharts/trusty-cms\n\nTrustyCMS is supported in part by:\n\n* [The Allegheny Regional Asset District (RAD)](https://www.radworkshere.org/)\n* [Browserstack](https://www.browserstack.com/)\n\nEnjoy!\n\n--\nThe TrustyCMS Dev Team\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgharts%2Ftrusty-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgharts%2Ftrusty-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgharts%2Ftrusty-cms/lists"}