Add tips
This commit is contained in:
parent
c139163a91
commit
818889f55a
15 changed files with 97 additions and 49 deletions
|
@ -4,6 +4,7 @@ title: lyte.dev
|
||||||
pygmentsCodeFences: true
|
pygmentsCodeFences: true
|
||||||
pygmentsCodeFencesGuessSyntax: true
|
pygmentsCodeFencesGuessSyntax: true
|
||||||
pygmentsUseClasses: true
|
pygmentsUseClasses: true
|
||||||
|
enableGitInfo: true
|
||||||
markup:
|
markup:
|
||||||
goldmark:
|
goldmark:
|
||||||
renderer:
|
renderer:
|
||||||
|
@ -29,7 +30,11 @@ menu:
|
||||||
name: blog
|
name: blog
|
||||||
url: /blog
|
url: /blog
|
||||||
weight: 20
|
weight: 20
|
||||||
|
- identifier: tips
|
||||||
|
name: tips
|
||||||
|
url: /tips
|
||||||
|
weight: 30
|
||||||
- identifier: contact
|
- identifier: contact
|
||||||
name: contact
|
name: contact
|
||||||
url: /contact
|
url: /contact
|
||||||
weight: 30
|
weight: 40
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
title: Blog
|
title: Blog
|
||||||
---
|
---
|
||||||
|
|
||||||
## Latest Posts ([RSS](/blog/index.xml))
|
## Latest Blog Posts ([RSS](/blog/index.xml))
|
||||||
|
|
|
@ -4,10 +4,14 @@ title: How to Setup A Free, Fast, and Simple Blog Like This
|
||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<!-- better intro and summary? -->
|
||||||
|
|
||||||
**TL;DR**: Netlify is incredible for hosting static websites. The code for this
|
**TL;DR**: Netlify is incredible for hosting static websites. The code for this
|
||||||
entire site is available [here][repo]. I publish at-will using their CLI via
|
entire site is available [here][repo]. I publish at-will using their CLI via
|
||||||
`netlify deploy --prod`. It's simple and awesome.
|
`netlify deploy --prod`. It's simple and awesome.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
This website may not look like much, but that's *intentional*. It is simple
|
This website may not look like much, but that's *intentional*. It is simple
|
||||||
|
|
|
@ -9,15 +9,15 @@ title: Mirroring Gitea to Other Repository Management Services (GitHub, GitLab,
|
||||||
draft: false
|
draft: false
|
||||||
---
|
---
|
||||||
|
|
||||||
**NOTE**: Gitea now supports this out-of-the-box and probably fits your
|
|
||||||
use-case: https://docs.gitea.io/en-us/repo-mirror/
|
|
||||||
|
|
||||||
I have a [Gitea][gitea] instance I self-host at home. I keep most of my
|
I have a [Gitea][gitea] instance I self-host at home. I keep most of my
|
||||||
repositories there, but I recognize that most other developers and potential
|
repositories there, but I recognize that most other developers and potential
|
||||||
employers will want to see [my work _on_ GitHub][me-on-github].
|
employers will want to see [my work _on_ GitHub][me-on-github].
|
||||||
|
|
||||||
<!--more-->
|
<!--more-->
|
||||||
|
|
||||||
|
**NOTE**: Gitea now supports this out-of-the-box and probably fits your
|
||||||
|
use-case: https://docs.gitea.io/en-us/repo-mirror/
|
||||||
|
|
||||||
# TL;DR
|
# TL;DR
|
||||||
|
|
||||||
- Setup an SSH key for your Gitea instance on the relevant external repositories
|
- Setup an SSH key for your Gitea instance on the relevant external repositories
|
||||||
|
|
|
@ -9,6 +9,8 @@ create an anchor with that name and reference it later with `*{NAME_HERE}` (like
|
||||||
`*key`) to avoid repeating yourself in a document. You can also "merge" object
|
`*key`) to avoid repeating yourself in a document. You can also "merge" object
|
||||||
values using the `<<` key.
|
values using the `<<` key.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
Since working at [Postmates][pm] ([we're hiring][pm-referral]!) and getting my
|
Since working at [Postmates][pm] ([we're hiring][pm-referral]!) and getting my
|
||||||
|
|
|
@ -11,6 +11,8 @@ a long time and forgotten what all is necessary in order to spin up
|
||||||
a development environment or which incantation is needed to get this particular
|
a development environment or which incantation is needed to get this particular
|
||||||
project to compile, you need a Makefile.
|
project to compile, you need a Makefile.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
|
|
||||||
|
|
5
content/tips/_index.md
Normal file
5
content/tips/_index.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Blog
|
||||||
|
---
|
||||||
|
|
||||||
|
## Latest Tips ([RSS](/tips/index.xml))
|
|
@ -1,10 +1,15 @@
|
||||||
|
---
|
||||||
|
title: "iex and dbg/1 without pry prompts"
|
||||||
|
date: "2023-06-22"
|
||||||
|
---
|
||||||
|
|
||||||
I love `iex -S mix ...` but I usually don't like when `dbg` asks me to `pry`.
|
I love `iex -S mix ...` but I usually don't like when `dbg` asks me to `pry`.
|
||||||
Just show me my data! Well, today I learned about `iex --no-pry`:
|
Just show me my data! Well, today I learned about `iex --no-pry`:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ iex --help
|
$ iex --help
|
||||||
Usage: iex [options] [.exs file] [data]
|
Usage: iex [options] [.exs file] [data]
|
||||||
... (snip)
|
...
|
||||||
--no-pry Doesn't start pry sessions when dbg/2 is called.
|
--no-pry Doesn't start pry sessions when dbg/2 is called.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
<ul>
|
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
{{ .Render "li" }}
|
{{ .Render "li" }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<li>Looks like there's nothing here!... yet!</li>
|
<p>Looks like there's nothing here!... yet!</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<li style="margin-bottom: 0.5em">
|
<h3>
|
||||||
{{ dateFormat "Jan 2 2006" .Lastmod }}
|
<a style="flex-shrink: 1; margin-right: auto;" href="{{ .Permalink }}">
|
||||||
<br />
|
{{ print .Title " posted on " (dateFormat "Jan 2 2006" (cond .Date.IsZero .Lastmod .Date)) }}
|
||||||
<a href="{{ .Permalink }}">
|
|
||||||
{{ .Title }}
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</h3>
|
||||||
|
{{ .Summary }}
|
||||||
|
|
|
@ -2,14 +2,19 @@
|
||||||
|
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|
||||||
<h2 id="latest-posts">Latest Posts (<a target="_blank" href="/blog/index.xml">RSS</a>)</h2>
|
<h2 id="latest-posts">Latest <a href="/blog">Blog</a> Posts (<a target="_blank" href="/blog/index.xml">RSS</a>)</h2>
|
||||||
|
|
||||||
<ul>
|
|
||||||
{{ range (where .Site.RegularPages "Section" "blog") }}
|
{{ range (where .Site.RegularPages "Section" "blog") }}
|
||||||
{{ .Render "li" }}
|
{{ .Render "li" }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<p>Looks like there's nothing here!... yet!</p>
|
<p>Looks like there's nothing here!... yet!</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
|
||||||
|
<h2 id="latest-tips">Latest <a href="/tips">Tips</a> (<a target="_blank" href="/tips/index.xml">RSS</a>)</h2>
|
||||||
|
{{ range (where .Site.RegularPages "Section" "tips") }}
|
||||||
|
{{ .Render "li" }}
|
||||||
|
{{ else }}
|
||||||
|
<p>Looks like there's nothing here!... yet!</p>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
6
layouts/tips/li.html
Normal file
6
layouts/tips/li.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<h3>
|
||||||
|
<a style="flex-shrink: 1; margin-right: auto;" href="{{ .Permalink }}">
|
||||||
|
{{ print .Title " posted on " (dateFormat "Jan 2 2006" (cond .Date.IsZero .Lastmod .Date)) }}
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
{{ .Content }}
|
13
layouts/tips/single.html
Normal file
13
layouts/tips/single.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{{ define "title" }}
|
||||||
|
{{ .Title }} - {{ .Site.Title }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ define "main" }}
|
||||||
|
<h2 id="{{ .Title }}"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
|
||||||
|
{{ with .Lastmod }}
|
||||||
|
<p>
|
||||||
|
Posted on {{ dateFormat "Jan 2 2006" . }}
|
||||||
|
</p>
|
||||||
|
{{ end }}
|
||||||
|
{{ .Content }}
|
||||||
|
{{ end }}
|
|
@ -12,25 +12,14 @@ a
|
||||||
a > svg
|
a > svg
|
||||||
margin-right: 0.5em
|
margin-right: 0.5em
|
||||||
|
|
||||||
.copy-code-button-container
|
|
||||||
position absolute
|
|
||||||
// top 1em
|
|
||||||
right 0.5em
|
|
||||||
overflow visible
|
|
||||||
padding 0
|
|
||||||
margin 0
|
|
||||||
max-width 100%
|
|
||||||
width 100%
|
|
||||||
display flex
|
|
||||||
|
|
||||||
button.copy-code-button
|
button.copy-code-button
|
||||||
color var(--link-fg)
|
color var(--link-fg)
|
||||||
text-decoration underline
|
text-decoration underline
|
||||||
z-index 10
|
z-index 10
|
||||||
position relative
|
position relative
|
||||||
margin-left auto
|
align-self flex-start
|
||||||
|
position absolute
|
||||||
@media (max-width: 600px)
|
right 0
|
||||||
opacity 0.75
|
opacity 0.75
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
|
@ -61,8 +50,11 @@ html,body
|
||||||
|
|
||||||
&> main, > footer
|
&> main, > footer
|
||||||
.highlight
|
.highlight
|
||||||
|
position relative
|
||||||
|
background-color var(--syntax-bg)
|
||||||
max-width 100vw
|
max-width 100vw
|
||||||
border-left solid var(--syntax-bpx) var(--syntax-ledg)
|
border-left solid var(--syntax-bpx) var(--syntax-ledg)
|
||||||
|
display flex
|
||||||
|
|
||||||
.highlight, h1, h2, h3, h4, h5, h6, form, ul, ol, p
|
.highlight, h1, h2, h3, h4, h5, h6, form, ul, ol, p
|
||||||
margin-top 1em
|
margin-top 1em
|
||||||
|
@ -76,7 +68,8 @@ html,body
|
||||||
*:first-child { margin-top: 0 }
|
*:first-child { margin-top: 0 }
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6
|
h1, h2, h3, h4, h5, h6
|
||||||
display flex
|
position relative
|
||||||
|
display block
|
||||||
|
|
||||||
.anchor-link
|
.anchor-link
|
||||||
flex-grow 1
|
flex-grow 1
|
||||||
|
@ -84,7 +77,6 @@ html,body
|
||||||
font-weight normal
|
font-weight normal
|
||||||
font-size 75%
|
font-size 75%
|
||||||
text-decoration underline
|
text-decoration underline
|
||||||
display flex
|
|
||||||
color transparent
|
color transparent
|
||||||
|
|
||||||
&:focus-visible
|
&:focus-visible
|
||||||
|
@ -101,9 +93,9 @@ html,body
|
||||||
font-weight normal
|
font-weight normal
|
||||||
font-size 75%
|
font-size 75%
|
||||||
text-decoration none
|
text-decoration none
|
||||||
display flex
|
|
||||||
position absolute
|
position absolute
|
||||||
right 0
|
right 0
|
||||||
|
top 0
|
||||||
|
|
||||||
> p code, > h1 code, > h2 code, > h3 code, > h4 code, > h5 code, > h6 code, blockquote code
|
> p code, > h1 code, > h2 code, > h3 code, > h4 code, > h5 code, > h6 code, blockquote code
|
||||||
padding 0.1em 0.25em
|
padding 0.1em 0.25em
|
||||||
|
@ -165,6 +157,14 @@ button, input[type=submit]
|
||||||
.lead { font-size: 1.5rem }
|
.lead { font-size: 1.5rem }
|
||||||
.rounded { border-radius: 0.5em }
|
.rounded { border-radius: 0.5em }
|
||||||
|
|
||||||
|
table tr > td.leading
|
||||||
|
padding-right 1em
|
||||||
|
|
||||||
|
table tr > td
|
||||||
|
vertical-align top
|
||||||
|
padding-top 0.25em
|
||||||
|
padding-bottom 0.25em
|
||||||
|
|
||||||
form
|
form
|
||||||
&> label, > fieldset
|
&> label, > fieldset
|
||||||
border 0
|
border 0
|
||||||
|
@ -219,7 +219,7 @@ form
|
||||||
line-height 1.5em
|
line-height 1.5em
|
||||||
text-align left
|
text-align left
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6, form, ul, ol, p
|
h1, h2, h3, h4, h5, h6, form, ul, ol, p, table, .content
|
||||||
position relative
|
position relative
|
||||||
max-width 600px
|
max-width 600px
|
||||||
margin-left auto
|
margin-left auto
|
||||||
|
|
|
@ -52,12 +52,12 @@ function initCodeCopyButtons() {
|
||||||
const codeBlocks = document.querySelectorAll("pre.chroma");
|
const codeBlocks = document.querySelectorAll("pre.chroma");
|
||||||
codeBlocks.forEach((block) => {
|
codeBlocks.forEach((block) => {
|
||||||
const code = block.querySelectorAll("code")[0];
|
const code = block.querySelectorAll("code")[0];
|
||||||
const buttonContainer = document.createElement("p");
|
|
||||||
buttonContainer.classList.add("copy-code-button-container");
|
// const buttonContainer = document.createElement("p");
|
||||||
|
// buttonContainer.classList.add("copy-code-button-container");
|
||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
buttonContainer.appendChild(button);
|
// buttonContainer.appendChild(button);
|
||||||
button.classList.add("copy-code-button");
|
button.classList.add("copy-code-button");
|
||||||
block.parentNode.parentNode.insertBefore(buttonContainer, block.parentNode);
|
|
||||||
button.textContent = "Copy";
|
button.textContent = "Copy";
|
||||||
button.addEventListener("click", (_ev) => {
|
button.addEventListener("click", (_ev) => {
|
||||||
button.disabled = true;
|
button.disabled = true;
|
||||||
|
@ -77,6 +77,8 @@ function initCodeCopyButtons() {
|
||||||
}, 3000);
|
}, 3000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
block.parentNode.appendChild(button);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue