diff --git a/public/parsing.wasm b/public/parsing.wasm index bda6c88..4301d11 100755 Binary files a/public/parsing.wasm and b/public/parsing.wasm differ diff --git a/public/style.css b/public/style.css index b681eeb..e5ca63e 100644 --- a/public/style.css +++ b/public/style.css @@ -1176,7 +1176,7 @@ img, video { .br2, .post-content code, .post-content pre > code, .post-content pre.hmn-code { border-radius: 0.25rem; } -.br3 { +.br3, .edu-resource { border-radius: 0.5rem; } .br4 { @@ -4602,7 +4602,7 @@ code, .code { .pa2, .tab, header .root-item > a, header .submenu > a { padding: 0.5rem; } -.pa3, header #login-popup { +.pa3, .edu-resource, header #login-popup { padding: 1rem; } .pa4 { @@ -7426,7 +7426,7 @@ article code { border-color: #ccc; border-color: var(--theme-color-dimmest); } -.bg--dim, .post-content code, .post-content pre > code, .post-content pre.hmn-code { +.bg--dim, .post-content code, .post-content pre > code, .post-content pre.hmn-code, .edu-resource { background-color: #f0f0f0; background-color: var(--dim-background); } diff --git a/src/parsing/ggcode.go b/src/parsing/ggcode.go index 405ec80..19b591e 100644 --- a/src/parsing/ggcode.go +++ b/src/parsing/ggcode.go @@ -6,6 +6,7 @@ import ( "regexp" "git.handmade.network/hmn/hmn/src/hmnurl" + "git.handmade.network/hmn/hmn/src/utils" "github.com/yuin/goldmark" "github.com/yuin/goldmark/ast" gast "github.com/yuin/goldmark/ast" @@ -55,9 +56,10 @@ var ggcodeTags = map[string]ggcodeRenderer{ }, "resource": func(w util.BufWriter, n *ggcodeNode, entering bool) error { if entering { - w.WriteString("a node :o") + w.WriteString(`
`) + w.WriteString(fmt.Sprintf(`

%s

`, n.Args["url"], utils.OrDefault(n.Args["name"], "[missing `name`]"))) } else { - w.WriteString("bai") + w.WriteString("
") } return nil }, diff --git a/src/rawdata/scss/_education.scss b/src/rawdata/scss/_education.scss new file mode 100644 index 0000000..13ef1ac --- /dev/null +++ b/src/rawdata/scss/_education.scss @@ -0,0 +1,3 @@ +.edu-resource { + @extend .pa3, .bg--dim, .br3; +} diff --git a/src/rawdata/scss/style.scss b/src/rawdata/scss/style.scss index 461ec3a..6470c91 100644 --- a/src/rawdata/scss/style.scss +++ b/src/rawdata/scss/style.scss @@ -12,6 +12,7 @@ @import 'content'; @import 'editor'; @import 'episodes'; +@import 'education'; @import 'forms'; @import 'forum'; @import 'header'; diff --git a/src/templates/src/education_article.html b/src/templates/src/education_article.html index cb9cf88..d06a546 100644 --- a/src/templates/src/education_article.html +++ b/src/templates/src/education_article.html @@ -2,7 +2,7 @@ {{ define "content" }}

{{ .Title }}

- {{ if .User.IsEduAuthor }} + {{ if and .User .User.IsEduAuthor }}
✎ Edit ✖ Delete