Skip to content

Commit

Permalink
Aesthetic tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
irskep committed Aug 27, 2024
1 parent 494d2f2 commit 4c60495
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/renderers/htmlRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ export class HTMLRenderer implements DjockeyRenderer {
doc,
docs: renderedDocs,
baseURL,
github: {
path: parseGitHubPath(config.projectInfo?.githubURL),
},
urls: {
css: config.html.linkCSSToInputInsteadOfOutput
? this.cssFilePaths
Expand All @@ -151,6 +154,12 @@ export class HTMLRenderer implements DjockeyRenderer {
}
}

function parseGitHubPath(maybeURL?: string): string | undefined {
const GH_BASE = "https://github.com/";
if (!maybeURL || !maybeURL.startsWith(GH_BASE)) return maybeURL;
return maybeURL.slice(GH_BASE.length);
}

interface Element {
attrs: { name: string; value: string }[];
childNodes: (Element | TextNode)[];
Expand Down
2 changes: 1 addition & 1 deletion templates/html/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="DJProjectInfo">
{%- if config.projectInfo.githubURL -%}
<div class="DJProjectInfo_Repo">
<a href="{{ config.projectInfo.githubURL }}">GitHub</a>
<a href="{{ config.projectInfo.githubURL }}">{{ github.path or "GitHub" }}</a>
</div>
{%- endif %}
{%- if config.projectInfo.version %}
Expand Down
1 change: 1 addition & 0 deletions templates/html/static/dj-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ nav h6 {
}

.DJNextPrevious.m-bottom {
margin-top: var(--ml);
margin-bottom: var(--mm);
}

Expand Down

0 comments on commit 4c60495

Please sign in to comment.