Skip to content

Commit 5d8b7c7

Browse files
committed
CMS, reading stats
1 parent a4614dc commit 5d8b7c7

File tree

10 files changed

+227
-2
lines changed

10 files changed

+227
-2
lines changed

content/documentation/PinePhone_Pro/Factory_tests/Factory_test_battery_charging.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ menu:
1111

1212
{{< figure src="/documentation/images/PPP_Abdroid_Test_Utility-1.jpg" width="300" >}}
1313

14+
{{< admonition type="note" >}}
1415
Please note that this Android build solely for PinePhone Pro hardware checking purpose and solely used by support team. This is NOT a general release build.
16+
{{< /admonition >}}
1517

1618
Download:
1719

content/documentation/PinePhone_Pro/Factory_tests/Factory_test_hardware_checking.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
---
23
title: "Hardware checking"
34
draft: false
@@ -11,7 +12,9 @@ menu:
1112

1213
{{< figure src="/documentation/images/PPP_Abdroid_Test_Utility-5.jpg" width="400" >}}
1314

14-
Please note that this Android build solely for PinePhone Pro hardware checking purpose and solely used by the support team. This is NOT a general release build.
15+
{{< admonition type="note" >}}
16+
Please note that this Android build solely for PinePhone Pro hardware checking purpose and solely used by the support team. This is not a general release build.
17+
{{< /admonition >}}
1518

1619
Download:
1720

@@ -21,7 +24,7 @@ Instructions:
2124

2225
* Download the build, extract the image and dd it to a 8 GB or larger microSD card, take out the PinePhone Pro Explorer Edition, then insert it into microSD slot (upper slot).
2326
* Insert battery, press the RE button (bypass SPI and eMMC boot) underneath the back cover while plugging in the USB-C power. After 3 seconds release the RE button.
24-
* When powering up, a battery icon screen will show up blow, press power key for two seconds, then the Rockchip logo screen shows up.
27+
* When powering up, a battery icon screen will show up. Press the power key for two seconds, then the Rockchip logo screen shows up.
2528

2629
{{< figure src="/documentation/images/PPP_Abdroid_Test_Utility-1.jpg" width="300" >}}
2730

