Skip to content

Commit a5cf31a

Browse files
author
OctoSpacc
committed
Update admin page
1 parent 700d4c8 commit a5cf31a

File tree

7 files changed

+48
-14
lines changed

7 files changed

+48
-14
lines changed

Scripts/Dependencies.Build.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@ hugoexternal=true
1111
if [ -n "$(which apt)" ]
1212
then
1313
asroot apt update
14-
asroot apt install -y python3 nodejs findutils git wget tar gzip p7zip-full #zip
14+
asroot apt install -y python3 python-pip nodejs findutils git wget tar gzip
1515
if [ "$(uname -o)" != Android ]
16-
then asroot apt install -y npm
16+
then
17+
# Debian(s)
18+
asroot apt install -y npm p7zip-full
1719
else
18-
asroot apt install -y hugo
20+
# Termux
21+
asroot apt install -y hugo p7zip
1922
hugoexternal=false
2023
fi
2124
elif [ -n "$(which apk)" ]
2225
then
2326
asroot apk update
24-
asroot apk add hugo python3 py3-pip nodejs npm findutils git wget tar gzip 7zip #zip
27+
asroot apk add hugo python3 py3-pip nodejs npm findutils git wget tar gzip 7zip
2528
hugoexternal=false
2629
fi
2730

Scripts/Lib/Globals.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ swd="$(dirname "$(realpath "$0")")"
1313
if [ ! -e "${swd}/Lib/Globals.sh" ]
1414
then swd="${swd}/.."
1515
fi
16-
#eval "$(sed -e 's| = |=|g' "${swd}/../config.toml")"
16+
eval "$(sed -e 's| = |=|g' "${swd}/../assets/SiteProps.toml")"
1717

1818
Python3="$([ -n "$(which python3)" ] && echo python3 || echo python)"

assets/SiteProps.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
GitInstanceUrl="https://gitlab.com"
2+
GitRepoThis="octtspacc/sitoctt"
3+
GitBranchThis="sitoctt-next"
4+
GitRepoAssets="octtspacc/sitoctt-assets"
5+
GitBranchAssets="main"

content/it/admin.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
+++
22
Hidden = true
33
+++
4-
<form>
5-
<p><label>Git Instance: &nbsp; <input type="url" name="instance"/></label></p>
6-
<p><label>Repository: &nbsp; <input type="text" name="repo"/></label></p>
7-
<p><label>Branch: &nbsp; <input type="text" name="branch"/></label></p>
8-
<p><label>Access Token: &nbsp; <input type="password" name="token"/></label></p>
4+
<form name="admin">
5+
<fieldset name="git" disabled>
6+
<legend>Git Configuration</legend>
7+
<p><label>Instance URL: &nbsp; <input type="url" name="InstanceUrl"/></label></p>
8+
<p><label>Repository Path: &nbsp; <input type="text" name="RepoThis"/></label></p>
9+
<p><label>Branch Name: &nbsp; <input type="text" name="BranchThis"/></label></p>
10+
<p><label>Access Token: &nbsp; <input type="password" name="token" placeholder="***"/></label></p>
11+
</fieldset>
912
</form>
10-
<style> form > p > label > input { float: right; } </style>
13+
<style> form[name="admin"] input { float: right; } </style>
14+
<script>(() => {
15+
const formEl = document.querySelector('form[name="admin"]');
16+
const gitEl = formEl.querySelector('fieldset[name="git"]');
17+
const gitData = (sitoctt.localStorage('gitAuth') || {});
18+
for (const fieldEl of gitEl.querySelectorAll('input')) {
19+
fieldEl.placeholder ||= sitoctt.Props[`Git${fieldEl.name}`];
20+
fieldEl.value = (gitData[fieldEl.name] || '');
21+
fieldEl.oninput = fieldEl.onchange = fieldEl.onpaste = () => {
22+
gitData[fieldEl.name] = fieldEl.value;
23+
sitoctt.localStorage('gitAuth', gitData);
24+
};
25+
}
26+
gitEl.disabled = false;
27+
})();</script>

themes/ananke/layouts/partials/func/style/GetMainCSS.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@
7575
{{ $main_style = $style }}
7676
{{ end }}
7777

78-
{{ return $main_style }}
78+
{{ return $main_style }}

themes/ananke/layouts/partials/site-scripts.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
<script> window.sitoctt = {}; window.Void = (function Void(){}); </script>
1+
<script>
2+
window.sitoctt = {};
3+
window.Void = (function Void(){});
4+
{{- with resources.Get "SiteProps.toml" -}}
5+
{{- with . | transform.Unmarshal -}}
6+
window.sitoctt.Props = JSON.parse({{ . | jsonify }});
7+
{{- end -}}
8+
{{- end -}}
9+
window.sitoctt.localStorage = (function localStorage(key, value){ return SpaccDotWeb.LocalStorage('org.eu.octt.sitoctt', key, value); });
10+
</script>
211
<script src="/ajax-navigation.js"></script>
312
<script src="/local-file-tweaks.js"></script>
413
<script src="/{{ .Lang }}/searchindex.js"></script>

themes/ananke/layouts/partials/social-share.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }}
55
{{ $twitter_href := printf "https://twitter.com/intent/tweet?url=%s&text=%s" $url $title }}
6-
{{ with site.Social.twitter }}
6+
{{ with site.Params.Social.twitter }}
77
{{ $twitter_href = printf "%s&via=%s" $twitter_href . }}
88
{{ end }}
99
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }}

0 commit comments

Comments
 (0)