Update wiki theme color. (#153)
* Update wiki theme color also use sassc since sass ruby got deprecated * delete workflow
This commit is contained in:
1 parent
5456c0d2d1
commit
e6ef7f17dd
6 files changed
+11
-107
No files matched your search
@@ -1,85 +0,0 @@
|
||||
import glob, os, sys
|
||||
from collections import OrderedDict
|
||||
|
||||
hadError = False
|
||||
|
||||
# _escape and _error_workflow_command taken from https://github.com/utgwkk/pytest-github-actions-annotate-failures/blob/main/pytest_github_actions_annotate_failures/plugin.py
|
||||
def _escape(s):
|
||||
return s.replace("%", "%25").replace("\r", "%0D").replace("\n", "%0A")
|
||||
|
||||
def _error_workflow_command(filesystempath, lineno, longrepr):
|
||||
# Build collection of arguments. Ordering is strict for easy testing
|
||||
details_dict = OrderedDict()
|
||||
details_dict["file"] = filesystempath
|
||||
if lineno is not None:
|
||||
details_dict["line"] = lineno
|
||||
|
||||
details = ",".join("{}={}".format(k, v) for k, v in details_dict.items())
|
||||
|
||||
if longrepr is None:
|
||||
return "\n::error {}".format(details)
|
||||
else:
|
||||
longrepr = _escape(longrepr)
|
||||
return "\n::error {}::{}".format(details, longrepr)
|
||||
|
||||
|
||||
# Load toc but all stripped
|
||||
toc = open('./_data/toc.yml', 'r', encoding='utf-8')
|
||||
tocLines = toc.readlines()
|
||||
toc.close()
|
||||
tocContents = ''
|
||||
for tocLine in tocLines:
|
||||
tocContents += tocLine.replace('- ', '').strip() + '\n'
|
||||
|
||||
# Check the permalinks
|
||||
directory = './_docs/'
|
||||
files = glob.glob(os.path.join(directory, '**/*.md'), recursive=True)
|
||||
for file in files:
|
||||
contents = open(file, 'r', encoding='utf-8')
|
||||
lines = contents.readlines()
|
||||
contents.close()
|
||||
|
||||
lineNo = 0
|
||||
for line in lines:
|
||||
lineNo += 1
|
||||
|
||||
# End of header?
|
||||
if (line == '---' and lineNo != 1):
|
||||
break
|
||||
|
||||
if (line.startswith('permalink:')):
|
||||
url = line.replace('permalink:', '').strip()
|
||||
wantedUrl = '/' + file.replace(os.path.sep, '/').replace(directory, '').replace('.md', '/')
|
||||
|
||||
# Special file cleanup
|
||||
wantedUrl = wantedUrl.replace('index/', '')
|
||||
wantedUrl = wantedUrl.replace('root/', '')
|
||||
|
||||
errorFileName = file
|
||||
|
||||
# try to convert to absolute path in GitHub Actions
|
||||
# from https://github.com/utgwkk/pytest-github-actions-annotate-failures/blob/main/pytest_github_actions_annotate_failures/plugin.py#L38-L50
|
||||
workspace = os.environ.get("GITHUB_WORKSPACE")
|
||||
if workspace:
|
||||
full_path = os.path.abspath(file)
|
||||
try:
|
||||
rel_path = os.path.relpath(full_path, workspace)
|
||||
except ValueError:
|
||||
# os.path.relpath() will raise ValueError on Windows
|
||||
# when full_path and workspace have different mount points.
|
||||
# https://github.com/utgwkk/pytest-github-actions-annotate-failures/issues/20
|
||||
rel_path = errorFileName
|
||||
if not rel_path.startswith(".."):
|
||||
errorFileName = rel_path
|
||||
|
||||
# Check if the perma link it correct
|
||||
if (url != wantedUrl):
|
||||
hadError = True
|
||||
print(_error_workflow_command(errorFileName, lineNo, "Permalink does not match filename! Should be " + wantedUrl), file=sys.stderr)
|
||||
|
||||
# Check toc
|
||||
if (wantedUrl != '/' and not (f"url: \"" + url[1:] + "\"" in tocContents)):
|
||||
hadError = True
|
||||
print(_error_workflow_command(errorFileName, lineNo, "Permalink not in toc.yml!"), file=sys.stderr)
|
||||
|
||||
sys.exit(1 if hadError else 0)
|
||||
@@ -1,19 +0,0 @@
|
||||
name: Check PR
|
||||
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo content
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Check permalinks
|
||||
run: python .github/scripts/check_permalinks.py
|
||||
@@ -262,6 +262,10 @@ GEM
|
||||
sass-listen (4.0.0)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
sassc (2.4.0)
|
||||
ffi (~> 1.9)
|
||||
sassc (2.4.0-x64-mingw32)
|
||||
ffi (~> 1.9)
|
||||
sawyer (0.8.2)
|
||||
addressable (>= 2.3.5)
|
||||
faraday (> 0.8, < 2.0)
|
||||
@@ -289,6 +293,7 @@ PLATFORMS
|
||||
|
||||
DEPENDENCIES
|
||||
github-pages
|
||||
sassc
|
||||
wdm (>= 0.1.0)
|
||||
webrick
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ feedback: true
|
||||
# If commented, will use material hat theme
|
||||
# logo: "assets/img/logo/SRCC-square-red.png"
|
||||
logo_pixels: 34
|
||||
color: "#161b22"
|
||||
color: "#2b3035"
|
||||
# color: "#8c1515" # primary color for header, buttons
|
||||
|
||||
# Build settings
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ body {
|
||||
line-height: 1.5;
|
||||
color: #c9d1d9;
|
||||
text-align: left;
|
||||
background-color: #0d1117
|
||||
background-color: #212529
|
||||
}
|
||||
|
||||
img {
|
||||
|
||||
+4
-1
@@ -3,7 +3,10 @@ layout: page
|
||||
permalink: /
|
||||
---
|
||||
|
||||
<img class="logoimg" src="https://geysermc.org/img/geyser.png" alt="geyser logo">
|
||||
<div style="text-align: center;">
|
||||
<img class="logoimg" src="https://geysermc.org/img/geyser.png" alt="geyser logo">
|
||||
</div>
|
||||
<br>
|
||||
|
||||
# GeyserMC Wiki
|
||||
|
||||
|
||||
Reference in new issue
Block a user