static/admin/config.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
site_url: https://pine64.org
2+
publish_mode: editorial_workflow
3+
4+
backend:
5+
name: github
6+
repo: pine64/website
7+
branch: main
8+
site_domain: pine64.org
9+
10+
media_folder: "static/images/uploads" # Adjust based on your media storage location
11+
public_folder: "/images/uploads" # URL path for accessing media
12+
logo_url: "https://pine64.org/img/logo.png"
13+
14+
collections:
15+
- name: "blog" # This is the name used in the URL
16+
label: "Blog" # This is the singular name of the content type for the UI
17+
label_singular: "Blog post"
18+
folder: "content/blog" # The folder where your posts markdown files will be saved
19+
create: true # Allows users to create new documents in this collection
20+
slug: "{{slug}}" # Filename template for new posts
21+
preview_path: "{{year}}/{{month}}/{{day}}/{{slug}}/"
22+
preview: false
23+
fields: # List of fields for the front matter
24+
- { label: "Title", name: "title", widget: "string" }
25+
- { label: "Description", name: "description", widget: "text" }
26+
- { label: "Date", name: "date", widget: "datetime" }
27+
- { label: "Image", name: "images", widget: "image", required: false }
28+
#- { label: "Hidden", name: "hidden", widget: "boolean", default: false }
29+
#- { label: "Comments", name: "comments", widget: "boolean", default: true }
30+
- { label: "Draft", name: "draft", widget: "boolean", default: false }
31+
#- { label: "Weight", name: "weight", widget: "number" }
32+
- { label: "Body", name: "body", widget: "markdown" }
33+
- name: authors
34+
label: Authors
35+
label_singular: 'Author'
36+
widget: list
37+
fields:
38+
- { label: 'Name', name: 'name', widget: 'string', hint: 'First and Last' }
39+
- { label: 'Description', name: 'description', widget: 'markdown' }
40+
41+
- name: "community" # This is the name used in the URL
42+
label: "Community" # This is the singular name of the content type for the UI
43+
label_singular: "Community"
44+
folder: "content/community" # The folder where your posts markdown files will be saved
45+
create: true # Allows users to create new documents in this collection
46+
slug: "{{slug}}" # Filename template for new posts
47+
preview: false
48+
fields: # List of fields for the front matter
49+
- { label: "Title", name: "title", widget: "string" }
50+
- { label: "Description", name: "description", widget: "text" }
51+
- { label: "Date", name: "date", widget: "datetime" }
52+
- { label: "Image", name: "images", widget: "image", required: false }
53+
- { label: "Draft", name: "draft", widget: "boolean", default: false }
54+
- { label: "Body", name: "body", widget: "markdown" }
55+
56+
- name: "contests" # This is the name used in the URL
57+
label: "Contests" # This is the singular name of the content type for the UI
58+
label_singular: "Contest"
59+
folder: "content/contests" # The folder where your posts markdown files will be saved
60+
create: true # Allows users to create new documents in this collection
61+
slug: "{{slug}}" # Filename template for new posts
62+
preview: false
63+
fields: # List of fields for the front matter
64+
- { label: "Title", name: "title", widget: "string" }
65+
- { label: "Description", name: "description", widget: "text" }
66+
- { label: "Date", name: "date", widget: "datetime" }
67+
- { label: "Image", name: "images", widget: "image", required: false }
68+
- { label: "Draft", name: "draft", widget: "boolean", default: false }
69+
- { label: "Body", name: "body", widget: "markdown" }
70+
71+
- name: "devices" # This is the name used in the URL
72+
label: "Devices" # This is the singular name of the content type for the UI
73+
label_singular: "Device"
74+
folder: "content/devices" # The folder where your posts markdown files will be saved
75+
create: true # Allows users to create new documents in this collection
76+
slug: "{{slug}}" # Filename template for new posts
77+
preview: false
78+
fields: # List of fields for the front matter
79+
- { label: "Title", name: "title", widget: "string" }
80+
- { label: "Description", name: "description", widget: "text" }
81+
- { label: "Date", name: "date", widget: "datetime" }
82+
- { label: "Image", name: "images", widget: "image", required: false }
83+
- { label: "Draft", name: "draft", widget: "boolean", default: false }
84+
- { label: "Body", name: "body", widget: "markdown" }
85+
86+
# - name: "documentation" # This is the name used in the URL
87+
# label: "Documentation" # This is the singular name of the content type for the UI
88+
# label_singular: "Documentation"
89+
# folder: "content/documentation/Clusterboard" # The folder where your posts markdown files will be saved
90+
# create: true # Allows users to create new documents in this collection
91+
# slug: "{{slug}}" # Filename template for new posts
92+
# preview: false
93+
# nested:
94+
# depth: 4 # max depth to show in the collection tree
95+
# summary: '{{dirname}}' # optional summary for a tree node, defaults to the inferred title field
96+
# fields: # List of fields for the front matter
97+
# - label: Title
98+
# name: title
99+
# widget: string
100+
# - label: Body
101+
# name: body
102+
# widget: markdown
103+
# meta: { path: { widget: string, label: 'Path', index_file: '_index' } }
104+
105+
- name: "podcast" # This is the name used in the URL
106+
label: "Podcast" # This is the singular name of the content type for the UI
107+
label_singular: "Podcast"
108+
folder: "content/podcast" # The folder where your posts markdown files will be saved
109+
create: true # Allows users to create new documents in this collection
110+
slug: "{{slug}}" # Filename template for new posts
111+
preview: false
112+
fields: # List of fields for the front matter
113+
- { label: "Title", name: "title", widget: "string" }
114+
- { label: "Description", name: "description", widget: "text" }
115+
- { label: "Date", name: "date", widget: "datetime" }
116+
- { label: "Image", name: "images", widget: "image", required: false }
117+
- { label: "Draft", name: "draft", widget: "boolean", default: false }
118+
- { label: "Body", name: "body", widget: "markdown" }

