moved website content to root
This commit is contained in:
@@ -18,7 +18,7 @@ import (
|
||||
// GET /
|
||||
// compiles the page template or component template matching the url
|
||||
func (s *Server) serveTemplates(r *http.Request) (response.Response, error) {
|
||||
name, args := s.getTemplateNameAndArgs(r, "internal/site/templates/component_bodies")
|
||||
name, args := s.getTemplateNameAndArgs(r, s.contentDir+"/templates/component_bodies")
|
||||
|
||||
b, err := s.templater.ExecuteComponentBody(name, args...)
|
||||
if err == nil {
|
||||
@@ -29,7 +29,7 @@ func (s *Server) serveTemplates(r *http.Request) (response.Response, error) {
|
||||
return s.handleTemplateError(err, args...)
|
||||
}
|
||||
|
||||
name, args = s.getTemplateNameAndArgs(r, "internal/site/templates/page_bodies")
|
||||
name, args = s.getTemplateNameAndArgs(r, s.contentDir+"/templates/page_bodies")
|
||||
|
||||
if b, err = s.templater.ExecutePage(name, args...); err == nil {
|
||||
return response.HTML(b), nil
|
||||
@@ -79,6 +79,7 @@ func (s *Server) getTemplateNameAndArgs(r *http.Request, templateDir string) (na
|
||||
// getComponentTemplateNameForURL eliminate any trailing .html or /, and checks for any
|
||||
// file with path parameters in the name, eg '{abc}.html.tmpl', prefering exact filename matches.
|
||||
func getTemplateNameForURL(u *url.URL, templateDir string) (name string, params map[string]string) {
|
||||
templateDir = path.Clean(templateDir)
|
||||
fp := strings.TrimPrefix(strings.TrimSuffix(strings.TrimSuffix(u.Path, ".html"), "/"), "/")
|
||||
if fp == "" {
|
||||
// "/" maps to "/index"
|
||||
|
||||
@@ -142,8 +142,7 @@ func runServer(ctx context.Context, logger *slog.Logger, connPool *pgxpool.Pool,
|
||||
Addr: ":8082", // local
|
||||
Handler: server.NewServer(
|
||||
logger.WithGroup("server"),
|
||||
// TODO: consider moving the templates up to a higher level...
|
||||
"./internal/server",
|
||||
"./",
|
||||
raw_events.NewStore(logger.WithGroup("raw-event-store"), connPool),
|
||||
accounts.NewStore(logger, connPool),
|
||||
etsy_platform.NewPlatform(
|
||||
|
||||
@@ -174,6 +174,15 @@
|
||||
}
|
||||
}
|
||||
@layer utilities {
|
||||
.visible {
|
||||
visibility: visible;
|
||||
}
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
.static {
|
||||
position: static;
|
||||
}
|
||||
.mt-\[1em\] {
|
||||
margin-top: 1em;
|
||||
}
|
||||
@@ -192,9 +201,15 @@
|
||||
.block {
|
||||
display: block;
|
||||
}
|
||||
.contents {
|
||||
display: contents;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.table {
|
||||
display: table;
|
||||
}
|
||||
@@ -302,9 +317,15 @@
|
||||
.text-nowrap {
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
.underline {
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
.filter {
|
||||
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
||||
}
|
||||
.hover\:bg-accent {
|
||||
&:hover {
|
||||
@media (hover: hover) {
|
||||
@@ -655,11 +676,77 @@
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-blur {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-brightness {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-contrast {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-grayscale {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-hue-rotate {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-invert {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-opacity {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-saturate {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-sepia {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-drop-shadow {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-drop-shadow-color {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@property --tw-drop-shadow-alpha {
|
||||
syntax: "<percentage>";
|
||||
inherits: false;
|
||||
initial-value: 100%;
|
||||
}
|
||||
@property --tw-drop-shadow-size {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
@layer properties {
|
||||
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
||||
*, ::before, ::after, ::backdrop {
|
||||
--tw-border-style: solid;
|
||||
--tw-font-weight: initial;
|
||||
--tw-blur: initial;
|
||||
--tw-brightness: initial;
|
||||
--tw-contrast: initial;
|
||||
--tw-grayscale: initial;
|
||||
--tw-hue-rotate: initial;
|
||||
--tw-invert: initial;
|
||||
--tw-opacity: initial;
|
||||
--tw-saturate: initial;
|
||||
--tw-sepia: initial;
|
||||
--tw-drop-shadow: initial;
|
||||
--tw-drop-shadow-color: initial;
|
||||
--tw-drop-shadow-alpha: 100%;
|
||||
--tw-drop-shadow-size: initial;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
npx @tailwindcss/cli -i styles/source.css -o styles/index.css --cwd ./internal/site --watch
|
||||
npx @tailwindcss/cli -i styles/source.css -o styles/index.css --watch
|
||||
|
||||
Reference in New Issue
Block a user