-
-
Notifications
You must be signed in to change notification settings - Fork 71
Add more about:
pages
#187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I believe inlining is a better way to go. This is already being done for the default config: Ideally the inlining would happen with the stdlib embed package, but that's only going to be available in Go 1.16. There are other Go inlining solutions, like go-bindata. That method has a question. Do I check in the generated code, and tell other developers to regenerate it if they need? Or do I add it as a build step in the Makefile? The latter is nicer, but then all the repo packages that don't use the Makefile, just the custom I'm not sure what the best solution is. What do you think? |
Generally, I don't like to inline stuff like that but I guess it's the Go way of doing things... I didn't know about
So: For now, I will update this PR to just inline |
2b6ecbf
to
6050713
Compare
I inlined the files in the same manner as you did it for the default config. |
You're right, it's just the same. Not sure what I was getting at.
Thanks!
Unfortunately that's not an option, as I like to support some of the slightly older versions of Go, as I believe many people compile Amfora themselves, and will not always have the latest version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple things.
Your page functions re-render and create a new page every time. This is inefficient. If you look at how the existing non-dynamic pages are done, they are rendered once at start-up and cached. This is how all these pages should be done as well. There likely needs to be some higher-level functions created and/or some refactoring so they don't all start clouding up display.Init
.
Your inlined files need to have //go:generate
directives like default.go
does, so that running go generate ./...
at the project root will update all the inlined data files.
Thanks!
Ah, ok, I was slightly confused about the Sorry! You're right of course, the about pages were unnecessarily recreated. I fixed that and moved the creation code to a separate file (and added the version page to that as well). In Anything else? |
It means that running
It still doesn't work actually. I fixed it though, see 819a6cf. The way you create about pages seems very clean. Thanks for your work! Merged, with some of my own small fixes. |
This implements #160.
I was not sure about how to include the THANKS and LICENSE information, so I'd like feedback on the proposed implementation.
I did not want to inline the text, but instead read it from a file at runtime. The exact file paths to content like LICENSE should (I think) be up to the packager/self-compiling user, so I added build flags to pass in the paths (via
ldflags
just like the version information). The default values I use, are reasonable paths for Arch and Void Linux as far as I can tell.Possible improvements:
Alternatively, the content could all be inlined of course... Thoughts?