Stream: docs

Topic: no home button, navbar, prev/next buttons


view this post on Zulip Philip Durbin ๐Ÿš€ (Oct 19 2024 at 15:35):

As discussed in some of our meetings, there's no home button in the guides. I created an issue for this: #10941

view this post on Zulip Philip Durbin ๐Ÿš€ (Oct 19 2024 at 15:37):

There are a few ways we can attack this problem. I just create pull request #10942 where I'm completely removing our custom navbar. It changes the navbar quite significantly. I put "before" and "after" screenshots in the pull request. You can play with a live version at https://dataverse-guide--10942.org.readthedocs.build/en/10942/ . I'm curious to hear what you think! :grinning:

view this post on Zulip Dieuwertje Bloemen (Oct 24 2024 at 09:00):

Looks great. If you click on Dataverse at the top left there, you then go to the 'home' page of the guides, right? I feel like maybe a way to get back to the Dataverse project page is missing though. Maybe a "more about Dataverse" in the navbar or an "About Dataverse" next to "Source"

view this post on Zulip Philip Durbin ๐Ÿš€ (Oct 24 2024 at 11:01):

It's easy to add more stuff to the nav bar. Here's where I removed a link to an ancient version of Dataverse (3.6.2): https://github.com/IQSS/dataverse/pull/10942/commits/5f308cd675de1e9a532718729bdcd891c907035a

view this post on Zulip Philip Durbin ๐Ÿš€ (Oct 24 2024 at 20:55):

Ok, I added "About Dataverse" in this commit: https://github.com/IQSS/dataverse/pull/10942/commits/5c5812e9404633628bce9eb9d76fa495737a00df

view this post on Zulip Philip Durbin ๐Ÿš€ (Oct 24 2024 at 20:56):

If you refresh https://dataverse-guide--10942.org.readthedocs.build/en/10942/ you should see it

view this post on Zulip Dieuwertje Bloemen (Oct 25 2024 at 15:04):

looks great!

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 21 2025 at 15:25):

@Omer M Fahim when you get a chance, please take a look at the screenshots at #10942 and play around at https://dataverse-guide--10942.org.readthedocs.build/en/10942/

This is the pull request we touched on briefly during the #docs meeting today.

I see @Dieuwertje Bloemen just approved it. :big_smile:

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 21 2025 at 16:08):

I just left a comment and put it on the board.

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 21 2025 at 16:31):

I figured out how to change the buttons to just "Next" and "Previous" (instead of page titles) if we like that better.

Screenshot 2025-03-21 at 12.30.43โ€ฏPM.png

% git diff
diff --git a/doc/sphinx_bootstrap_theme/bootstrap/relations.html b/doc/sphinx_bootstrap_theme/bootstrap/relations.html
index 7bdc8f1f91..dd41e8dd75 100755
--- a/doc/sphinx_bootstrap_theme/bootstrap/relations.html
+++ b/doc/sphinx_bootstrap_theme/bootstrap/relations.html
@@ -4,7 +4,7 @@
     <a href="{{ prev.link|e }}" title="{{ _('Previous Chapter: ') + prev.title|striptags }}">
       {%- if theme_bootstrap_version == "2" -%}<span class="icon-chevron-left visible-tablet"></span>{%- endif -%}
       {%- if theme_bootstrap_version == "3" -%}<span class="glyphicon glyphicon-chevron-left visible-sm"></span>{%- endif -%}
-      <span class="hidden-sm hidden-tablet">{{ "&laquo;"|safe }} {{ prev.title|striptags|truncate(length=16, killwords=True) }}</span>
+      <span class="hidden-sm hidden-tablet">{{ "&laquo;Prev"|safe }}</span>
     </a>
   </li>
 {%- endif %}
@@ -13,7 +13,7 @@
     <a href="{{ next.link|e }}" title="{{ _('Next Chapter: ') + next.title|striptags }}">
       {%- if theme_bootstrap_version == "2" -%}<span class="icon-chevron-right visible-tablet"></span>{%- endif -%}
       {%- if theme_bootstrap_version == "3" -%}<span class="glyphicon glyphicon-chevron-right visible-sm"></span>{%- endif -%}
-      <span class="hidden-sm hidden-tablet">{{ next.title|striptags|truncate(length=16, killwords=True) }} {{ "&raquo;"|safe }}</span>
+      <span class="hidden-sm hidden-tablet">{{ "Next&raquo"|safe }}</span>
     </a>
   </li>
 {%- endif %}

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 21 2025 at 18:06):

We can remove the "Page" link by commenting it out, like this:

% git diff ../sphinx_bootstrap_theme/bootstrap/navbartoc.html
diff --git a/doc/sphinx_bootstrap_theme/bootstrap/navbartoc.html b/doc/sphinx_bootstrap_theme/bootstrap/navbartoc.html
index 8def043a6f..42f11acf32 100755
--- a/doc/sphinx_bootstrap_theme/bootstrap/navbartoc.html
+++ b/doc/sphinx_bootstrap_theme/bootstrap/navbartoc.html
@@ -1,9 +1,11 @@
 <li class="dropdown">
+<!--
   <a role="button"
      id="dLabelLocalToc"
      data-toggle="dropdown"
      data-target="#"
      href="#">{{ _(theme_navbar_pagenav_name) }} <b class="caret"></b></a>
+-->
   <ul class="dropdown-menu localtoc"
       role="menu"
       aria-labelledby="dLabelLocalToc">{{ toc }}</ul>

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 21 2025 at 18:09):

Similarly, we can get rid of "Site" by commenting it out of ../sphinx_bootstrap_theme/bootstrap/globaltoc.html

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 21 2025 at 18:21):

