Skip to content

Commit

Permalink
Update admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
OctoSpacc committed Oct 22, 2024
1 parent 700d4c8 commit a5cf31a
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 14 deletions.
11 changes: 7 additions & 4 deletions Scripts/Dependencies.Build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ hugoexternal=true
if [ -n "$(which apt)" ]
then
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 ]
then asroot apt install -y npm
then
# Debian(s)
asroot apt install -y npm p7zip-full
else
asroot apt install -y hugo
# Termux
asroot apt install -y hugo p7zip
hugoexternal=false
fi
elif [ -n "$(which apk)" ]
then
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
fi

Expand Down
2 changes: 1 addition & 1 deletion Scripts/Lib/Globals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ swd="$(dirname "$(realpath "$0")")"
if [ ! -e "${swd}/Lib/Globals.sh" ]
then swd="${swd}/.."
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)"
5 changes: 5 additions & 0 deletions assets/SiteProps.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GitInstanceUrl="https://gitlab.com"
GitRepoThis="octtspacc/sitoctt"
GitBranchThis="sitoctt-next"
GitRepoAssets="octtspacc/sitoctt-assets"
GitBranchAssets="main"
29 changes: 23 additions & 6 deletions content/it/admin.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
+++
Hidden = true
+++
<form>
<p><label>Git Instance: &nbsp; <input type="url" name="instance"/></label></p>
<p><label>Repository: &nbsp; <input type="text" name="repo"/></label></p>
<p><label>Branch: &nbsp; <input type="text" name="branch"/></label></p>
<p><label>Access Token: &nbsp; <input type="password" name="token"/></label></p>
<form name="admin">
<fieldset name="git" disabled>
<legend>Git Configuration</legend>
<p><label>Instance URL: &nbsp; <input type="url" name="InstanceUrl"/></label></p>
<p><label>Repository Path: &nbsp; <input type="text" name="RepoThis"/></label></p>
<p><label>Branch Name: &nbsp; <input type="text" name="BranchThis"/></label></p>
<p><label>Access Token: &nbsp; <input type="password" name="token" placeholder="***"/></label></p>
</fieldset>
</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>
2 changes: 1 addition & 1 deletion themes/ananke/layouts/partials/func/style/GetMainCSS.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@
{{ $main_style = $style }}
{{ end }}

{{ return $main_style }}
{{ return $main_style }}
11 changes: 10 additions & 1 deletion themes/ananke/layouts/partials/site-scripts.html
Original file line number Diff line number Diff line change
@@ -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="/local-file-tweaks.js"></script>
<script src="/{{ .Lang }}/searchindex.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion themes/ananke/layouts/partials/social-share.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{{ $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 }}
{{ with site.Social.twitter }}
{{ with site.Params.Social.twitter }}
{{ $twitter_href = printf "%s&via=%s" $twitter_href . }}
{{ end }}
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }}
Expand Down

0 comments on commit a5cf31a

Please sign in to comment.