Skip to content

Render a GitHub ribbon on all sites#515

Draft
slawekjaranowski wants to merge 1 commit intoapache:masterfrom
slawekjaranowski:github-ribbon
Draft

Render a GitHub ribbon on all sites#515
slawekjaranowski wants to merge 1 commit intoapache:masterfrom
slawekjaranowski:github-ribbon

Conversation

@slawekjaranowski
Copy link
Member

@slawekjaranowski slawekjaranowski commented Nov 11, 2025

firsst pass done for plugins only:

this PR is about extending to all projects, not only plugins
require introduction of property maven.site.gitHubProjectId for multi-module builds

@slawekjaranowski slawekjaranowski self-assigned this Nov 11, 2025
@slawekjaranowski slawekjaranowski added the enhancement New feature or request label Nov 11, 2025
Copy link
Member

@kwin kwin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@Bukama
Copy link
Contributor

Bukama commented Nov 11, 2025

Maybe it's a personal thing, but when I see a "fork me" ribbon/sign, I always get the feeling that this means "Hey this project is inactive, consider to fork it and work on yourself".

@olamy
Copy link
Member

olamy commented Nov 11, 2025

Why not but I think we had this in the past and remove it for some reasons
Not sure why though and maybe I'm wrong 😀
@hboutemy do you remember something about this?

@kwin
Copy link
Member

kwin commented Nov 11, 2025

For me a ribbon is the fastest way how external contributors may raise PRs!

@slawekjaranowski
Copy link
Member Author

Maybe instead of ribbon we can add a right menu Get Sources or GitHub source/issues like on main site

image

pinting to GitHub - will be more clear that Fork Me ribbon

@slawekjaranowski
Copy link
Member Author

@kwin @olamy @Bukama after last comments I think to revert changes for GitHub ribbon for current release.

Make current 46 release without it and we can discuss it for next release

@hboutemy
Copy link
Member

Why not but I think we had this in the past and remove it for some reasons
Not sure why though and maybe I'm wrong 😀
@hboutemy do you remember something about this?

in the past, we wanted to promote ASF Gitbox and we wanted to avoid promoting a commercial solution: now that ship sank quite some time ago at ASF...

having a Ribbon on every released project site could help people, why not = what this PR ca do

for the 2 "non-released projects" sites = maven-site and Doxia-site, there is always to question about getting the (non-versioned) site sources vs discovering the vast list of sub-projects. This is a separate discussion to have, even if these 2 sites will benefit by default form a link to the site's GH

@kwin
Copy link
Member

kwin commented Nov 15, 2025

The next release introduces ribbons for plugins. That PR was back then approved by @olamy . Is there someone out there against this?

@slawekjaranowski
Copy link
Member Author

The next release introduces ribbons for plugins. That PR was back then approved by @olamy . Is there someone out there against this?

I'm not against, even more if we introduce it for plugins - and we agree the it is ok, I think that the rest project also can have an easy link to GitHub project

@hboutemy
Copy link
Member

hboutemy commented Nov 15, 2025

understanding now this PR given #494 and #495 have been merged is hard: working on description when creating a PR would really be appreciated, as title is definitively not sufficient

@slawekjaranowski
Copy link
Member Author

understanding now this PR given #494 and #495 have been merged is hard: working on description when creating a PR would really be appreciated, as title is definitively not sufficient

exactly - such #495 have been merged - we will have a GitHub ribbon for all plugins documentation ....

I would like to our sites will look the same (similar) independent of component type, so I propose this PR

@hboutemy
Copy link
Member

hboutemy commented Nov 17, 2025

before taking a decision, I tested #495 on a plugin: https://maven.apache.org/plugins-archives/maven-clean-plugin-LATEST/

given this is highly subjective, having a community discussion about activating it or not would (based on concrete example) make sense

A <<GitHub ribbon>> has been added to the generated site to provide a direct link to the project's GitHub repository.

A new configuration property <<<maven.site.gitHubProjectId>>> has been introduced.
By default, this property is set to <<<$\{project.artifactId\}>>>, is used to resolve the <<GitHub>> repository URL for the ribbon link.
Copy link
Member

@hboutemy hboutemy Nov 17, 2025

Choose a reason for hiding this comment

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

  1. for multi-module projects, a fixed value has to be added to the build root (can I add a commit to the PR?)
  2. what are instructions when ribbon has to be disabled, like on maven-site or doxia-site? or do we really want the ribbon also on main sites?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. for multi-module projects, a fixed value has to be added to the build root (can I add a commit to the PR?)

of course - always

  1. what are instructions when ribbon has to be disabled, like on maven-site or doxia-site? or do we really want the ribbon also on main sites?

it is not easy, when we have defined ribbon in parent site.xml - always will be used ...

look at code https://github.com/apache/maven-fluido-skin/blob/de8a32f384bc01f1b527f20d00c920bf458482c5/src/main/resources/META-INF/maven/site-macros.vm#L466

we can try to set projectId to empty value ... to avoid rendering .. but I'm not sure

Copy link
Member Author

Choose a reason for hiding this comment

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

@hboutemy why do you want disable it on site like maven-site or doxia-site?

Copy link
Member

Choose a reason for hiding this comment

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

good question

for Maven site or Doxia site, we already have an edit button that goes to the source of the page
image

and getting the same visual ribbon everywhere IMHO adds more confusion: of course, we need to see, I'm anticipating in my head

Copy link
Member Author

Choose a reason for hiding this comment

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

We have an edit button on the all editable sites .... but it is not visible for users
Ribbon is more easy way to access source repository

Copy link
Member

Choose a reason for hiding this comment

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

on a site, if it is about editing Markdown or other markup, finding the source in GitHub has proven to be hard

any idea how to make that edit button more visible?

and for Maven site and Doxia site, "getting the same visual ribbon everywhere IMHO adds more confusion"

Copy link
Member

Choose a reason for hiding this comment

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

let's have a few plugins with ribbon
then we'll add the ribbon to Maven site too
and we'll see what it feels like when someone goes from https://maven.apache.org/plugins/ to one plugin: same Ribbon visual, different target Git repository

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants