Skip to content

Conversation

@TomFreudenberg
Copy link
Contributor

@TomFreudenberg TomFreudenberg commented Apr 25, 2021

This feature enables to create a template file named
navmenu.html optionally.

If this exists, it will be included into the menu div and
allows to extend the navigation for some custom
stativ pages.

Also, if that file exists, there is no default redirect
from "/" to "/pkg/" anymore. If you have "enabled"
custom navigation it is also possible to create a
custom index page.

This patch enables the godoc server to be a full customizable
documentation site of go projects.

PR #309 should be applied in addition so that only partial
overload of templates is necessary.

Example:

file: templates/navmenu.html
<a id="docButton" href="/doc/" title="General documentation">Documentation</a> <a id="cmdButton" href="/cmd/" title="Show commands">Commands</a> <a id="pkgButton" href="/pkg/" title="Show packages">Packages</a> <a id="srcButton" href="/src/" title="Show sources">Sources</a> <a id="aboutGoButton" href="/about-go/" title="About go">Go</a> <a id="helpButton" href="/help/" title="Show general help">Help</a>
file: doc/help.html
<!--{ "Title": "Help", "Path": "/help/" }--> <div id="manual-nav"></div> <h2 id="home">Project information</h2> <p> Find out more about the project at <a href="/">root home</a>. </p> <h2 id="help">Get help</h2> <p> Put in some more help. </p>

This will look like:

grafik

This feature enables to create a template file named navmenu.html optionally. If this exists, it will included into the menu div and allows to extend the navigation for some custom stativ pages. Also if exist, there is no redirect from "/" to "/pkg/" anymore. In case of this also a custom index page could be created. This patch enables the godoc server to a full customizable documentation site of go projects. PR golang#309 should be applied in addition so that only partial overload of templates is necessary.
@google-cla google-cla bot added the cla: yes label Apr 25, 2021
</div><!-- #lowframe -->

<div id="topbar"{{if .Title}} class="wide"{{end}}><div class="container">
<div class="top-heading" id="heading-wide"><a href="/pkg/">Go Documentation Server</a></div>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/pkg/ is not necessary in any case because / is already redirected by handler

@gopherbot
Copy link
Contributor

This PR (HEAD: 9a3b682) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/313095 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@TomFreudenberg TomFreudenberg changed the title allow customized menu and navigation godoc: allow customized menu and navigation Apr 27, 2021
@TomFreudenberg TomFreudenberg changed the title godoc: allow customized menu and navigation godoc/server: allow customized menu and navigation Apr 27, 2021
@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tom Thomas Freudenberg:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tom Thomas Freudenberg:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tom Freudenberg:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tom Freudenberg:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 42f38a8) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/313095 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tom Freudenberg:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tom Freudenberg:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/313095.
After addressing review feedback, remember to publish your drafts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants