Skip to content

Commit

Permalink
No page info for Page index, heighten page height, page history.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve0Greatness committed Aug 22, 2024
1 parent d4cefa9 commit f3ef7e9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
4 changes: 3 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@

CODE_REPOSITORY = "https://github.com/NekowebWiki/WikiGen"
SOURCE_SUFFIX = "?plain=1"

SOURCE_PREFIX = CODE_REPOSITORY + "/blob/main/"

COMMITS_PREFIX = CODE_REPOSITORY + "/commits/main/"
COMMITS_SUFFIX = ""
13 changes: 7 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from os import listdir
from os.path import join as JoinPath, isdir
from MiscUtils import InitDir
from config import OUTPUT_DIR, SOURCE_PREFIX, CODE_REPOSITORY, SOURCE_SUFFIX
from config import OUTPUT_DIR, SOURCE_PREFIX, CODE_REPOSITORY, SOURCE_SUFFIX, COMMITS_PREFIX, COMMITS_SUFFIX
from distutils.dir_util import copy_tree as CopyDir

DIRECTORIES = {
Expand Down Expand Up @@ -59,6 +59,7 @@ def wikiparse(input_dir: str, output: str, rawinfo: dict = { "out": "w", "articl
(RenderedMD.metadata["notoc"] if "notoc" in RenderedMD.metadata else False)
))
RenderedOut = content.replace(".md", ".html")

WikiRender = MDWiki(RenderedMD)
JinjaRender(
WIKI_PAGE_TEMPLATE,
Expand All @@ -69,12 +70,14 @@ def wikiparse(input_dir: str, output: str, rawinfo: dict = { "out": "w", "articl
PAGE_DESC=PageSubtitle,
TableOfContents=TableOfContents,
Content=WikiRender,
ShowPageInfo=True,
SourcePrefix=SOURCE_PREFIX,
Source=JoinPath(input_dir, content),
SourceSuffix=SOURCE_SUFFIX,
CODE_REPOSITORY=CODE_REPOSITORY
CODE_REPOSITORY=CODE_REPOSITORY,
CommitsPrefix=COMMITS_PREFIX,
CommitsSuffix=COMMITS_SUFFIX
)

webout = output.replace("\\", "/").replace("build/", "/", 1) + "/" + RenderedOut

if isarticle:
Expand All @@ -101,9 +104,7 @@ def main():
PAGE_DESCRIPTION = "A list of pages on this wiki.",
PAGE_TYPE = "website",
pages = Indexed,
SourcePrefix=SOURCE_PREFIX,
Source="main.py",
SourceSuffix=SOURCE_SUFFIX,
ShowPageInfo=False,
CODE_REPOSITORY=CODE_REPOSITORY
)

Expand Down
2 changes: 1 addition & 1 deletion static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ a:active {
border-radius: 25px;
padding: 10px;
width: 100%;
height: 564px;
height: calc(100vh - 76px);
overflow: scroll;
flex: 1;
}
Expand Down
9 changes: 8 additions & 1 deletion views/_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,23 @@
<li><a href="/about.html">About</a></li>
</ul>
</nav>
{% if ShowPageInfo %}
<nav>
<strong>Page</strong>
<ul>
<li>
<a
href="{{SourcePrefix}}{{Source}}{{SourceSuffix}}"
/>Page Source</a>
/>Source</a>
</li>
<li>
<a
href="{{CommitsPrefix}}{{Source}}{{CommitsSuffix}}"
/>History</a>
</li>
</ul>
</nav>
{% endif %}
<nav>
<strong>Community</strong>
<ul>
Expand Down

0 comments on commit f3ef7e9

Please sign in to comment.