Skip to content

Commit

Permalink
feat: Add CMS settings
Browse files Browse the repository at this point in the history
  • Loading branch information
delisma committed Jun 6, 2024
1 parent 40c46bb commit 6156afc
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 48 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ Temporary Items
# Jekyll
.jekyll-cache
_site
vendor
vendor
Gemifile
Gemfile.lock
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "jekyll-seo-tag"
gem "jekyll-remote-theme", github: "benbalter/jekyll-remote-theme", branch: "master"
gem "jekyll-remote-theme", github: "benbalter/jekyll-remote-theme", branch: "master"
70 changes: 37 additions & 33 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,73 +12,77 @@ GIT
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.1.10)
concurrent-ruby (1.3.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
ffi (1.17.0-arm64-darwin)
forwardable-extended (2.6.0)
google-protobuf (4.27.0-arm64-darwin)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.10.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jekyll (4.2.2)
jekyll (4.3.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (~> 3.0)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.2)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
public_suffix (5.0.5)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.28.0)
rexml (3.2.8)
strscan (>= 3.0.9)
rouge (4.2.1)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
sass-embedded (1.77.4-arm64-darwin)
google-protobuf (>= 3.25, < 5.0)
strscan (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
webrick (1.8.1)

PLATFORMS
universal-darwin-20
universal-darwin-21
x86_64-linux
arm64-darwin-22

DEPENDENCIES
jekyll-remote-theme!
jekyll-seo-tag

BUNDLED WITH
2.3.9
2.4.13
17 changes: 14 additions & 3 deletions _includes/resources-inc/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@
<script src="{{ setting-resourcesBasePathTheme }}/js/theme{{ setting-minifiedSuffix }}.js"></script>
{%- if page.script.first -%}
{%- for js in page.script -%}
<script src="{{ js }}"></script>
<script src="{{ js }}"></script>
{%- endfor -%}
{%- elsif page.script -%}
<script src="{{ page.script }}"></script>
<script src="{{ page.script }}"></script>
{%- endif -%}
{% if site.analytics.adobe %}{% include /providers/adobefooter.html %}{% endif %}
{% if site.analytics.adobe %}{% include /providers/adobefooter.html %}{% endif %}
<script>
if (window.netlifyIdentity) {
window.netlifyIdentity.on("init", (user) => {
if (!user) {
window.netlifyIdentity.on("login", () => {
document.location.href = "/admin/";
});
}
});
}
</script>
17 changes: 17 additions & 0 deletions _includes/resources-inc/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<link href="{{ setting-resourcesBasePathTheme }}/assets/favicon.ico" rel="icon" type="image/x-icon" />
<link rel="stylesheet" href="{{ setting-resourcesBasePathTheme }}/css/theme{{ setting-minifiedSuffix }}.css" />
<noscript>
<link rel="stylesheet" href="{{ setting-resourcesBasePathWetboew }}/css/noscript{{ setting-minifiedSuffix }}.css" />
</noscript>
{%- if page.css.first -%}
{%- for sheet in page.css -%}
{%- if sheet.first -%}
<link rel="stylesheet" href="{{ sheet.href }}" integrity="{{ sheet.integrity }}" crossorigin="anonymous" />
{%- elsif sheet -%}
<link rel="stylesheet" href="{{ sheet }}" />
{%- endif -%}
{%- endfor -%}
{%- elsif page.css -%}
<link rel="stylesheet" href="{{ page.css }}" />
{%- endif -%}
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
14 changes: 7 additions & 7 deletions _layouts/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
{%- endcapture -%}
<!DOCTYPE html>
<html class="no-js" lang="{{ page.language | default: 'en' }}" dir="{{ i18nText-langDir | default: 'ltr' }}">
<head>
<meta charset="utf-8">
<head>
<meta charset="utf-8">
{% include license.html %}
<title>{{ page-title }} | {{ site.title[ page.language ] }}</title>
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>{{ page-title }} | {{ site.title[ page.language ] }}</title>
<meta content="width=device-width, initial-scale=1" name="viewport">
{% include metadata.html %}
{% include resources-inc/head.html %}
{% include analytics.html %}
</head>
<body {% if page.pageclass %}class="{{ page.pageclass }}" {% endif %}vocab="http://schema.org/" typeof="WebPage">
</head>
<body {% if page.pageclass %}class="{{ page.pageclass }}" {% endif %}vocab="http://schema.org/" typeof="WebPage">
{%- if page.archived -%}
{% include headers-includes/archive.html %}
{%- endif -%}
Expand All @@ -26,5 +26,5 @@
{{ content }}
{% include footers/footer.html %}
{% include resources-inc/footer.html %}
</body>
</body>
</html>
41 changes: 41 additions & 0 deletions en/admin/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
backend:
name: git-gateway
branch: content # Branch to update (optional; defaults to master)
# This line should *not* be indented
media_folder: "en/images/thumbs" # Media files will be stored in the repo under images/uploads
public_folder: "/en/images/thumbs"

i18n:
structure: multiple_folders

locales: [en, fr]

default_locale: en

collections:
- name: "blog" # Used in routes, e.g., /admin/collections/blog
label: "Blog" # Used in the UI
i18n: true
folder: "en/_posts" # The path to the folder where the documents are stored
create: true # Allow users to create new documents in this collection
slug: "{{year}}/{{month}}/{{day}}/{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
identifier_field: slug
fields: # The fields for each document, usually in front matter
- { label: "Alternate language page url", name: "altLangPage", widget: "string" }
- { label: "Title", name: "title", widget: "string" }
- { label: "Publish Date", name: "date", widget: "datetime" }
- { label: "Description", name: "description", widget: "string" }
- { label: "Thumbnail image", name: "thumbnail", widget: "image" }
- { label: "Body", name: "body", widget: "markdown" }
- name: "pages"
label: "Pages"
folder: "en/pages"
create: true
slug: "{{slug}}"
fields:
- { label: "Layout", name: "layout", widget: "string" }
- { label: "Body", name: "body", widget: "markdown" }

logo_url: https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/assets/sig-blk-en.svg
publish_mode: editorial_workflow
site_url: https://blog.canada.ca
14 changes: 14 additions & 0 deletions en/admin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" />
<title>Canada.ca Design System Content Manager</title>
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</head>
<body>
<!-- Include the script that builds the page and powers Decap CMS -->
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[redirects]]
from = "/admin"
to = "/admin/"
status = 200

0 comments on commit 6156afc

Please sign in to comment.