Skip to content

Commit 3b6b389

Browse files
committed
feat: add Netlify config
Add a basic Netlify config to the site
1 parent bb6379f commit 3b6b389

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed

_layouts/default.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<html data-current="{{ page.section }}" lang="en-us">
77

88
{% include head.html %}
9+
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
910

1011
<body>
1112
<div>
@@ -17,6 +18,17 @@
1718
{% include footer.html %}
1819
</main>
1920
</div>
21+
<script>
22+
if (window.netlifyIdentity) {
23+
window.netlifyIdentity.on("init", user => {
24+
if (!user) {
25+
window.netlifyIdentity.on("login", () => {
26+
document.location.href = "/admin/";
27+
});
28+
}
29+
});
30+
}
31+
</script>
2032
</body>
2133

2234
</html>

admin/config.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Everything you need to know about configuring the CMS can be found here:-
2+
# https://www.netlifycms.org/docs/configuration-options/
3+
4+
backend:
5+
name: git-gateway # Netlify’s Git Gateway connects to Git provider’s API
6+
repo: studiojolicoeur/studiojolicoeur.github.io
7+
branch: main # Branch to update (main by default)
8+
squash_merges: true
9+
commit_messages:
10+
create: 'feat: Add [{{collection}}] {{slug}}'
11+
update: 'fix: Update [{{collection}}] {{slug}}'
12+
delete: 'fix: Delete [{{collection}}] {{slug}}'
13+
uploadMedia: 'fix: Media uploaded - {{path}}'
14+
deleteMedia: 'fix: Media removed - {{path}}'
15+
openAuthoring: '{{author-name}} / {{message}}'
16+
subfolder: ""
17+
logo_url:
18+
publish_mode: editorial_workflow # Enable drafts
19+
media_folder: "assets/uploads" # Folder where user uploaded files should go
20+
pull_request_url: https://github.com/studiojolicoeur/studiojolicoeur.github.io/pulls
21+
22+
collections: # A list of collections the CMS should be able to edit
23+
- name: "blog"
24+
label: "Blog"
25+
folder: "_posts/blog"
26+
create: true
27+
slug: {{month}}-{{day}}-{{year}}-{{slug}}
28+
fields:
29+
- label: "Layout"
30+
name: "title"
31+
widget: "hidden"
32+
default: "blog"
33+
- label: "Title"
34+
name: "title"
35+
widget: "string"
36+
- label: "Publish Date"
37+
name: "date"
38+
widget: "datetime"
39+
- label: "Featured Image"
40+
name: "thumbnail"
41+
widget: "image"
42+
- label: "Body"
43+
name: "body"
44+
widget: "markdown"

admin/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Studio Jolicoeur Content Manager</title>
7+
</head>
8+
<body>
9+
<!-- Include the script that builds the page and powers Netlify CMS -->
10+
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
11+
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
12+
</body>
13+
</html>

netlify.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[build]
2+
base = "/"
3+
publish = "docs/"
4+
command = "npm run build"
5+
6+
[build.environment]
7+
JEKYLL_ENV = "production"
8+
9+
# Production context: all deploys from the Production branch set in your site's deploy contexts will inherit these settings.
10+
[context.production]
11+
environment = { JEKYLL_ENV = "production" }
12+
base = "/"
13+
publish = "docs/"
14+
command = "npm run build"
15+
16+
# Deploy Preview context: all deploys generated from a pull/merge request will inherit these settings.
17+
[context.development]
18+
environment = { JEKYLL_ENV = "production" }
19+
base = "/"
20+
publish = "docs/"
21+
command = "npm run build"
22+
23+
# If skip_processing = true, all other settings are ignored
24+
[build.processing]
25+
skip_processing = false
26+
[build.processing.css]
27+
bundle = true
28+
minify = true
29+
[build.processing.js]
30+
bundle = true
31+
minify = true
32+
[build.processing.html]
33+
pretty_urls = true
34+
[build.processing.images]
35+
compress = true
36+
37+
# Skip all post processing in deploy previews,
38+
# ignoring any other settings
39+
[context.deploy-preview.processing]
40+
skip_processing = true

0 commit comments

Comments
 (0)