static/admin/index.html

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
<meta name="robots" content="noindex" />
7+
<title>PINE64 CMS</title>
8+
</head>
9+
<body>
10+
<!-- Include the script that builds the page and powers Decap CMS -->
11+
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
12+
<!--<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>-->
13+
<!-- Decap CMS custom widget (Hugo shortcodes) from https://decapcms.org/docs/hugo/#using-decap-cms-content-in-hugo -->
14+
<script>
15+
// credits
16+
CMS.registerEditorComponent({
17+
id: "credits",
18+
label: "Credits",
19+
fields: [{
20+
name: "authors",
21+
label: "Author(s)",
22+
widget: "string"
23+
}
24+
],
25+
pattern: /^{{< credits "(.*?)" >}}/,
26+
fromBlock: function(match) {
27+
return {
28+
authors: match[1]
29+
};
30+
},
31+
toBlock: function(obj) {
32+
return `{{< credits ${obj.authors} >}}`;
33+
},
34+
toPreview: function(obj) {
35+
return '<i>obj.authors</i>';
36+
},
37+
});
38+
// toc
39+
CMS.registerEditorComponent({
40+
id: "toc",
41+
label: "Table of Contents",
42+
pattern: /^{{< toc >}}/,
43+
fromBlock: function(match) {
44+
return {
45+
authors: match
46+
};
47+
},
48+
toBlock: function(obj) {
49+
return `{{< toc >}}`;
50+
},
51+
toPreview: function(obj) {
52+
return '<b>TABLE OF CONTENTS WILL BE HERE</b>';
53+
},
54+
});
55+
// gist
56+
CMS.registerEditorComponent({
57+
id: "gist",
58+
label: "Gist",
59+
fields: [{
60+
name: "username",
61+
label: "GitHub Username",
62+
widget: "string"
63+
},
64+
{
65+
name: "gid",
66+
label: "Gist ID",
67+
widget: "string"
68+
},
69+
],
70+
pattern: /^{{< gist ([a-zA-Z0-9]+) ([a-zA-Z0-9]+) >}}/,
71+
fromBlock: function(match) {
72+
return {
73+
username: match[1],
74+
gid: match[2],
75+
};
76+
},
77+
toBlock: function(obj) {
78+
return `{{< gist ${obj.username} ${obj.gid} >}}`;
79+
},
80+
toPreview: function(obj) {
81+
return '<a href="https://gist.github.com/' + obj.username + '/' + obj.id + '">gist</a>';
82+
},
83+
});
84+
</script>
85+
</body>
86+
</html>

static/favicon.ico

1.38 KB
Binary file not shown.

static/favicon_note.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The favicon.ico in this folder is solely for Decap CMS

static/images/uploads/.gitkeep

Whitespace-only changes.

themes/pinetheme/assets/css/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,12 @@ button.rounded:hover {
690690
.blog-tags a:hover {
691691
border-bottom: 4px solid #013F85;
692692
}
693+
p.readingstats {
694+
margin-top: 1rem;
695+
color: gray;
696+
font-weight: 300;
697+
font-size: 11pt;
698+
}
693699

694700
div.credits {
695701
margin: -8px 0 12px 6px;

themes/pinetheme/layouts/blog/single.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020

2121
{{ .Content }}
2222

23+
<p class="readingstats">
24+
<i>
25+
{{ printf "Estimated reading time: %d minutes" .ReadingTime }} ({{ .WordCount }} words)
26+
</i>
27+
</p>
28+
2329
{{ if .Params.tags }}
2430
<hr class="blog-hr">
2531

themes/pinetheme/layouts/partials/head.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,7 @@
4343
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
4444
{{ end -}}
4545

46+
<!-- Generator -->
47+
{{ hugo.Generator }}
48+
4649
</head>

0 commit comments

Comments
 (0)