cmd/site: ignore url params
This commit is contained in:
parent
cbfa82218c
commit
8ff1e285d8
|
@ -7,13 +7,12 @@ RUN CGO_ENABLED=0 GOBIN=/root go install -v ./cmd/site
|
||||||
FROM xena/alpine
|
FROM xena/alpine
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
RUN apk add --no-cache bash
|
RUN apk add --no-cache bash
|
||||||
COPY --from=build /root/site /site/site
|
WORKDIR /site
|
||||||
|
COPY --from=build /root/site .
|
||||||
COPY ./static /site/static
|
COPY ./static /site/static
|
||||||
COPY ./templates /site/templates
|
COPY ./templates /site/templates
|
||||||
COPY ./blog /site/blog
|
COPY ./blog /site/blog
|
||||||
COPY ./css /site/css
|
COPY ./css /site/css
|
||||||
COPY ./run.sh /site/run.sh
|
|
||||||
COPY ./app /app
|
COPY ./app /app
|
||||||
|
|
||||||
HEALTHCHECK CMD wget --spider http://127.0.0.1:5000 || exit 1
|
HEALTHCHECK CMD wget --spider http://127.0.0.1:5000 || exit 1
|
||||||
CMD /site/run.sh
|
CMD ./site
|
||||||
|
|
|
@ -56,9 +56,10 @@ func (s *Site) showPost(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmp := r.URL.Path[1:]
|
||||||
var p *Post
|
var p *Post
|
||||||
for _, pst := range s.Posts {
|
for _, pst := range s.Posts {
|
||||||
if pst.Link == r.RequestURI[1:] {
|
if pst.Link == cmp {
|
||||||
p = pst
|
p = pst
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue