appview/pages: fix terms and privacy pages #608

merged
opened by oppi.li targeting master from push-wzkqymznotmx
Changed files
+20 -6
appview
+1 -1
legal/privacy.md appview/pages/legal/privacy.md
···
# Privacy Policy
-
**Last updated:** January 15, 2025
+
**Last updated:** September 26, 2025
This Privacy Policy describes how Tangled ("we," "us," or "our")
collects, uses, and shares your personal information when you use our
+2 -2
legal/terms.md appview/pages/legal/terms.md
···
# Terms of Service
-
**Last updated:** January 15, 2025
+
**Last updated:** September 26, 2025
Welcome to Tangled. These Terms of Service ("Terms") govern your access
to and use of the Tangled platform and services (the "Service")
···
These terms are effective as of the last updated date shown above and
will remain in effect except with respect to any changes in their
provisions in the future, which will be in effect immediately after
-
being posted on this page.
+
being posted on this page.
+17 -3
appview/pages/pages.go
···
"github.com/go-git/go-git/v5/plumbing/object"
)
-
//go:embed templates/* static
+
//go:embed templates/* static legal
var Files embed.FS
type Pages struct {
···
func (p *Pages) TermsOfService(w io.Writer, params TermsOfServiceParams) error {
filename := "terms.md"
filePath := filepath.Join("legal", filename)
-
markdownBytes, err := os.ReadFile(filePath)
+
+
file, err := p.embedFS.Open(filePath)
+
if err != nil {
+
return fmt.Errorf("failed to read %s: %w", filename, err)
+
}
+
defer file.Close()
+
+
markdownBytes, err := io.ReadAll(file)
if err != nil {
return fmt.Errorf("failed to read %s: %w", filename, err)
}
···
func (p *Pages) PrivacyPolicy(w io.Writer, params PrivacyPolicyParams) error {
filename := "privacy.md"
filePath := filepath.Join("legal", filename)
-
markdownBytes, err := os.ReadFile(filePath)
+
+
file, err := p.embedFS.Open(filePath)
+
if err != nil {
+
return fmt.Errorf("failed to read %s: %w", filename, err)
+
}
+
defer file.Close()
+
+
markdownBytes, err := io.ReadAll(file)
if err != nil {
return fmt.Errorf("failed to read %s: %w", filename, err)
}