trusty-cms 7.0.11 → 7.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +19 -11
- data/app/controllers/page_status_controller.rb +1 -1
- data/app/models/standard_tags.rb +1 -1
- data/app/models/status.rb +0 -1
- data/app/views/layouts/application.html.haml +17 -0
- data/config/locales/en_available_tags.yml +1 -1
- data/lib/generators/language_extension/templates/available_tags.yml +1 -1
- data/lib/trusty_cms/version.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68da1e89b8b32169bb6baae3589febf0efdd68e428c5b2b9c75515031d136d99
|
4
|
+
data.tar.gz: a3cd6ddf61e71846d5c0e5d1e6ab1c348acbad2eda00f19e3cd9177b08267fb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4218c6ba21d0d1d5af483ef5dbbb10c9111345197203140db5d35dac610a0654235853636f0192cb4d81c170ed054d32cc886c09ccef7f74a9e31b4fbcf1540f
|
7
|
+
data.tar.gz: ba63184aeac33e4cd048ff7446cf656347861513b682e7835b441847aa4d0ad63e7b0ca7312029310b573cde87d9098039eb49de48e4859a6af2e30fa5ec4329
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -93,17 +93,25 @@ SecureRandom.base58(24)
|
|
93
93
|
```
|
94
94
|
|
95
95
|
**2. Store the Token in Rails Credentials**
|
96
|
-
|
96
|
+
To store your token securely, edit your Rails credentials by running the following command:
|
97
97
|
```bash
|
98
98
|
bin/rails encrypted:edit config/credentials.yml.enc
|
99
|
-
```
|
100
|
-
|
99
|
+
```
|
100
|
+
Then, add the token to your credentials file under the `trusty_cms` namespace:
|
101
101
|
```yaml
|
102
102
|
trusty_cms:
|
103
103
|
page_status_bearer_token: '<your bearer token>'
|
104
|
-
```
|
104
|
+
```
|
105
|
+
|
106
|
+
**3. Add Google Tag Manager Container ID (Optional)**
|
107
|
+
If 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:
|
108
|
+
```yaml
|
109
|
+
trusty_cms:
|
110
|
+
page_status_bearer_token: '<your bearer token>'
|
111
|
+
gtm_container_id: 'GTM-xxxxxx'
|
112
|
+
```
|
105
113
|
|
106
|
-
**
|
114
|
+
**4. Create a Ruby Lambda Function in AWS**
|
107
115
|
- Log into **AWS Lambda** and create a **new Ruby Lambda function**.
|
108
116
|
- Note the **Ruby version** used, as you'll need it locally.
|
109
117
|
- Use [rbenv](https://github.com/rbenv/rbenv) to manage the Ruby version locally:
|
@@ -112,7 +120,7 @@ trusty_cms:
|
|
112
120
|
rbenv local 3.3.0
|
113
121
|
```
|
114
122
|
|
115
|
-
**
|
123
|
+
**5. Write the Lambda Function Code**
|
116
124
|
In your local development environment:
|
117
125
|
- Create a new folder and open it in your IDE.
|
118
126
|
- Save the following code in a file named `lambda_handler.rb`:
|
@@ -140,7 +148,7 @@ def lambda_handler(event:, context:)
|
|
140
148
|
end
|
141
149
|
```
|
142
150
|
|
143
|
-
**
|
151
|
+
**6. Install Dependencies**
|
144
152
|
Run the following commands in your terminal:
|
145
153
|
```bash
|
146
154
|
gem install bundler
|
@@ -156,25 +164,25 @@ bundle config set --local path 'vendor/bundle'
|
|
156
164
|
bundle install
|
157
165
|
```
|
158
166
|
|
159
|
-
**
|
167
|
+
**7. Package the Lambda Function**
|
160
168
|
Archive your function and dependencies:
|
161
169
|
```bash
|
162
170
|
zip -r lambda_package.zip .
|
163
171
|
```
|
164
172
|
|
165
|
-
**
|
173
|
+
**8. Upload to AWS Lambda**
|
166
174
|
- In **AWS Lambda**, open your function.
|
167
175
|
- Select **Upload From > .zip file**.
|
168
176
|
- Upload the `lambda_package.zip` file.
|
169
177
|
|
170
|
-
**
|
178
|
+
**9. Configure Environment Variables**
|
171
179
|
In the AWS Lambda Configuration:
|
172
180
|
- Go to **Environment Variables** > **Edit**.
|
173
181
|
- Add the following:
|
174
182
|
- `API_ENDPOINT`: `<your-url>/page-status/refresh`
|
175
183
|
- `BEARER_TOKEN`: `<your bearer token>`
|
176
184
|
|
177
|
-
**
|
185
|
+
**10. Set Up EventBridge Trigger**
|
178
186
|
- In **Configuration Settings > Triggers**, create a **new EventBridge Trigger**.
|
179
187
|
- Set the **Schedule** to match your desired **page status refresh frequency**.
|
180
188
|
|
@@ -15,7 +15,7 @@ class PageStatusController < ApplicationController
|
|
15
15
|
|
16
16
|
def authenticate_bearer_token
|
17
17
|
provided_token = request.headers['Authorization']&.split(' ')&.last
|
18
|
-
expected_token = Rails.application.credentials
|
18
|
+
expected_token = Rails.application.credentials&.dig(:trusty_cms, :page_status_bearer_token)
|
19
19
|
|
20
20
|
if provided_token.blank?
|
21
21
|
render json: { error: 'Missing Bearer Token' }, status: :unauthorized and return
|
data/app/models/standard_tags.rb
CHANGED
@@ -103,7 +103,7 @@ module StandardTags
|
|
103
103
|
<pre><code><r:children:each [offset="number"] [limit="number"]
|
104
104
|
[by="published_at|updated_at|created_at|slug|title|keywords|description"]
|
105
105
|
[order="asc|desc"]
|
106
|
-
[status="draft|reviewed|published|
|
106
|
+
[status="draft|reviewed|scheduled|published|all"]
|
107
107
|
[paginated="true"]
|
108
108
|
[per_page="number"]
|
109
109
|
>
|
data/app/models/status.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
- gtm_container_id = Rails.application.credentials&.dig(:trusty_cms, :gtm_container_id)
|
1
2
|
<!DOCTYPE html>
|
2
3
|
%html{ :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en", :class => "tablesaw-enhanced fontawesome-i2svg-active fontawesome-i2svg-complete" }
|
3
4
|
%head
|
@@ -8,6 +9,19 @@
|
|
8
9
|
- @stylesheets.uniq.each do |stylesheet|
|
9
10
|
= stylesheet_link_tag stylesheet, media: "all"
|
10
11
|
|
12
|
+
- if gtm_container_id
|
13
|
+
%script{:type=>"text/javascript"}
|
14
|
+
:plain
|
15
|
+
(function(w, d, s, l, i) {
|
16
|
+
w[l] = w[l] || [];
|
17
|
+
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
|
18
|
+
var f = d.getElementsByTagName(s)[0],
|
19
|
+
j = d.createElement(s),
|
20
|
+
dl = l != 'dataLayer' ? '&l=' + l : '';
|
21
|
+
j.async = true;
|
22
|
+
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
23
|
+
f.parentNode.insertBefore(j, f);
|
24
|
+
})(window, document, 'script', 'dataLayer', "#{gtm_container_id}");
|
11
25
|
%script{:type=>"text/javascript"}
|
12
26
|
var relative_url_root = "#{ActionController::Base.relative_url_root}";
|
13
27
|
|
@@ -30,6 +44,9 @@
|
|
30
44
|
= csrf_meta_tags
|
31
45
|
|
32
46
|
%body{:class=>body_classes.join(" ")}
|
47
|
+
- if gtm_container_id
|
48
|
+
%noscript
|
49
|
+
%iframe{src: "https://www.googletagmanager.com/ns.html?id=#{gtm_container_id}", height: "0", width: "0", style: "display:none;visibility:hidden"}
|
33
50
|
#page.trusty-container
|
34
51
|
%header
|
35
52
|
- if logged_in?
|
@@ -141,7 +141,7 @@ en:
|
|
141
141
|
<pre><code><r:children:each [offset=\"number\"] [limit=\"number\"]
|
142
142
|
[by=\"published_at|updated_at|created_at|slug|title|keywords|description\"]
|
143
143
|
[order=\"asc|desc\"]
|
144
|
-
[status=\"draft|reviewed|published|
|
144
|
+
[status=\"draft|reviewed|scheduled|published|all\"]
|
145
145
|
[paginated=\"true\"]
|
146
146
|
[per_page=\"number\"]
|
147
147
|
>
|
@@ -107,7 +107,7 @@
|
|
107
107
|
|
108
108
|
<pre><code><r:children:each [offset="number"] [limit="number"]
|
109
109
|
[by="published_at|updated_at|created_at|slug|title|keywords|description"]
|
110
|
-
[order="asc|desc"] [status="draft|reviewed|published|
|
110
|
+
[order="asc|desc"] [status="draft|reviewed|scheduled|published|all"]>
|
111
111
|
...
|
112
112
|
</r:children:each>
|
113
113
|
</code></pre>
|
data/lib/trusty_cms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trusty-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TrustyCms CMS dev team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage-validator
|