~ritho/rweb

4bd76a7e49e68a52c2318c17be9fb525a21f9c27 — Ritho 2 months ago 831ca19 main v1.0.10
Add the url to the header.

Signed-off-by: Ritho <palvarez@ritho.net>
M debian/changelog => debian/changelog +4 -0
@@ 1,3 1,7 @@
web (1.0.10) unstable; urgency=low

  * Add the url to the header template.

web (1.0.9) unstable; urgency=low

  * Update the go dependencies and improve the html templates.

M internal/engine/pages/blog/blog.go => internal/engine/pages/blog/blog.go +10 -1
@@ 203,7 203,7 @@ func (b *Blog) Render() (string, error) {
			Title:       b.cfg.Title,
			Description: b.cfg.Description,
			CSS:         b.section.CSS,
			URL:         b.srv.Domain,
			URL:         b.url(),
		},
		Header: content.Header{
			Title:    b.section.Title,


@@ 224,3 224,12 @@ func (b *Blog) Render() (string, error) {

	return content.String(), err
}

func (b *Blog) url() string {
	u := fmt.Sprintf("http://%s", b.srv.Domain)
	if b.srv.TLS {
		u = fmt.Sprintf("https://%s", b.srv.Domain)
	}

	return u
}

M internal/engine/pages/projects/projects.go => internal/engine/pages/projects/projects.go +11 -1
@@ 21,6 21,7 @@ package projects

import (
	"bytes"
	"fmt"
	"html/template"
	"log/slog"
	"path/filepath"


@@ 149,7 150,7 @@ func (s *Static) Render() (string, error) {
			Title:       s.cfg.Title,
			Description: s.cfg.Description,
			CSS:         s.section.CSS,
			URL:         s.srv.Domain,
			URL:         s.url(),
		},
		Header: content.Header{
			Title:    s.section.Title,


@@ 170,3 171,12 @@ func (s *Static) Render() (string, error) {

	return content.String(), err
}

func (s *Static) url() string {
	u := fmt.Sprintf("http://%s", s.srv.Domain)
	if s.srv.TLS {
		u = fmt.Sprintf("https://%s", s.srv.Domain)
	}

	return u
}

M internal/engine/pages/static/static.go => internal/engine/pages/static/static.go +10 -0
@@ 126,6 126,7 @@ func (s *Static) Render() (string, error) {
			Title:       s.cfg.Title,
			Description: s.cfg.Description,
			CSS:         s.section.CSS,
			URL:         s.url(),
		},
		Header: content.Header{
			Title:    s.section.Title,


@@ 146,3 147,12 @@ func (s *Static) Render() (string, error) {

	return content.String(), err
}

func (s *Static) url() string {
	u := fmt.Sprintf("http://%s", s.srv.Domain)
	if s.srv.TLS {
		u = fmt.Sprintf("https://%s", s.srv.Domain)
	}

	return u
}