Skip to content

Commit fd96634

Browse files
committed
Improved CMS configuration
1 parent fdb7201 commit fd96634

File tree

4 files changed

+96
-44
lines changed

4 files changed

+96
-44
lines changed

static/admin/config.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ backend:
2525

2626
media_folder: "static/images/uploads" # Adjust based on your media storage location
2727
public_folder: "/images/uploads" # URL path for accessing media
28-
logo_url: "https://pine64.org/img/logo.png"
28+
logo:
29+
src: https://pine64.org/img/logo.png
30+
show_in_header: true
31+
search: false
32+
slug:
33+
encoding: "ascii"
34+
clean_accents: true
35+
sanitize_replacement: "_"
2936

3037
collections:
3138
- name: "blog" # This is the name used in the URL
@@ -36,6 +43,7 @@ collections:
3643
slug: "{{slug}}" # Filename template for new posts
3744
preview_path: "{{year}}/{{month}}/{{day}}/{{slug}}/"
3845
preview: false
46+
delete: false
3947
fields: # List of fields for the front matter
4048
- { label: "Title", name: "title", widget: "string" }
4149
#- { label: "Description", name: "description", widget: "text", required: false}
@@ -61,6 +69,7 @@ collections:
6169
create: true # Allows users to create new documents in this collection
6270
slug: "{{slug}}" # Filename template for new posts
6371
preview: false
72+
delete: false
6473
fields: # List of fields for the front matter
6574
- { label: "Title", name: "title", widget: "string" }
6675
#- { label: "Description", name: "description", widget: "text", required: false }
@@ -91,6 +100,7 @@ collections:
91100
create: true # Allows users to create new documents in this collection
92101
slug: "{{slug}}" # Filename template for new posts
93102
preview: false
103+
delete: false
94104
fields: # List of fields for the front matter
95105
- { label: "Title", name: "title", widget: "string" }
96106
- { label: "Description", name: "description", widget: "text", required: false }
@@ -105,7 +115,7 @@ collections:
105115
folder: "content/documentation" # The folder where your posts markdown files will be saved
106116
create: true # Allows users to create new documents in this collection
107117
preview: false
108-
i18n: false
118+
delete: false
109119
nested:
110120
#subfolders: true # Legacy behavior
111121
subfolders: false
@@ -147,6 +157,7 @@ collections:
147157
create: true # Allows users to create new documents in this collection
148158
slug: "{{slug}}" # Filename template for new posts
149159
preview: false
160+
delete: false
150161
fields: # List of fields for the front matter
151162
- { label: "Title", name: "title", widget: "string" }
152163
- { label: "Description", name: "description", widget: "text", required: false }

static/admin/custom.css

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,29 @@
1-
html,
2-
body {
3-
padding: 20px;
4-
font-family: system-ui, Roboto, Helvetica, Arial, sans-serif;
5-
font-size: 15px;
6-
line-height: 1.5;
7-
}
8-
h2 {
9-
font-weight: 700;
10-
line-height: 1;
11-
font-size: 24px;
12-
margin-top: 12px;
13-
}
14-
img {
15-
max-width: 100%;
1+
input {
2+
padding: 4px 6px !important;
163
}
17-
18-
.frame-content div {
19-
padding-bottom: 10px;
4+
input[name="email"], input[name="password"] {
5+
padding: 10px !important;
206
}
21-
22-
ul {
23-
margin-bottom: 16px;
24-
margin-top: 8px;
25-
padding-left: 30px;
7+
input[class*=SearchInput] {
8+
padding: 10px 6px 10px 34px !important;
269
}
27-
li {
28-
margin: 8px 0;
10+
[class*=TopBarContainer], [class*=ToolbarContainer] {
11+
padding: 4px 6px !important;
12+
min-height: unset !important;
2913
}
30-
31-
table {
32-
border: 1px solid #444;
33-
border-collapse: collapse;
34-
width: 100%;
14+
[class*=ControlContainer]:first-of-type {
15+
margin-top: 16px !important;
16+
}
17+
[class*=ListCardLink]:first-of-type {
18+
padding: 6px 8px !important;
19+
}
20+
[class*=CreditIcon] {
21+
display: none !important;
3522
}
36-
thead {
37-
border: 1px solid #444;
38-
background-color: #f8f8f8;
39-
text-align: left;
23+
[class*=CustomIconWrapper] img {
24+
margin-bottom: 40px !important;
4025
}
41-
tr, td, th {
42-
border: 1px solid #444;
26+
[class*=AppHeaderLogo] img {
27+
padding: 12px 4px 6px 4px !important;
4328
}
4429

45-
pre {
46-
padding: 4px;
47-
background-color: #f8f8f8;
48-
}

static/admin/custom_preview.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
html,
2+
body {
3+
padding: 20px;
4+
font-family: system-ui, Roboto, Helvetica, Arial, sans-serif;
5+
font-size: 15px;
6+
line-height: 1.5;
7+
}
8+
h2 {
9+
font-weight: 700;
10+
line-height: 1;
11+
font-size: 24px;
12+
margin-top: 12px;
13+
}
14+
img {
15+
max-width: 100%;
16+
}
17+
18+
.frame-content div {
19+
padding-bottom: 10px;
20+
}
21+
22+
ul {
23+
margin-bottom: 16px;
24+
margin-top: 8px;
25+
padding-left: 30px;
26+
}
27+
li {
28+
margin: 8px 0;
29+
}
30+
31+
table {
32+
border: 1px solid #444;
33+
border-collapse: collapse;
34+
width: 100%;
35+
}
36+
thead {
37+
border: 1px solid #444;
38+
background-color: #f8f8f8;
39+
text-align: left;
40+
}
41+
tr, td, th {
42+
border: 1px solid #444;
43+
}
44+
45+
pre {
46+
padding: 4px;
47+
background-color: #f8f8f8;
48+
}

static/admin/index.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<meta name="robots" content="noindex" />
77
<title>PINE64 CMS</title>
8+
<link rel="stylesheet" href="custom.css">
89
</head>
910
<body>
1011
<!-- Include the script that builds the page and powers Decap CMS -->
1112
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
1213
<script>
13-
CMS.registerPreviewStyle("custom.css");
14+
CMS.registerPreviewStyle("custom_preview.css");
1415
CMS.registerPreviewStyle("/css/style.min.css");
1516
CMS.registerPreviewStyle("/css/documentation.min.css");
1617
</script>
@@ -146,7 +147,7 @@
146147
return `{{< toc >}}`;
147148
},
148149
toPreview: function(obj) {
149-
return '<hr><b>TABLE OF CONTENTS WILL BE HERE</b><hr>';
150+
return '<hr><b>TABLE OF CONTENTS</b><br>Hidden in preview<hr>';
150151
},
151152
});
152153
// podcast_player
@@ -409,6 +410,17 @@ <h4 style="margin:0 0 4px;font-size:1em;">${b.title}</h4>
409410
},
410411
});
411412

413+
// HR
414+
CMS.registerEditorComponent({
415+
id: "horizontal-rule",
416+
label: "Horizontal Rule",
417+
fields: [],
418+
pattern: /^---$/m,
419+
fromBlock: () => ({}),
420+
toBlock: () => '---',
421+
toPreview: () => '<hr />'
422+
});
423+
412424
</script>
413425
</body>
414426
</html>

0 commit comments

Comments
 (0)