Compare commits

..

No commits in common. "7d48d2abba46570ad67fa9f4b8c0b4e023fc2eed" and "80c1631bdd214fc29daf3cd9685ae4afa34b13fe" have entirely different histories.

6 changed files with 4 additions and 36 deletions

View File

@ -161,18 +161,6 @@ func indexMiddleware(h gemini.Handler) gemini.Handler {
}) })
} }
func feedMiddleware(h gemini.Handler) gemini.Handler {
return gemini.HandlerFunc(func(
ctx context.Context,
rw gemini.ResponseWriter,
r *gemini.Request,
) {
rw = forceResponseWriterMediaType(rw, "application/atom+xml")
h.ServeGemini(ctx, rw, r)
})
}
func postsMiddleware(tplHandler gemini.Handler) gemini.Handler { func postsMiddleware(tplHandler gemini.Handler) gemini.Handler {
return gemini.HandlerFunc(func( return gemini.HandlerFunc(func(
@ -240,7 +228,6 @@ func (a *api) handler() (gemini.Handler, error) {
mux := new(gemini.Mux) mux := new(gemini.Mux)
mux.Handle("/posts/", postsMiddleware(tplHandler)) mux.Handle("/posts/", postsMiddleware(tplHandler))
mux.Handle("/assets/", a.assetsMiddleware()) mux.Handle("/assets/", a.assetsMiddleware())
mux.Handle("/feed.xml", feedMiddleware(tplHandler))
mux.Handle("/", tplHandler) mux.Handle("/", tplHandler)
var h gemini.Handler var h gemini.Handler

View File

@ -5,6 +5,4 @@
{{ end -}} {{ end -}}
=> https://code.betamike.com/mediocregopher/mediocre-blog Source
=> {{ BlogURL "wtfpl.txt" }} License for all content, if you must have one => {{ BlogURL "wtfpl.txt" }} License for all content, if you must have one

View File

@ -3,7 +3,8 @@
{{ $page := .GetQueryIntValue "page" 0 -}} {{ $page := .GetQueryIntValue "page" 0 -}}
{{ if eq $page 0 -}} {{ if eq $page 0 -}}
Here you'll find an archive of all published posts. The content varies almost as much as the quality! Here you'll find an archive of all published posts. The content varies almost as
much as the quality!
{{ end -}} {{ end -}}

View File

@ -1,7 +1,8 @@
{{ $post := .GetPostByID (.GetQueryValue "id" "") -}} {{ $post := .GetPostByID (.GetQueryValue "id" "") -}}
{{ if eq $post.Format "md" -}} {{ if eq $post.Format "md" -}}
This post has been translated from it's original markdown format, if it seems busted it might appear better over HTTP: This post has been translated from it's original markdown format, if it seems
busted it might appear better over HTTP:
=> {{ PostHTTPURL $post.ID }} => {{ PostHTTPURL $post.ID }}

View File

@ -1,17 +0,0 @@
package gmi
import "git.sr.ht/~adnano/go-gemini"
type rwSetMediaTypeNoop struct {
gemini.ResponseWriter
}
func (rwSetMediaTypeNoop) SetMediaType(string) {}
func forceResponseWriterMediaType(
rw gemini.ResponseWriter, mediaType string,
) gemini.ResponseWriter {
rw.SetMediaType(mediaType)
return rwSetMediaTypeNoop{rw}
}

View File

@ -114,8 +114,6 @@
 /   / 
<a href="{{ BlogURL "feed.xml" }}">RSS</a> <a href="{{ BlogURL "feed.xml" }}">RSS</a>
&nbsp;//&nbsp; &nbsp;//&nbsp;
<a href="https://code.betamike.com/mediocregopher/mediocre-blog">Source</a>
&nbsp;/&nbsp;
<a href="{{ StaticURL "wtfpl.txt" }}">License</a> <a href="{{ StaticURL "wtfpl.txt" }}">License</a>
</header> </header>