Skip to content

Commit

Permalink
Merge pull request #116 from pine64/contribution
Browse files Browse the repository at this point in the history
CMS, reading stats
  • Loading branch information
x1y authored Jan 19, 2025
2 parents a4614dc + 5d8b7c7 commit 115c345
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ menu:

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

{{< admonition type="note" >}}
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.
{{< /admonition >}}

Download:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

---
title: "Hardware checking"
draft: false
Expand All @@ -11,7 +12,9 @@ menu:

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

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.
{{< admonition type="note" >}}
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.
{{< /admonition >}}

Download:

Expand All @@ -21,7 +24,7 @@ Instructions:

* 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).
* 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.
* When powering up, a battery icon screen will show up blow, press power key for two seconds, then the Rockchip logo screen shows up.
* When powering up, a battery icon screen will show up. Press the power key for two seconds, then the Rockchip logo screen shows up.

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

Expand Down
118 changes: 118 additions & 0 deletions static/admin/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
site_url: https://pine64.org
publish_mode: editorial_workflow

backend:
name: github
repo: pine64/website
branch: main
site_domain: pine64.org

media_folder: "static/images/uploads" # Adjust based on your media storage location
public_folder: "/images/uploads" # URL path for accessing media
logo_url: "https://pine64.org/img/logo.png"

collections:
- name: "blog" # This is the name used in the URL
label: "Blog" # This is the singular name of the content type for the UI
label_singular: "Blog post"
folder: "content/blog" # The folder where your posts markdown files will be saved
create: true # Allows users to create new documents in this collection
slug: "{{slug}}" # Filename template for new posts
preview_path: "{{year}}/{{month}}/{{day}}/{{slug}}/"
preview: false
fields: # List of fields for the front matter
- { label: "Title", name: "title", widget: "string" }
- { label: "Description", name: "description", widget: "text" }
- { label: "Date", name: "date", widget: "datetime" }
- { label: "Image", name: "images", widget: "image", required: false }
#- { label: "Hidden", name: "hidden", widget: "boolean", default: false }
#- { label: "Comments", name: "comments", widget: "boolean", default: true }
- { label: "Draft", name: "draft", widget: "boolean", default: false }
#- { label: "Weight", name: "weight", widget: "number" }
- { label: "Body", name: "body", widget: "markdown" }
- name: authors
label: Authors
label_singular: 'Author'
widget: list
fields:
- { label: 'Name', name: 'name', widget: 'string', hint: 'First and Last' }
- { label: 'Description', name: 'description', widget: 'markdown' }

- name: "community" # This is the name used in the URL
label: "Community" # This is the singular name of the content type for the UI
label_singular: "Community"
folder: "content/community" # The folder where your posts markdown files will be saved
create: true # Allows users to create new documents in this collection
slug: "{{slug}}" # Filename template for new posts
preview: false
fields: # List of fields for the front matter
- { label: "Title", name: "title", widget: "string" }
- { label: "Description", name: "description", widget: "text" }
- { label: "Date", name: "date", widget: "datetime" }
- { label: "Image", name: "images", widget: "image", required: false }
- { label: "Draft", name: "draft", widget: "boolean", default: false }
- { label: "Body", name: "body", widget: "markdown" }

- name: "contests" # This is the name used in the URL
label: "Contests" # This is the singular name of the content type for the UI
label_singular: "Contest"
folder: "content/contests" # The folder where your posts markdown files will be saved
create: true # Allows users to create new documents in this collection
slug: "{{slug}}" # Filename template for new posts
preview: false
fields: # List of fields for the front matter
- { label: "Title", name: "title", widget: "string" }
- { label: "Description", name: "description", widget: "text" }
- { label: "Date", name: "date", widget: "datetime" }
- { label: "Image", name: "images", widget: "image", required: false }
- { label: "Draft", name: "draft", widget: "boolean", default: false }
- { label: "Body", name: "body", widget: "markdown" }

- name: "devices" # This is the name used in the URL
label: "Devices" # This is the singular name of the content type for the UI
label_singular: "Device"
folder: "content/devices" # The folder where your posts markdown files will be saved
create: true # Allows users to create new documents in this collection
slug: "{{slug}}" # Filename template for new posts
preview: false
fields: # List of fields for the front matter
- { label: "Title", name: "title", widget: "string" }
- { label: "Description", name: "description", widget: "text" }
- { label: "Date", name: "date", widget: "datetime" }
- { label: "Image", name: "images", widget: "image", required: false }
- { label: "Draft", name: "draft", widget: "boolean", default: false }
- { label: "Body", name: "body", widget: "markdown" }

# - name: "documentation" # This is the name used in the URL
# label: "Documentation" # This is the singular name of the content type for the UI
# label_singular: "Documentation"
# folder: "content/documentation/Clusterboard" # The folder where your posts markdown files will be saved
# create: true # Allows users to create new documents in this collection
# slug: "{{slug}}" # Filename template for new posts
# preview: false
# nested:
# depth: 4 # max depth to show in the collection tree
# summary: '{{dirname}}' # optional summary for a tree node, defaults to the inferred title field
# fields: # List of fields for the front matter
# - label: Title
# name: title
# widget: string
# - label: Body
# name: body
# widget: markdown
# meta: { path: { widget: string, label: 'Path', index_file: '_index' } }

- name: "podcast" # This is the name used in the URL
label: "Podcast" # This is the singular name of the content type for the UI
label_singular: "Podcast"
folder: "content/podcast" # The folder where your posts markdown files will be saved
create: true # Allows users to create new documents in this collection
slug: "{{slug}}" # Filename template for new posts
preview: false
fields: # List of fields for the front matter
- { label: "Title", name: "title", widget: "string" }
- { label: "Description", name: "description", widget: "text" }
- { label: "Date", name: "date", widget: "datetime" }
- { label: "Image", name: "images", widget: "image", required: false }
- { label: "Draft", name: "draft", widget: "boolean", default: false }
- { label: "Body", name: "body", widget: "markdown" }
86 changes: 86 additions & 0 deletions static/admin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!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>PINE64 CMS</title>
</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>
<!--<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>-->
<!-- Decap CMS custom widget (Hugo shortcodes) from https://decapcms.org/docs/hugo/#using-decap-cms-content-in-hugo -->
<script>
// credits
CMS.registerEditorComponent({
id: "credits",
label: "Credits",
fields: [{
name: "authors",
label: "Author(s)",
widget: "string"
}
],
pattern: /^{{< credits "(.*?)" >}}/,
fromBlock: function(match) {
return {
authors: match[1]
};
},
toBlock: function(obj) {
return `{{< credits ${obj.authors} >}}`;
},
toPreview: function(obj) {
return '<i>obj.authors</i>';
},
});
// toc
CMS.registerEditorComponent({
id: "toc",
label: "Table of Contents",
pattern: /^{{< toc >}}/,
fromBlock: function(match) {
return {
authors: match
};
},
toBlock: function(obj) {
return `{{< toc >}}`;
},
toPreview: function(obj) {
return '<b>TABLE OF CONTENTS WILL BE HERE</b>';
},
});
// gist
CMS.registerEditorComponent({
id: "gist",
label: "Gist",
fields: [{
name: "username",
label: "GitHub Username",
widget: "string"
},
{
name: "gid",
label: "Gist ID",
widget: "string"
},
],
pattern: /^{{< gist ([a-zA-Z0-9]+) ([a-zA-Z0-9]+) >}}/,
fromBlock: function(match) {
return {
username: match[1],
gid: match[2],
};
},
toBlock: function(obj) {
return `{{< gist ${obj.username} ${obj.gid} >}}`;
},
toPreview: function(obj) {
return '<a href="https://gist.github.com/' + obj.username + '/' + obj.id + '">gist</a>';
},
});
</script>
</body>
</html>
Binary file added static/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions static/favicon_note.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The favicon.ico in this folder is solely for Decap CMS
Empty file added static/images/uploads/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions themes/pinetheme/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,12 @@ button.rounded:hover {
.blog-tags a:hover {
border-bottom: 4px solid #013F85;
}
p.readingstats {
margin-top: 1rem;
color: gray;
font-weight: 300;
font-size: 11pt;
}

div.credits {
margin: -8px 0 12px 6px;
Expand Down
6 changes: 6 additions & 0 deletions themes/pinetheme/layouts/blog/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@

{{ .Content }}

<p class="readingstats">
<i>
{{ printf "Estimated reading time: %d minutes" .ReadingTime }} ({{ .WordCount }} words)
</i>
</p>

{{ if .Params.tags }}
<hr class="blog-hr">

Expand Down
3 changes: 3 additions & 0 deletions themes/pinetheme/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
{{ end -}}

<!-- Generator -->
{{ hugo.Generator }}

</head>

0 comments on commit 115c345

Please sign in to comment.