Compare commits
14 Commits
Author | SHA1 | Date |
---|---|---|
earnest ma | 54410253ff | |
earnest ma | edc8d00a95 | |
earnest ma | 51447b0ca1 | |
earnest ma | 465fb8ae01 | |
earnest ma | 600dd9a8c1 | |
earnest ma | cfb0ae3b4e | |
earnest ma | 66250ffea8 | |
earnest ma | 76ffa157fd | |
earnest ma | 55e42857e8 | |
earnest ma | 51b3d3fbec | |
earnest ma | 092291f33f | |
earnest ma | e9dbe9de47 | |
earnest ma | b838078d40 | |
earnest ma | 34fe1f72d0 |
|
@ -0,0 +1,4 @@
|
|||
resources/
|
||||
|
||||
# If you clone nwt-docs here
|
||||
docs/
|
|
@ -13,7 +13,7 @@ Discuss on the above spaces and open a [ticket here](https://todo.sr.ht/~earnest
|
|||
|
||||
## Patches
|
||||
|
||||
Patches for docs only should be done against [nwt-docs](https://git.sr.ht/~earnestma/nwt-docs). Otherwise, if you adding a new feature or documentation, modify `docs/` in the main repo at the same time.
|
||||
If you adding a new feature or documentation, please remember to also send a patch against [nwt-docs](https://git.sr.ht/~earnestma/nwt-docs).
|
||||
|
||||
If you need more help sending patches, you may take a look at [this guide](https://git-send-email.io/).
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ A Hugo theme for your digital garden, notes, or wiki. Inspired by <http://wiki.x
|
|||
|
||||
### Installing and usage
|
||||
|
||||
See `docs/` directory or the [online manual](https://man.sr.ht/~earnestma/nwt). The online manual sources are available as Markdown in [this git repository](https://git.sr.ht/~earnestma/nwt-docs).
|
||||
See the [online manual](https://man.sr.ht/~earnestma/nwt). The online manual sources are also available as Markdown in [this git repository](https://git.sr.ht/~earnestma/nwt-docs).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -491,3 +491,28 @@ pre code {
|
|||
text-decoration: none;
|
||||
padding: 1 5px;
|
||||
}
|
||||
|
||||
/* Open and close the collapsible content button */
|
||||
.collapsible {
|
||||
background-color: #eee;
|
||||
color: #444;
|
||||
cursor: pointer;
|
||||
padding: 18px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: left;
|
||||
outline: none;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.active, .collapsible:hover {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
/* Style the collapsible content. Note: hidden by default */
|
||||
.collapsible_content {
|
||||
padding: 0 18px;
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.2s ease-out;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
var coll = document.getElementsByClassName("collapsible");
|
||||
var i;
|
||||
|
||||
for (i = 0; i < coll.length; i++) {
|
||||
coll[i].addEventListener("click", function() {
|
||||
this.classList.toggle("active");
|
||||
var content = this.nextElementSibling;
|
||||
if (content.style.maxHeight){
|
||||
content.style.maxHeight = null;
|
||||
} else {
|
||||
content.style.maxHeight = content.scrollHeight + "px";
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// https://hugocodex.org/add-ons/new-window-fix
|
||||
//open external links in a new window
|
||||
function external_new_window() {
|
||||
for(var c = document.getElementsByTagName("a"), a = 0;a < c.length;a++) {
|
||||
var b = c[a];
|
||||
if(b.getAttribute("href") && b.hostname !== location.hostname) {
|
||||
b.target = "_blank";
|
||||
b.rel = "noopener";
|
||||
}
|
||||
}
|
||||
}
|
||||
//open PDF links in a new window
|
||||
function pdf_new_window ()
|
||||
{
|
||||
if (!document.getElementsByTagName) return false;
|
||||
var links = document.getElementsByTagName("a");
|
||||
for (var eleLink=0; eleLink < links.length; eleLink ++) {
|
||||
if ((links[eleLink].href.indexOf('.pdf') !== -1)||(links[eleLink].href.indexOf('.doc') !== -1)||(links[eleLink].href.indexOf('.docx') !== -1)) {
|
||||
links[eleLink].onclick =
|
||||
function() {
|
||||
window.open(this.href);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pdf_new_window();
|
||||
external_new_window();
|
|
@ -0,0 +1,4 @@
|
|||
[module.hugoVersion]
|
||||
extended = true
|
||||
min = '0.80.0'
|
||||
# max = ''
|
|
@ -1,12 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{- partial "head.html" . }}
|
||||
{{ partial "head-custom.html" . -}}
|
||||
<body>
|
||||
<header>{{ partial "header.html" . }}</header>
|
||||
<div id="content">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</div>
|
||||
<footer>{{ partial "footer.html" . -}}</footer>
|
||||
</body>
|
||||
</html>
|
||||
{{- partial "head.html" . }}
|
||||
{{ partial "head-custom.html" . -}}
|
||||
|
||||
<body>
|
||||
<header>{{ partial "header.html" . }}</header>
|
||||
<div id="content">
|
||||
{{- block "main" . }}{{- end }}
|
||||
|
||||
{{ partial "docscomments.html" . }}
|
||||
</div>
|
||||
|
||||
<footer>{{ partial "footer.html" . -}}</footer>
|
||||
{{- $newtabjs := resources.Get "/js/new-tabs.js" | js.Build "/js/new-tabs.js" | minify | fingerprint }}
|
||||
<script src="{{ $newtabjs.Permalink }}"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,24 +1,16 @@
|
|||
{{ define "main" }}
|
||||
<h2>{{ .Title }}</h2>
|
||||
|
||||
{{ if eq .Title "Wiki Index" }}
|
||||
{{ if eq .Title "Index" }}
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<h3>Subpages:</h3>
|
||||
<ul>
|
||||
<li><a href="..">Go back</a></li>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a> <br>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ partial "pageslist.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<hr>
|
||||
|
@ -31,4 +23,4 @@
|
|||
|
||||
{{ .Content }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -1,13 +1,11 @@
|
|||
{{ define "main" }}
|
||||
|
||||
<h3>Subpages:</h3>
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a> <br>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ partial "pageslist.html" . }}
|
||||
<hr>
|
||||
<h2>{{ .Title }}</h2>
|
||||
{{ if $.Params.enabletoc }}
|
||||
<div class="toc">
|
||||
{{ .Page.TableOfContents }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
|
@ -1,3 +1,3 @@
|
|||
{{ define "main" }}
|
||||
{{ .Content }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
|
@ -0,0 +1 @@
|
|||
<p>You weren't expecting to see this! Set up your own copy of layouts/partials/docscomments-content.html with the code you want.</p>
|
|
@ -0,0 +1,16 @@
|
|||
{{ if not .Site.Params.disableDocsComments }}
|
||||
{{ if not .Page.Params.disableDocsComments }}
|
||||
{{ if hugo.IsProduction }}
|
||||
<button type="button" class="collapsible">Expand</button>
|
||||
<div class="collapsible_content">
|
||||
{{ partial "docscomments-content.html" . }}
|
||||
</div>
|
||||
|
||||
{{- $collapsiblejs := resources.Get "/js/collapsible.js" | js.Build "/js/collapsible.js" | minify | fingerprint }}
|
||||
<script src="{{ $collapsiblejs.Permalink }}"></script>
|
||||
{{ else }}
|
||||
<p>Enable HUGO_ENV=production to see.</p>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -1,6 +1,12 @@
|
|||
<p>{{ .Site.Copyright }}</p>
|
||||
<p>
|
||||
Last updated: {{ .Lastmod.Format "January 2, 2006" }}
|
||||
{{ with .GitInfo }}<a href="{{$.Site.Params.GitRepo}}/commit/{{ .Hash }}">
|
||||
{{ .Subject }} ({{ .AbbreviatedHash }})</a>
|
||||
{{ end }}</p>
|
||||
|
||||
<nav>
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ range .Site.Menus.footer }}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
|
@ -1,4 +1,4 @@
|
|||
<a href="{{ " /" | relURL }}">
|
||||
<a href="{{ "/" | relURL }}">
|
||||
<h2>{{ .Site.Title }}</h2>
|
||||
</a>
|
||||
<nav>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<ul>
|
||||
<li><a href="..">Go back</a></li>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
Reference in New Issue