diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/atom.xml | 48 | ||||
-rw-r--r-- | templates/error.templ | 4 | ||||
-rw-r--r-- | templates/feed.xml | 24 | ||||
-rw-r--r-- | templates/homepage.templ | 4 | ||||
-rw-r--r-- | templates/list.templ | 4 | ||||
-rw-r--r-- | templates/page.templ | 14 | ||||
-rw-r--r-- | templates/post.templ | 7 | ||||
-rw-r--r-- | templates/style.css | 15 | ||||
-rw-r--r-- | templates/tags.templ | 2 |
9 files changed, 26 insertions, 96 deletions
diff --git a/templates/atom.xml b/templates/atom.xml deleted file mode 100644 index 81c9a76..0000000 --- a/templates/atom.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?xml-stylesheet href="/feed-styles.xsl" type="text/xsl"?> -<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}"> - <title>{{ config.title }} - {%- if term %} - {{ term.name }} - {%- elif section.title %} - {{ section.title }} - {%- endif -%} - </title> - {%- if config.description %} - <subtitle>{{ config.description }}</subtitle> - {%- endif %} - <link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/> - <link href=" - {%- if section -%} - {{ section.permalink | escape_xml | safe }} - {%- else -%} - {{ config.base_url | escape_xml | safe }} - {%- endif -%} - "/> - <generator uri="https://www.getzola.org/">Zola</generator> - <updated>{{ last_updated | date(format="%+") }}</updated> - <id>{{ feed_url | safe }}</id> - {%- for page in pages %} - <entry xml:lang="{{ page.lang }}"> - <title>{{ page.title }}</title> - <published>{{ page.date | date(format="%+") }}</published> - <updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated> - <author> - <name> - {%- if page.authors -%} - {{ page.authors[0] }} - {%- elif config.author -%} - {{ config.author }} - {%- else -%} - Unknown - {%- endif -%} - </name> - </author> - <link rel="alternate" href="{{ page.permalink | safe }}" type="text/html"/> - <id>{{ page.permalink | safe }}</id> - {% if page.summary %} - <summary type="html">{{ page.summary }}</summary> - {% else %} - <content type="html">{{ page.content }}</content> - {% endif %} - </entry> - {%- endfor %} -</feed> diff --git a/templates/error.templ b/templates/error.templ index c336ea9..369cb83 100644 --- a/templates/error.templ +++ b/templates/error.templ @@ -1,8 +1,8 @@ package templates import ( - "website/internal/config" - "website/internal/http" + "go.alanpearce.eu/website/internal/config" + "go.alanpearce.eu/website/internal/http" "strconv" ) diff --git a/templates/feed.xml b/templates/feed.xml deleted file mode 100644 index ddc90dd..0000000 --- a/templates/feed.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<?xml-stylesheet href="/feed-styles.xsl" type="text/xsl"?> -<feed xmlns="http://www.w3.org/2005/Atom"> - <title>Example Feed</title> - <link href="http://example.org/"></link> - <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id> - <updated>2003-12-13T18:30:02Z</updated> - <entry> - <title>Atom-Powered Robots Run Amok</title> - <link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"></link> - <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> - <updated>2003-12-13T18:30:02Z</updated> - <summary>Some text.</summary> - <content type="html"> - <div> - <p>This is the entry content.</p> - </div> - </content> - <author> - <name>John Doe</name> - </author> - </entry> - -</feed> diff --git a/templates/homepage.templ b/templates/homepage.templ index 611a8ff..aa61c40 100644 --- a/templates/homepage.templ +++ b/templates/homepage.templ @@ -1,8 +1,8 @@ package templates import ( - "website/internal/config" - "website/internal/content" + "go.alanpearce.eu/website/internal/config" + "go.alanpearce.eu/website/internal/content" ) templ Homepage(config *config.Config, posts []content.Post, content string) { diff --git a/templates/list.templ b/templates/list.templ index 94ccf5a..fc59677 100644 --- a/templates/list.templ +++ b/templates/list.templ @@ -1,8 +1,8 @@ package templates import ( - "website/internal/config" - "website/internal/content" + "go.alanpearce.eu/website/internal/config" + "go.alanpearce.eu/website/internal/content" ) templ TagPage(config *config.Config, tag string, posts []content.Post, path string) { diff --git a/templates/page.templ b/templates/page.templ index cf08817..294b73e 100644 --- a/templates/page.templ +++ b/templates/page.templ @@ -1,9 +1,11 @@ package templates import ( + "context" + "go.alanpearce.eu/website/internal/config" + "io" "io/fs" - - "website/internal/config" + "net/url" ) var ( @@ -86,8 +88,12 @@ templ Page(site *config.Config, page PageSettings) { </html> } -func mkURL(u config.URL, path string, title string) string { - q := u.Query() +func mkURL(original config.URL, path string, title string) string { + ou := *original.URL + u := config.URL{ + URL: &ou, + } + q := url.Values{} q.Add("p", path) q.Add("t", title) u.RawQuery = q.Encode() diff --git a/templates/post.templ b/templates/post.templ index c432e57..1a5495c 100644 --- a/templates/post.templ +++ b/templates/post.templ @@ -1,9 +1,12 @@ package templates import ( + "context" + "io" "time" - "website/internal/config" - "website/internal/content" + + "go.alanpearce.eu/website/internal/config" + "go.alanpearce.eu/website/internal/content" ) func Unsafe(html string) templ.Component { diff --git a/templates/style.css b/templates/style.css index 89fd58f..e9a2955 100644 --- a/templates/style.css +++ b/templates/style.css @@ -11,7 +11,6 @@ --code-background-color: #f2f2f2; --code-color: #222; --blockquote-color: #222; - --icon-external-link: url("/external-link.svg"); } @media (prefers-color-scheme: dark) { @@ -189,13 +188,13 @@ ul.h-feed li a:visited { .tags { font-size: small; -} - -.p-categories, -ul.tags { display: inline-block; padding-inline-start: 0; } +.p-categories { + padding-inline-start: 1ex; +} + .tags li { list-style: none; display: inline-block; @@ -206,9 +205,3 @@ svg.rss-icon { height: 1.5ex; width: 1.5ex; } - -a[target="_blank"]::after { - content: ""; - background: no-repeat var(--icon-external-link); - padding-right: 1em; -} diff --git a/templates/tags.templ b/templates/tags.templ index 5e9878a..c872a0d 100644 --- a/templates/tags.templ +++ b/templates/tags.templ @@ -1,6 +1,6 @@ package templates -import "website/internal/config" +import "go.alanpearce.eu/website/internal/config" templ tagLink(tag string, attrs templ.Attributes) { <a { attrs... } href={ templ.SafeURL("/tags/" + tag) }>#{ tag }</a> |