Skip to content

Commit

Permalink
v0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowOnPaper committed Dec 13, 2023
1 parent 0a84f8f commit 2592807
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
9 changes: 8 additions & 1 deletion assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ code {
padding: 0.5rem;
border: 0;
background-color: transparent;
cursor: pointer;
}

#mobile-menu-nav {
Expand Down Expand Up @@ -151,7 +152,13 @@ main {
text-decoration: none;
}

.nav-section-link:hover {
.current-nav-section-link {
color: rgb(77, 107, 255);
text-decoration: none;
}

.nav-section-link:hover,
.current-nav-section-link:hover {
text-decoration: underline;
}

Expand Down
2 changes: 1 addition & 1 deletion assets/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ main>p {
}

main a {
color: rgb(61, 91, 243);
color: rgb(77, 107, 255);
text-decoration: none;
}

Expand Down
18 changes: 15 additions & 3 deletions assets/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
viewBox="0 0 17 14"
>
<path
stroke="currentColor"
stroke="#2c2c2c"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
Expand All @@ -56,7 +56,7 @@
viewBox="0 0 14 14"
>
<path
stroke="black"
stroke="#2c2c2c"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
Expand All @@ -72,9 +72,15 @@ <h2 class="nav-section-title">{{$section.Title}}</h2>
<ul class="nav-section-links-list">
{{range $page := $section.Pages}}
<li class="nav-section-links-list-item">
<a href="{{$page.Href}}" class="nav-section-link"
{{if eq $.Pathname $page.Href}}
<a href="{{$page.Href}}" class="current-nav-section-link"
>{{$page.Title}}</a
>
{{else}}
<a href="{{$page.Href}}" class="nav-section-link"
>{{$page.Title}}</a
>
{{end}}
</li>
{{end}}
</ul>
Expand All @@ -94,9 +100,15 @@ <h2 class="nav-section-title">{{$section.Title}}</h2>
<ul class="nav-section-links-list">
{{range $page := $section.Pages}}
<li class="nav-section-links-list-item">
{{if eq $.Pathname $page.Href}}
<a href="{{$page.Href}}" class="current-nav-section-link"
>{{$page.Title}}</a
>
{{else}}
<a href="{{$page.Href}}" class="nav-section-link"
>{{$page.Title}}</a
>
{{end}}
</li>
{{end}}
</ul>
Expand Down
6 changes: 6 additions & 0 deletions docs/pages/basics/pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ const message = "hello world";

1. item 1
2. item 2

> Note: This is a blockquote

| key | value |
| ------- | ----- |
| message | hello |
````

## Attributes
Expand Down
8 changes: 7 additions & 1 deletion malta.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,20 @@ func run() int {

urlPathname := strings.Replace(strings.Replace(dstPath, "dist", "", 1), ".html", "", 1)
urlPathname = strings.Replace(urlPathname, "/index", "", 1)
if urlPathname == "" {
urlPathname = "/"
}
url := config.Domain + urlPathname

err = tmpl.Execute(dstHtmlFile, Data{
Markdown: template.HTML(markdownHtml),
Name: config.Name,
Description: config.Description,
Url: config.Domain + urlPathname,
Url: url,
Twitter: config.Twitter,
Title: matter.Title,
NavSections: navSections,
Pathname: urlPathname,
})
if err != nil {
panic(err)
Expand Down Expand Up @@ -163,6 +168,7 @@ type Data struct {
Url string
Name string
NavSections []NavSection
Pathname string
}

type NavSection struct {
Expand Down

0 comments on commit 2592807

Please sign in to comment.