all repos — www @ 2a22eb258e2ba3214509c41d66999af575dbd4b1

deserthorns.net content + generator

site restructure
sageclove
Sat, 01 Mar 2025 23:15:34 -0700
commit

2a22eb258e2ba3214509c41d66999af575dbd4b1

parent

bd9f9a7d8331731ab93cf143a826654a21bf1ec1

M .gitignore.gitignore

@@ -1,2 +1,3 @@

/build/out/ -/build/build+/build/build +/build/__debug*
A .site

@@ -0,0 +1,10 @@

+creative + music + visual + photography +projects + keyboard +about + meta + style + sitemap
M build/build.gobuild/build.go

@@ -58,48 +58,27 @@ fmt.Println("Starting build...")

os.RemoveAll(filepath.Join("out")) os.Mkdir(filepath.Join("out"), 0777) - fmt.Print("Building wiki pages...") - buildWiki(buildWikiLinkedList()) + fmt.Print("Building pages...") + buildSite(buildSiteLinkedList()) fmt.Println("Done") - fmt.Print("Copying and renaming wiki CSS...") - wikiCssOutPath := filepath.Join("out", "wiki", "css") - copyDir( - filepath.Join(rootPath, "wiki", "css"), - wikiCssOutPath, - ) - os.Rename( - filepath.Join(wikiCssOutPath, "style.css"), - filepath.Join(wikiCssOutPath, "style."+strconv.FormatInt(now.Unix(), 10)+".css"), - ) - fmt.Println("Done") - - fmt.Print("Copying assets/...") + fmt.Print("Copying assets...") copyDir( filepath.Join(rootPath, "assets"), filepath.Join("out", "assets"), ) - fmt.Println("Done") - fmt.Print("Copying index.html...") - copyFile( - filepath.Join(rootPath, "index.html"), - filepath.Join("out", "index.html"), - ) - fmt.Println("Done") - - fmt.Print("copying etc/...") - copyDir( - filepath.Join(rootPath, "etc"), - filepath.Join("out", "etc"), + cssOutPath := filepath.Join("out", "assets", "css") + os.Rename( + filepath.Join(cssOutPath, "style.css"), + filepath.Join(cssOutPath, "style."+strconv.FormatInt(now.Unix(), 10)+".css"), ) fmt.Println("Done") fmt.Println("Build complete.") if serve { http.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir("out")))) - http.HandleFunc("GET /wiki/{page}", pageHandler(filepath.Join("out", "wiki"))) - http.HandleFunc("GET /etc/{page}", pageHandler(filepath.Join("out", "etc"))) + http.HandleFunc("GET /{page}", pageHandler("out")) fmt.Println("Serving on http://localhost:8000") log.Fatal(http.ListenAndServe(":8000", nil)) }

