mirror of https://gitlab.com/octtspacc/sitoctt
Update admin page
This commit is contained in:
parent
700d4c872e
commit
a5cf31a5fd
|
@ -11,17 +11,20 @@ hugoexternal=true
|
||||||
if [ -n "$(which apt)" ]
|
if [ -n "$(which apt)" ]
|
||||||
then
|
then
|
||||||
asroot apt update
|
asroot apt update
|
||||||
asroot apt install -y python3 nodejs findutils git wget tar gzip p7zip-full #zip
|
asroot apt install -y python3 python-pip nodejs findutils git wget tar gzip
|
||||||
if [ "$(uname -o)" != Android ]
|
if [ "$(uname -o)" != Android ]
|
||||||
then asroot apt install -y npm
|
then
|
||||||
|
# Debian(s)
|
||||||
|
asroot apt install -y npm p7zip-full
|
||||||
else
|
else
|
||||||
asroot apt install -y hugo
|
# Termux
|
||||||
|
asroot apt install -y hugo p7zip
|
||||||
hugoexternal=false
|
hugoexternal=false
|
||||||
fi
|
fi
|
||||||
elif [ -n "$(which apk)" ]
|
elif [ -n "$(which apk)" ]
|
||||||
then
|
then
|
||||||
asroot apk update
|
asroot apk update
|
||||||
asroot apk add hugo python3 py3-pip nodejs npm findutils git wget tar gzip 7zip #zip
|
asroot apk add hugo python3 py3-pip nodejs npm findutils git wget tar gzip 7zip
|
||||||
hugoexternal=false
|
hugoexternal=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,6 @@ swd="$(dirname "$(realpath "$0")")"
|
||||||
if [ ! -e "${swd}/Lib/Globals.sh" ]
|
if [ ! -e "${swd}/Lib/Globals.sh" ]
|
||||||
then swd="${swd}/.."
|
then swd="${swd}/.."
|
||||||
fi
|
fi
|
||||||
#eval "$(sed -e 's| = |=|g' "${swd}/../config.toml")"
|
eval "$(sed -e 's| = |=|g' "${swd}/../assets/SiteProps.toml")"
|
||||||
|
|
||||||
Python3="$([ -n "$(which python3)" ] && echo python3 || echo python)"
|
Python3="$([ -n "$(which python3)" ] && echo python3 || echo python)"
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
GitInstanceUrl="https://gitlab.com"
|
||||||
|
GitRepoThis="octtspacc/sitoctt"
|
||||||
|
GitBranchThis="sitoctt-next"
|
||||||
|
GitRepoAssets="octtspacc/sitoctt-assets"
|
||||||
|
GitBranchAssets="main"
|
|
@ -1,10 +1,27 @@
|
||||||
+++
|
+++
|
||||||
Hidden = true
|
Hidden = true
|
||||||
+++
|
+++
|
||||||
<form>
|
<form name="admin">
|
||||||
<p><label>Git Instance: <input type="url" name="instance"/></label></p>
|
<fieldset name="git" disabled>
|
||||||
<p><label>Repository: <input type="text" name="repo"/></label></p>
|
<legend>Git Configuration</legend>
|
||||||
<p><label>Branch: <input type="text" name="branch"/></label></p>
|
<p><label>Instance URL: <input type="url" name="InstanceUrl"/></label></p>
|
||||||
<p><label>Access Token: <input type="password" name="token"/></label></p>
|
<p><label>Repository Path: <input type="text" name="RepoThis"/></label></p>
|
||||||
|
<p><label>Branch Name: <input type="text" name="BranchThis"/></label></p>
|
||||||
|
<p><label>Access Token: <input type="password" name="token" placeholder="***"/></label></p>
|
||||||
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
<style> form > p > label > input { float: right; } </style>
|
<style> form[name="admin"] input { float: right; } </style>
|
||||||
|
<script>(() => {
|
||||||
|
const formEl = document.querySelector('form[name="admin"]');
|
||||||
|
const gitEl = formEl.querySelector('fieldset[name="git"]');
|
||||||
|
const gitData = (sitoctt.localStorage('gitAuth') || {});
|
||||||
|
for (const fieldEl of gitEl.querySelectorAll('input')) {
|
||||||
|
fieldEl.placeholder ||= sitoctt.Props[`Git${fieldEl.name}`];
|
||||||
|
fieldEl.value = (gitData[fieldEl.name] || '');
|
||||||
|
fieldEl.oninput = fieldEl.onchange = fieldEl.onpaste = () => {
|
||||||
|
gitData[fieldEl.name] = fieldEl.value;
|
||||||
|
sitoctt.localStorage('gitAuth', gitData);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
gitEl.disabled = false;
|
||||||
|
})();</script>
|
|
@ -75,4 +75,4 @@ css asset directory we (unless condition below) add to aforementioned slice */}}
|
||||||
{{ $main_style = $style }}
|
{{ $main_style = $style }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ return $main_style }}
|
{{ return $main_style }}
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
<script> window.sitoctt = {}; window.Void = (function Void(){}); </script>
|
<script>
|
||||||
|
window.sitoctt = {};
|
||||||
|
window.Void = (function Void(){});
|
||||||
|
{{- with resources.Get "SiteProps.toml" -}}
|
||||||
|
{{- with . | transform.Unmarshal -}}
|
||||||
|
window.sitoctt.Props = JSON.parse({{ . | jsonify }});
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
window.sitoctt.localStorage = (function localStorage(key, value){ return SpaccDotWeb.LocalStorage('org.eu.octt.sitoctt', key, value); });
|
||||||
|
</script>
|
||||||
<script src="/ajax-navigation.js"></script>
|
<script src="/ajax-navigation.js"></script>
|
||||||
<script src="/local-file-tweaks.js"></script>
|
<script src="/local-file-tweaks.js"></script>
|
||||||
<script src="/{{ .Lang }}/searchindex.js"></script>
|
<script src="/{{ .Lang }}/searchindex.js"></script>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }}
|
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }}
|
||||||
{{ $twitter_href := printf "https://twitter.com/intent/tweet?url=%s&text=%s" $url $title }}
|
{{ $twitter_href := printf "https://twitter.com/intent/tweet?url=%s&text=%s" $url $title }}
|
||||||
{{ with site.Social.twitter }}
|
{{ with site.Params.Social.twitter }}
|
||||||
{{ $twitter_href = printf "%s&via=%s" $twitter_href . }}
|
{{ $twitter_href = printf "%s&via=%s" $twitter_href . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }}
|
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }}
|
||||||
|
|
Loading…
Reference in New Issue