We can put "Next" and "Previous" links at the bottom of the page (better than in the nav bar, I think) like this:

% git diff ../sphinx_bootstrap_theme/bootstrap/layout.html
diff --git a/doc/sphinx_bootstrap_theme/bootstrap/layout.html b/doc/sphinx_bootstrap_theme/bootstrap/layout.html
index d3ccd46381..a4a8016c95 100755
--- a/doc/sphinx_bootstrap_theme/bootstrap/layout.html
+++ b/doc/sphinx_bootstrap_theme/bootstrap/layout.html
@@ -86,6 +86,22 @@
     {%- block sidebar1 %}{{ bsidebar() }}{% endblock %}
     <div class="{{ bs_span_prefix }}{{ bs_content_width }} content" role="main">
       {% block body %}{% endblock %}
+
+{%- if prev %}
+    <a href="{{ prev.link|e }}" title="{{ _('Previous Chapter: ') + prev.title|striptags }}">
+      {%- if theme_bootstrap_version == "2" -%}<span class="icon-chevron-left visible-tablet"></span>{%- endif -%}
+      {%- if theme_bootstrap_version == "3" -%}<span class="glyphicon glyphicon-chevron-left visible-sm"></span>{%- endif -%}
+      <span class="hidden-sm hidden-tablet">{{ "&laquo;Prev"|safe }}</span>
+    </a>
+{%- endif %}
+{%- if next %}
+    <a href="{{ next.link|e }}" title="{{ _('Next Chapter: ') + next.title|striptags }}">
+      {%- if theme_bootstrap_version == "2" -%}<span class="icon-chevron-right visible-tablet"></span>{%- endif -%}
+      {%- if theme_bootstrap_version == "3" -%}<span class="glyphicon glyphicon-chevron-right visible-sm"></span>{%- endif -%}
+      <span class="hidden-sm hidden-tablet">{{ "Next&raquo"|safe }}</span>
+    </a>
+{%- endif %}
+
     </div>
     {% block sidebar2 %} {# possible location for sidebar #} {% endblock %}
   </div>

view this post on Zulip Dieuwertje Bloemen (Mar 24 2025 at 15:25):

I would go with 'next' & 'previous' instead of the page titles, and without the 'page' link in general, as I'm not really sure what it really contains. 'Site' doesn't bother me too much, as it might be useful to some.

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 24 2025 at 15:27):

@Dieuwertje Bloemen like this?

Screenshot 2025-03-24 at 11-27-15 User Guide โ€” Dataverse.org.png

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 24 2025 at 15:28):

Oh, one other change I made that you can see above is that I'm linking "v6.6" to the page that lists all the versions.

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 24 2025 at 15:29):

@Omer M Fahim by the way, I put PR #10942 into "in review" and assigned it to the two of us so we can decide when to merge it, once we've gathered feedback.

view this post on Zulip Dieuwertje Bloemen (Mar 24 2025 at 15:48):

Yeah, that set up makes sense to me.

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 24 2025 at 16:04):

Whoops, in the screenshot above, I had "Dataverse Homepage" but I'll switch to back to "About Dataverse" as discussed above.

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 24 2025 at 16:28):

Ok, I pushed some changes, which can be previewed here: https://dataverse-guide--10942.org.readthedocs.build/en/10942/

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 24 2025 at 16:28):

Anything else? :big_smile:

view this post on Zulip Philip Durbin ๐Ÿš€ (Mar 24 2025 at 18:48):

I fixed the logo at the top left to be the same as what we have in the production version of the guides: the Dataverse icon and the words "Dataverse Project"

view this post on Zulip Philip Durbin ๐Ÿš€ (Apr 07 2025 at 13:09):

The other day I put updated screenshots in the description of #10942 and summarized the changes. It's in "ready for review". Please feel free to take a look and preview it at https://dataverse-guide--10942.org.readthedocs.build/en/10942/

view this post on Zulip Dieuwertje Bloemen (Apr 07 2025 at 13:53):

Looks good. I only have one minor thing as I'm staring at it. The prev/next button are really close to each other. Could the "next" be right aligned, while "previous" remains left?
image.png

view this post on Zulip Philip Durbin ๐Ÿš€ (Apr 07 2025 at 13:53):

Hmm, that's good feedback.

view this post on Zulip Philip Durbin ๐Ÿš€ (Apr 08 2025 at 18:51):

@Dieuwertje Bloemen fixed! https://github.com/IQSS/dataverse/pull/10942/commits/deadddf69e693bf9c93a45ea70c1e4fba21109ea

Thanks for the feedback! :heart:

view this post on Zulip Philip Durbin ๐Ÿš€ (Apr 08 2025 at 18:52):

And luckily, I didn't put screenshots of these buttons in the PR. So I don't have to re-do them. :big_smile:

view this post on Zulip Philip Durbin ๐Ÿš€ (Apr 14 2025 at 15:59):

Just a heads up that I changed "Dataverse Project" to "Dataverse Guides" at the top left. I also updated the "after" screenshots in the PR: #10942.

view this post on Zulip Philip Durbin ๐Ÿš€ (Apr 30 2025 at 18:31):

#10942 has been merged! You can preview it at https://preview.guides.gdcc.io

view this post on Zulip Philip Durbin ๐Ÿš€ (Jul 18 2025 at 13:17):

You can try the home button, etc. at https://guides.dataverse.org/en/6.7 !

view this post on Zulip Omer M Fahim (Jul 18 2025 at 13:22):

good stuff!


Last updated: Nov 01 2025 at 14:11 UTC