@@ -117,7 +96,7 @@ http.NotFound(responseWriter, request)

} } -func buildWikiLinkedList() *Page { +func buildSiteLinkedList() *Page { rootNode := &Page{ Name: "index", Parent: nil,

@@ -125,29 +104,16 @@ }

parentNode := rootNode tailNode := rootNode currentDepth := 0 - tabFile, _ := os.Open(filepath.Join(rootPath, "wiki", "wiki.tab")) - scanner := bufio.NewScanner(tabFile) + siteFile, _ := os.Open(filepath.Join(rootPath, ".site")) + scanner := bufio.NewScanner(siteFile) scanner.Split(bufio.ScanLines) for scanner.Scan() { depth := strings.Count(strings.TrimRight(scanner.Text(), " "), " ") pageName := strings.TrimLeft(scanner.Text(), " ") if len(pageName) > 0 { - if depth == currentDepth { - newNode := &Page{ - Name: pageName, - Parent: parentNode, - } - parentNode.Children = append(parentNode.Children, newNode) - tailNode = newNode - } else if depth > currentDepth { + if depth > currentDepth { currentDepth = depth parentNode = tailNode - newNode := &Page{ - Name: pageName, - Parent: parentNode, - } - parentNode.Children = append(parentNode.Children, newNode) - tailNode = newNode } else if depth < currentDepth { unwind := (currentDepth - depth) + 1 currentDepth = depth

@@ -155,13 +121,13 @@ for range unwind {

tailNode = tailNode.Parent } parentNode = tailNode - newNode := &Page{ - Name: pageName, - Parent: parentNode, - } - parentNode.Children = append(parentNode.Children, newNode) - tailNode = newNode + } + newNode := &Page{ + Name: pageName, + Parent: parentNode, } + parentNode.Children = append(parentNode.Children, newNode) + tailNode = newNode } } return rootNode

@@ -212,9 +178,10 @@ }

return childLinks } -func buildWiki(page *Page) { - wikiSrcPath := filepath.Join(rootPath, "wiki") - wikiOutPath := filepath.Join("out", "wiki") +func buildSite(page *Page) { + outDir := filepath.Join("out") + pageSrcDir := filepath.Join(rootPath, "pages") + templateSrcDir := filepath.Join(rootPath, "templates") parents := parentLinks(page) siblings := siblingLinks(page) children := childLinks(page)

@@ -226,31 +193,32 @@ if headerLink != nil {

filteredHeaderLinks = append(filteredHeaderLinks, headerLink) } } - pageFilePath := filepath.Join(wikiSrcPath, "pages", page.Name+".html") + pageFilePath := filepath.Join(pageSrcDir, page.Name+".html") pageFileInfo, _ := os.Stat(pageFilePath) if pageFileInfo == nil { copyFile( - filepath.Join(wikiSrcPath, "templates", "page.html"), + filepath.Join(templateSrcDir, "page.html"), pageFilePath, ) } - os.Mkdir(wikiOutPath, 0777) - outfile, _ := os.Create(filepath.Join(wikiOutPath, page.Name+".html")) - template, _ := template.ParseFiles( - filepath.Join(wikiSrcPath, "templates", "document.html"), - filepath.Join(wikiSrcPath, "templates", "header.html"), - filepath.Join(wikiSrcPath, "pages", page.Name+".html"), + os.Mkdir(outDir, 0777) + outfile, _ := os.Create(filepath.Join(outDir, page.Name+".html")) + template, err := template.ParseFiles( + filepath.Join(templateSrcDir, "document.html"), + filepath.Join(templateSrcDir, "header.html"), + filepath.Join(pageSrcDir, page.Name+".html"), ) + __(err) template.Execute( outfile, &PageProperties{ Title: page.Name, - StylePath: "/wiki/css/style." + strconv.FormatInt(now.Unix(), 10) + ".css", + StylePath: "/assets/css/style." + strconv.FormatInt(now.Unix(), 10) + ".css", HeaderLinks: filteredHeaderLinks, }, ) for _, child := range page.Children { - buildWiki(child) + buildSite(child) } }
D etc/do.html

@@ -1,131 +0,0 @@

-<!DOCTYPE html> -<html> - -<head> - <meta charset="UTF-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width,initial-scale=1.0"> - <link rel="stylesheet" href="/assets/css/colors.css"> - <title>do</title> - <style> - html { - background: var(--background); - color: var(--f_high); - } - - body { - -webkit-text-size-adjust: 100%; - } - - p { - max-width: 30rem; - margin: 0 auto; - text-align: center; - } - - hr { - border: 1px solid var(--b_med); - } - - a { - color: var(--f_med); - } - - h1, - h2 { - letter-spacing: 0.5rem; - font-family: monospace; - text-align: center; - color: var(--b_inv); - } - - .logo { - display: block; - margin: 2rem auto; - width: 4rem; - height: 4rem; - } - - .rotation { - max-width: 20rem; - margin: 0 auto; - margin-bottom: 3rem; - } - - .rotation > div { - padding: 1rem; - margin: 0.25rem; - text-align: center; - color: var(--f_high); - font-family: monospace; - font-size: 1rem; - } - - .rotation > div > span { - display: block; - } - - #today { - background: var(--b_high); - color: var(--background); - font-weight: bold; - } - - #plus-1 { - background: var(--b_med); - } - - #plus-2 { - background: var(--b_low); - } - </style> -</head> - -<body> - <a href="/"> - <img class="logo" src="/assets/svg/logo-light.svg"> - </a> - <hr> - <h1>do</h1> - <div class="rotation"> - <div id="today"> - <span>Today,</span> - <span id="action"></span> - </div> - <div id="plus-1"> - <span>Tommorrow,</span> - <span id="action"></span> - </div> - <div id="plus-2"> - <span>Then,</span> - <span id="action"></span> - </div> - </div> - <h2>about</h2> - <p> - Based on the concept of "The Discipline" discussed <a href="https://anatomy.1651.org/#the-discipline">here</a>. - </p> -</body> -<script> - const rotation = [ - "connect", - "read", - "study", - "play", - "create", - "read", - "create", - "play", - "study", - "read" - ]; - const now = new Date(); - const daysSinceEpoch = now / 1000 / 60 / 60 / 24; - const timezoneOffsetDays = now.getTimezoneOffset() / 60 / 24; - const index = Math.floor((daysSinceEpoch - timezoneOffsetDays) % 10); - document.querySelector("#today > #action").innerText = rotation[index]; - document.querySelector("#plus-1 > #action").innerText = rotation[(index + 1) % 10]; - document.querySelector("#plus-2 > #action").innerText = rotation[(index + 2) % 10]; -</script> - -</html>
D index.html

@@ -1,258 +0,0 @@

-<!DOCTYPE html> -<html> - -<head> - <meta charset="UTF-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width,initial-scale=1.0"> - <meta name="theme-color" content="#374456"> - <title>deserthorns</title> - <link rel="stylesheet" href="/assets/css/colors.css"> - <style> - html { - background: var(--f_high); - } - - body { - -webkit-text-size-adjust: 100%; - margin: 0; - } - - a { - color: var(--f_med); - } - - ul { - list-style: none; - text-align: center; - font-size: 1.25rem; - padding: 0; - } - - li { - padding-bottom: 1rem; - } - - .content { - margin: 3rem auto 8rem; - border: 3px solid var(--b_inv); - padding: 2rem; - box-shadow: 8px 8px var(--background); - max-width: 30rem; - background: var(--background); - } - - .ident-imgs { - display: flex; - flex-direction: row; - justify-content: center; - } - - .logo { - display: block; - width: 8rem; - height: 8rem; - margin: 0 auto; - } - - .name { - display: block; - letter-spacing: 0.5rem; - font-family: monospace; - color: var(--b_high); - font-size: 2rem; - margin-left: 1rem; - text-align: center; - animation: 1s ease-in-out fade-in, 1s ease-in-out spacing; - } - - h2 { - letter-spacing: 0.5rem; - font-family: monospace; - color: var(--b_high); - text-align: center; - } - - blockquote { - color: var(--f_high); - text-align: center; - margin: 3rem 0.5rem 1rem; - } - - blockquote + p { - color: var(--f_med); - text-align: center; - } - - blockquote + p > span { - font-style: italic; - } - - .round-img { - width: 6rem; - height: 6rem; - border-radius: 50%; - display: block; - margin: 0 auto; - } - - .header { - height: 40vh; - } - - .header-img { - width: 100%; - height: 100%; - object-fit: cover; - object-position: center; - image-rendering: crisp-edges; - } - - .divider > hr { - top: -4rem; - position: relative; - padding: 0; - margin: 0; - animation: none; - border: 1px solid var(--b_low); - } - - .divider > .round-img { - z-index: 1; - position: relative; - border: 1rem solid var(--background); - image-rendering: crisp-edges; - } - - nav { - margin-bottom: 4rem; - } - - nav ul { - display: flex; - justify-content: center; - flex-wrap: wrap; - } - - nav li { - padding: 0; - margin-top: 1rem; - } - - nav li > a { - border: 1px solid var(--b_med); - width: fit-content; - padding: 0.25rem 0.5rem; - margin: 0.5rem; - box-shadow: 4px 4px var(--b_low); - text-decoration: none; - font-family: monospace; - font-size: 1rem; - } - - nav li > a:hover { - background: var(--b_high); - color: var(--background); - border-color: var(--background); - box-shadow: 4px 4px var(--b_high); - } - - @media screen and (max-width: 600px) { - .header { - height: 30vh; - } - - .content { - max-width: 17rem; - } - - .name { - font-size: 1.5rem; - } - - .logo { - width: 6rem; - height: 6rem; - } - - .round-img { - width: 4rem; - height: 4rem; - } - - .divider > hr { - top: -3rem; - } - } - - @keyframes fade-in { - from { - opacity: 0; - } - - to { - opacity: 1; - } - } - - @keyframes spacing { - from { - letter-spacing: normal; - } - - to { - letter-spacing: 0.5rem; - } - } - </style> -</head> - -<body> - <div class="header"> - <img class="header-img" src="/assets/img/sunset-d.png"> - </div> - <div class="content"> - <img class="logo" src="/assets/svg/logo-light.svg"> - <h1 class="name">deserthorns</h1> - <nav> - <ul> - <li> - <a href="/wiki">wiki</a> - </li> - <li> - <a href="/etc/do">do</a> - </li> - <li> - <a href="/wiki/about">about</a> - </li> - <!-- <li> - <a href="/now">now</a> - </li> - <li> - <a href="/music">music</a> - </li> - <li> - <a href="/photos">photos</a> - </li> - --> - <li> - <a href="https://git.deserthorns.net/">git</a> - </li> - <!-- <li> - <a href="/etc">etc</a> - </li> --> - </ul> - </nav> - <div class="divider"> - <img class="round-img" src="/assets/img/vista-d.png"> - <hr> - </div> - <blockquote> - <p>Your hearts know in silence the secrets of the days and the nights.</p> - <p>But your ears thirst for the sound of your heart’s knowledge.</p> - </blockquote> - <p>- Khalil Gibran, <span>The Prophet</span></p> - </div> -</body> - -</html>
A pages/creative.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
A pages/index.html

@@ -0,0 +1,241 @@

+{{ define "head" }} +<style> + html { + background: var(--f_high); + } + + body { + -webkit-text-size-adjust: 100%; + margin: 0; + } + + a { + color: var(--f_med); + } + + ul { + list-style: none; + text-align: center; + font-size: 1.25rem; + padding: 0; + } + + li { + padding-bottom: 1rem; + } + + .content { + margin: 3rem auto 8rem; + border: 3px solid var(--b_inv); + padding: 2rem; + box-shadow: 8px 8px var(--background); + max-width: 30rem; + background: var(--background); + } + + .ident-imgs { + display: flex; + flex-direction: row; + justify-content: center; + } + + .logo { + display: block; + width: 8rem; + height: 8rem; + margin: 0 auto; + } + + .name { + display: block; + letter-spacing: 0.5rem; + font-family: monospace; + color: var(--b_high); + font-size: 2rem; + margin-left: 1rem; + text-align: center; + animation: 1s ease-in-out fade-in, 1s ease-in-out spacing; + } + + h2 { + letter-spacing: 0.5rem; + font-family: monospace; + color: var(--b_high); + text-align: center; + } + + blockquote { + color: var(--f_high); + text-align: center; + margin: 3rem 0.5rem 1rem; + } + + blockquote + p { + color: var(--f_med); + text-align: center; + } + + blockquote + p > span { + font-style: italic; + } + + .round-img { + width: 6rem; + height: 6rem; + border-radius: 50%; + display: block; + margin: 0 auto; + } + + .header { + height: 40vh; + } + + .header-img { + width: 100%; + height: 100%; + object-fit: cover; + object-position: center; + image-rendering: crisp-edges; + } + + .divider > hr { + top: -4rem; + position: relative; + padding: 0; + margin: 0; + animation: none; + border: 1px solid var(--b_low); + } + + .divider > .round-img { + z-index: 1; + position: relative; + border: 1rem solid var(--background); + image-rendering: crisp-edges; + } + + nav { + margin-bottom: 4rem; + } + + nav ul { + display: flex; + justify-content: center; + flex-wrap: wrap; + } + + nav li { + padding: 0; + margin-top: 1rem; + } + + nav li > a { + border: 1px solid var(--b_med); + width: fit-content; + padding: 0.25rem 0.5rem; + margin: 0.5rem; + box-shadow: 4px 4px var(--b_low); + text-decoration: none; + font-family: monospace; + font-size: 1rem; + } + + nav li > a:hover { + background: var(--b_high); + color: var(--background); + border-color: var(--background); + box-shadow: 4px 4px var(--b_high); + } + + @media screen and (max-width: 600px) { + .header { + height: 30vh; + } + + .content { + max-width: 17rem; + } + + .name { + font-size: 1.5rem; + } + + .logo { + width: 6rem; + height: 6rem; + } + + .round-img { + width: 4rem; + height: 4rem; + } + + .divider > hr { + top: -3rem; + } + } + + @keyframes fade-in { + from { + opacity: 0; + } + + to { + opacity: 1; + } + } + + @keyframes spacing { + from { + letter-spacing: normal; + } + + to { + letter-spacing: 0.5rem; + } + } +</style> +{{ end }} + +{{ define "body" }} +<div class="header"> + <img class="header-img" src="/assets/img/sunset-d.png"> +</div> +<div class="content"> + <img class="logo" src="/assets/svg/logo-light.svg"> + <h1 class="name">deserthorns</h1> + <nav> + <ul> + <li> + <a href="/creative">creative</a> + </li> + <li> + <a href="/projects">projects</a> + </li> + <li> + <a href="/about">about</a> + </li> + <!-- <li> + <a href="/now">now</a> + </li> + --> + <li> + <a href="https://git.deserthorns.net/">git</a> + </li> + </ul> + </nav> + <div class="divider"> + <img class="round-img" src="/assets/img/vista-d.png"> + <hr> + </div> + <blockquote> + <p>Your hearts know in silence the secrets of the days and the nights.</p> + <p>But your ears thirst for the sound of your heart’s knowledge.</p> + </blockquote> + <p>- Khalil Gibran, <span>The Prophet</span></p> +</div> +{{ end }} + +{{ define "scripts" }} +{{ end }}
A pages/keyboard.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
A pages/meta.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
A pages/music.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
A pages/photography.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
A pages/projects.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
A pages/sitemap.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
A pages/visual.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
M readme.mdreadme.md

@@ -12,9 +12,10 @@

`./build <ROOT>` `<ROOT>` should be a path to the site's source directory. The source directory must contain the following subdirectories and files: -- `wiki/` -- `assets` -- `index.html` +- `pages/` +- `templates/` +- `assets/` +- `.site` If `<ROOT>` is omitted, the current directory will be used as the source directory.

@@ -24,12 +25,11 @@

#### Flags - `--serve`, `-s`: Builds site, then serves built site on port 8000. For previewing site, not for use in a live environment. Live environment should serve the static files from the `/out` directory. -#### Creating a new wiki page -Add a new name to `wiki.tab` at its proper place in the hierarchy and rerun `./build`. A new file will be created in the `/wiki/pages` source directory with the proper template tags. +#### Creating a new page +Add a new name to `.site` at its proper place in the hierarchy and rerun `./build`. A new file will be created in the `/pages` source directory with the proper template tags. ### TODOs - Fast rebuild when serving locally using `-s` (press Enter to rebuild?) -- [wiki] Sitemap/index of all pages -- [wiki] Use YAML for `wiki.tab`? -- [wiki] Backlinks +- Sitemap/index of all pages +- Backlinks - Typography styling pass
A templates/page.html

@@ -0,0 +1,11 @@

+{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> +{{ end }} + +{{ define "body" }} +{{ template "header" . }} +<h1>{{.Title}}</h1> +{{ end }} + +{{ define "scripts" }} +{{ end }}
M wiki/pages/about.htmlpages/about.html

@@ -1,7 +1,9 @@

-{{ define "styles" }} +{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> {{ end }} -{{ define "content" }} +{{ define "body" }} +{{ template "header" . }} <h1>About</h1> <hr> <h2>Me</h2>
D wiki/pages/bar.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/creative.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/foo.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/git.html

@@ -1,64 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -<h1>git</h1> -<p> - <a href="https://git.deserthorns.net/">My git repositories</a> are hosted on a VPS and use <a href="https://github.com/icyphox/legit">legit</a> for the web frontend. -</p> -<p> - Pushing using HTTP/S is disabled, pushing must be done over SSH. -</p> -<h2>Creating a new repo</h2> -<p> - First, a new bare repo needs to be created <strong>on the server</strong>. In my case, all git repos are stored on the server in <code>/var/git</code>: -</p> -<pre> -cd /var/git -mkdir my-new-repo -cd my-new-repo -git init --bare -</pre> -<p> - Once the bare repo on the server has been created, switch to a client and create a new working (non-bare) repo: -</p> -<pre> -mkdir my-new-repo -cd my-new-repo -git init -</pre> -<p> - With this, the working repo has been created on the client, now we can add content and commit it: -</p> -<pre> -** Add/change some stuff, make a readme... ** -git add . -git commit -m "initial commit" -</pre> -<p> - Now we need to do the inital push and update the remote for the repo to be the server repo (you need to have already <a href="/wiki/ssh">set up SSH</a> for the remote user that you are using to do the push): -</p> -<pre> -git remote add origin &ltREMOTE_USER&gt@git.deserthorns.net:/var/git/my-new-repo -git push --set-upstream origin master -</pre> -<p> - Now our repo on the server should have the files added/changed by the client. -</p> -<p> - After the initial commit, pushing is easy as: -</p> -<pre> -** Add/change some stuff ** -git add . -git commit -m "did stuff" -git push -</pre> - -<h2>Cloning over SSH</h2> -<p>You need to have already <a href="/wiki/ssh">set up SSH</a> for the remote user that you are using to clone!</p> -<pre>git clone &ltREMOTE_USER&gt@git.deserthorns.net:/var/git/my-repo</pre> -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/index.html

@@ -1,11 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -<h1>Home</h1> -<hr> -<p>What are you doing here? There's nothing here yet...</p> -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/knowledge.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/links.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/meta.html

@@ -1,9 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -<h1>meta</h1> -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/music.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/software.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/ssh.html

@@ -1,43 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -<h1>SSH</h1> - -<p> - The information provided on this page assumes you are using <code>sshd</code> as the SSH server on a Linux machine. -</p> - -<h2>Config</h2> - -<p> - <code>sshd</code> is configured using the <code>sshd_config</code> file, typically located in <code>/etc/ssh/</code>. -</p> - -<h2>Hardening SSH access</h2> -<p> - Generally, using private key authentication for SSH is preferred instead of password authentication. To disable password auth, add/uncomment the following line in <code>sshd_config</code>, save, and restart <code>sshd</code>: -</p> -<pre>PasswordAuthentication no</pre> -<p> - Even with password auth disabled, it is still a good idea to disable root login over SSH: you should set up a non-root user and use that user to log in. To disable root login over SSH, add/uncomment the following line in <code>sshd_config</code>, save, and restart <code>sshd</code>: -</p> -<pre>PermitRootLogin no</pre> - -<h2>SSH key-based authentication</h2> -<p>First, generate a key on the local machine:</p> -<pre>ssh-keygen</pre> -<p>You can provide a path for the file containing the new key. It can be useful to give the file a distinct name so you are not using the same key for multiple systems. That said, it is advisable to keep the path the same (typically <code>~/.ssh/</code>), since most tools that use SSH look in that directory for keys by default.</p> -<p>You can optionally provide a passphrase. This passphrase (if provided) will need to be entered at every login.</p> -<p>Now that the key has been generated, it needs to be copied to the server. Many online guides will cover using <code>ssh-copy-id</code> to to just this. However, <code>ssh-copy-id</code> only works if password authentication is enabled on the remote machine, and password authentication should be disabled to harden SSH access against attacks.</p> -<aside>That said, you could absolutely use <code>ssh-copy-id</code> with password authentication still enabled, as long as your remote user has a strong password and you make sure to disable password authentication after key-based authentication is set up.</aside> -<p>Instead, we will need to copy the new key to the remote machine manually. This requires access to the remote machine, likely via another local machine already cofigured for SSH access.</p> -<p>Copy the newly-generated public key (contained in the <code>.pub</code> file generated when you ran <code>ssh-keygen</code>) from the local machine. Then log into the remote machine and paste the public key into the <code>~/.ssh/authorized_keys</code> file and save.</p> -<p>Now the new key can be used to SSH into the remote machine. If your key was generated using the default name of <code>id_rsa</code>, the following should work:</p> -<pre>ssh &ltUSER&gt@&ltREMOTE_HOST&gt</pre> -<p>If a different name was chosen for the key file (e.g. <code>my-server</code>), use the <code>-i</code> ("identity") flag to indicate which key file to use:</p> -<pre>ssh -i ~/.ssh/my-server &ltUSER&gt@&ltREMOTE_HOST&gt</pre> -{{ end }} - -{{ define "scripts" }} -{{ end }}
M wiki/pages/style.htmlpages/style.html

@@ -1,4 +1,5 @@

-{{ define "styles" }} +{{ define "head" }} +<link rel="stylesheet" href="{{.StylePath}}"> <style> .palette { display: flex;

@@ -47,8 +48,8 @@ }

</style> {{ end }} - -{{ define "content" }} +{{ define "body" }} +{{ template "header" . }} <h1>Style</h1> <hr> <h2>Palette</h2>

@@ -59,16 +60,16 @@ <div style="background-color: var(--f_high);">

<span style="background-color: var(--f_high); color: var(--background);">f_high</span> </div> <div style="background-color: var(--f_med);"> - <span style="background-color: var(--f_med); color: var(--b_med);">f_med</span> + <span style="background-color: var(--f_med); color: var(--background);">f_med</span> </div> <div style="background-color: var(--f_low);"> - <span style="background-color: var(--f_low); color: var(--b_med);">f_low</span> + <span style="background-color: var(--f_low); color: var(--f_high);">f_low</span> </div> <div style="background-color: var(--f_inv);"> <span style="background-color: var(--f_inv); color: var(--f_high);">f_inv</span> </div> <div style="background-color: var(--b_high);"> - <span style="background-color: var(--b_high); color: var(--f_low);">b_high</span> + <span style="background-color: var(--b_high); color: var(--background);">b_high</span> </div> <div style="background-color: var(--b_med);"> <span style="background-color: var(--b_med); color: var(--f_high);">b_med</span>
D wiki/pages/sysadmin.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/tools.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/pages/visuals.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
M wiki/templates/document.htmltemplates/document.html

@@ -6,12 +6,10 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>{{.Title}}</title> <link rel="stylesheet" href="/assets/css/colors.css"> - <link rel="stylesheet" href="{{.StylePath}}"> - {{ template "styles"}} + {{ template "head" . }} </head> <body> - {{ template "header" . }} - {{ template "content" }} + {{ template "body" . }} </body> {{ template "scripts" }} </html>
M wiki/templates/header.htmltemplates/header.html

@@ -1,13 +1,11 @@

{{ define "header" }} <div class="header"> <div class="ident"> - <a href="/wiki"> + <a href="/"> <img class="logo" src="/assets/svg/logo-light.svg"> </a> - <span class="name mobile">deserthorns</span> </div> <div class="links"> - <span class="name">deserthorns</span> <div class="columns"> {{ range .HeaderLinks }} <ul>
D wiki/templates/page.html

@@ -1,8 +0,0 @@

-{{ define "styles" }} -{{ end }} - -{{ define "content" }} -{{ end }} - -{{ define "scripts" }} -{{ end }}
D wiki/wiki.tab

@@ -1,15 +0,0 @@

-creative - music - visuals - -knowledge - software - git - sysadmin - ssh - tools - -meta - about - style - links