domain update
This commit is contained in:
parent
60d0c0b005
commit
cbb14c7832
|
@ -8,7 +8,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"code.ewintr.nl/shitty-ssg/cmd/notes/note"
|
"go-mod.ewintr.nl/shitty-ssg/cmd/notes/note"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package note
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Kind string
|
type Kind string
|
||||||
|
|
|
@ -3,7 +3,7 @@ package note
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Notes []*Note
|
type Notes []*Note
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
"go-mod.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"html"
|
"html"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/slugify"
|
"go-mod.ewintr.nl/go-kit/slugify"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type HTMLPost struct {
|
type HTMLPost struct {
|
||||||
|
|
|
@ -3,9 +3,9 @@ package site_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/test"
|
"go-mod.ewintr.nl/go-kit/test"
|
||||||
"code.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
"go-mod.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFormatBlock(t *testing.T) {
|
func TestFormatBlock(t *testing.T) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package site
|
package site
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -3,9 +3,9 @@ package site_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/test"
|
"go-mod.ewintr.nl/go-kit/test"
|
||||||
"code.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
"go-mod.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewLanguage(t *testing.T) {
|
func TestNewLanguage(t *testing.T) {
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/slugify"
|
"go-mod.ewintr.nl/go-kit/slugify"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/test"
|
"go-mod.ewintr.nl/go-kit/test"
|
||||||
"code.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
"go-mod.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPost(t *testing.T) {
|
func TestPost(t *testing.T) {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/test"
|
"go-mod.ewintr.nl/go-kit/test"
|
||||||
"code.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
"go-mod.ewintr.nl/shitty-ssg/cmd/ssg/site"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPosts(t *testing.T) {
|
func TestPosts(t *testing.T) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
const dirMode = os.ModeDir | 0755
|
const dirMode = os.ModeDir | 0755
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package site
|
package site
|
||||||
|
|
||||||
import "code.ewintr.nl/shitty-ssg/pkg/adoc"
|
import "go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
SITE_CONFIG_EWNL = &SiteConfig{
|
SITE_CONFIG_EWNL = &SiteConfig{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
2020-12-01
|
2020-12-01
|
||||||
:tags: asciidoc, shitty-ssg, public, en
|
:tags: asciidoc, shitty-ssg, public, en
|
||||||
|
|
||||||
As promised in https://code.ewintr.nl/shitty-ssg/why-i-built-my-own-shitty-static-site-generator/[my earlier post] on why I decided to build my own Shitty Static Site Generator, I’ll explain the markup format that I use for the posts on this site. The goal was to find a subset of Asciidoc that would be easy to parse myself, but would still result in valid documents, so that they can be processed by all other tools that understand Asciidoc without any problem. For instance, I wanted the syntax coloring in my editor to ‘just work’.
|
As promised in https://forgejo.ewintr.nl/shitty-ssg/why-i-built-my-own-shitty-static-site-generator/[my earlier post] on why I decided to build my own Shitty Static Site Generator, I’ll explain the markup format that I use for the posts on this site. The goal was to find a subset of Asciidoc that would be easy to parse myself, but would still result in valid documents, so that they can be processed by all other tools that understand Asciidoc without any problem. For instance, I wanted the syntax coloring in my editor to ‘just work’.
|
||||||
|
|
||||||
In order to achieve that, I selected the following parts from the Asciidoc specification. They are categorized by the types of elements as they are used in a HTML page:
|
In order to achieve that, I selected the following parts from the Asciidoc specification. They are categorized by the types of elements as they are used in a HTML page:
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ In order to achieve that, I selected the following parts from the Asciidoc speci
|
||||||
|
|
||||||
Everything that is not described below will not work. I may add new stuff in the future, if I feel it is needed. If I do so, I will update this page.
|
Everything that is not described below will not work. I may add new stuff in the future, if I feel it is needed. If I do so, I will update this page.
|
||||||
|
|
||||||
The https://code.ewintr.nl/shitty-ssg/shitty-ssg-code-walkthrough/[code walkthrough] of the SSG contains a short description of how the parser works.
|
The https://forgejo.ewintr.nl/shitty-ssg/shitty-ssg-code-walkthrough/[code walkthrough] of the SSG contains a short description of how the parser works.
|
||||||
|
|
||||||
== Header
|
== Header
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
2021-03-09
|
2021-03-09
|
||||||
:tags: go, asciidoc, public, en
|
:tags: go, asciidoc, public, en
|
||||||
|
|
||||||
One would expect a walk through the code of a self proclaimed “shitty” software project not to be a pleasant read. I promise that it is not that bad. Earlier I https://code.ewintr.nl/shitty-ssg/why-i-built-my-own-shitty-static-site-generator/[described] why I built this static site generator and the https://code.ewintr.nl/shitty-ssg/a-tiny-subset-of-asciidoc-for-blogging/[Asciidoc subset] that it uses as a markup language. Here I will describe the code that transforms these documents into a website. Later I will go more into detail on how the flexibility of this generator is used to create and publish to multiple sites from multiple sources in one go.
|
One would expect a walk through the code of a self proclaimed “shitty” software project not to be a pleasant read. I promise that it is not that bad. Earlier I https://forgejo.ewintr.nl/shitty-ssg/why-i-built-my-own-shitty-static-site-generator/[described] why I built this static site generator and the https://forgejo.ewintr.nl/shitty-ssg/a-tiny-subset-of-asciidoc-for-blogging/[Asciidoc subset] that it uses as a markup language. Here I will describe the code that transforms these documents into a website. Later I will go more into detail on how the flexibility of this generator is used to create and publish to multiple sites from multiple sources in one go.
|
||||||
|
|
||||||
Originally I made the SSG to create one site. But it turned out to be not that hard to generalize it and now it generates:
|
Originally I made the SSG to create one site. But it turned out to be not that hard to generalize it and now it generates:
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ _Edit: I’ve changed some things since then, the domains above might not work a
|
||||||
|
|
||||||
In the future I might add an export for a Gopher or a Gemini site and if the collection of notes grows I’ll probably improve the search somewhat. Now it only finds notes on tags or whole words. It displays them just in plain text. I will also probably dive more into shell escape codes and such to see if the apperance can be improved.
|
In the future I might add an export for a Gopher or a Gemini site and if the collection of notes grows I’ll probably improve the search somewhat. Now it only finds notes on tags or whole words. It displays them just in plain text. I will also probably dive more into shell escape codes and such to see if the apperance can be improved.
|
||||||
|
|
||||||
The code itself can be found https://codeberg.org/ewintr/shitty-ssg[here].
|
The code itself can be found https://forgejo.ewintr.nl/ewintr/shitty-ssg[here].
|
||||||
|
|
||||||
== Directories
|
== Directories
|
||||||
|
|
||||||
|
|
|
@ -76,4 +76,4 @@ So, my advise is to be aware of the restrictions and the hidden models of the to
|
||||||
|
|
||||||
In the title, I mention that my generator is “shitty” and it is. It does not have many features. It is riddled with bugs and edge cases that it can’t handle. But that is not important. It works for my problem. If I don’t like something, I can fix it. If bug doesn’t bother me, I’ll let it be. Like all creative endevours, it is important to just start and get it out. You can always improve it later.
|
In the title, I mention that my generator is “shitty” and it is. It does not have many features. It is riddled with bugs and edge cases that it can’t handle. But that is not important. It works for my problem. If I don’t like something, I can fix it. If bug doesn’t bother me, I’ll let it be. Like all creative endevours, it is important to just start and get it out. You can always improve it later.
|
||||||
|
|
||||||
I put the source online https://codeberg.org/ewintr/shitty-ssg[here]. See https://code.ewintr.nl/shitty-ssg/shitty-ssg-code-walkthrough/[here] for a high level overview. Not for people to blindly copy and run (why would you?), but to give some inspiration for people who are still on the fence. To show them that shitty does not have to be hard and that it can be good enough, as long as it is the right kind of shitty. _Your_ kind of shitty.
|
I put the source online https://forgejo.ewintr.nl/ewintr/shitty-ssg[here]. See https://go-mod.ewintr.nl/shitty-ssg/shitty-ssg-code-walkthrough/[here] for a high level overview. Not for people to blindly copy and run (why would you?), but to give some inspiration for people who are still on the fence. To show them that shitty does not have to be hard and that it can be good enough, as long as it is the right kind of shitty. _Your_ kind of shitty.
|
||||||
|
|
9
go.mod
9
go.mod
|
@ -1,7 +1,8 @@
|
||||||
module code.ewintr.nl/shitty-ssg
|
module go-mod.ewintr.nl/shitty-ssg
|
||||||
|
|
||||||
go 1.21.5
|
go 1.21.5
|
||||||
|
|
||||||
require code.ewintr.nl/go-kit v0.0.0-20240308074309-a1328c3c44c6
|
require (
|
||||||
|
go-mod.ewintr.nl/go-kit v0.0.0-20240915084633-589e6c3a4b97 // indirect
|
||||||
require golang.org/x/text v0.14.0 // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
|
)
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -1,4 +1,4 @@
|
||||||
code.ewintr.nl/go-kit v0.0.0-20240308074309-a1328c3c44c6 h1:qZwAicZOd18o9qWCU3pSj/QnrSNLCAMAOPJvyLgBQ0U=
|
go-mod.ewintr.nl/go-kit v0.0.0-20240915084633-589e6c3a4b97 h1:vk8KmsDbJOYFD8JrYPRlJ44ll6H2JgiPcYrNZNJccj8=
|
||||||
code.ewintr.nl/go-kit v0.0.0-20240308074309-a1328c3c44c6/go.mod h1:Yk8Mdn1f4/L9tcymurtItqevVkac6P9ljh2Sd3T+FS8=
|
go-mod.ewintr.nl/go-kit v0.0.0-20240915084633-589e6c3a4b97/go.mod h1:JVAoSGJi3oLkkl+nGN0pqRjP6omkPfriCaT3CslW+Ok=
|
||||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||||
|
|
|
@ -3,8 +3,8 @@ package adoc_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/test"
|
"go-mod.ewintr.nl/go-kit/test"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewKind(t *testing.T) {
|
func TestNewKind(t *testing.T) {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package adoc_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/test"
|
"go-mod.ewintr.nl/go-kit/test"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParagraph(t *testing.T) {
|
func TestParagraph(t *testing.T) {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package adoc_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/test"
|
"go-mod.ewintr.nl/go-kit/test"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestInlineSimple(t *testing.T) {
|
func TestInlineSimple(t *testing.T) {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.ewintr.nl/go-kit/test"
|
"go-mod.ewintr.nl/go-kit/test"
|
||||||
"code.ewintr.nl/shitty-ssg/pkg/adoc"
|
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNew(t *testing.T) {
|
func TestNew(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue