Skip to content

broken links like “/docs/howto/update-hook-example” #2006

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

Open
Botato300 opened this issue May 19, 2025 · 2 comments · May be fixed by #2008
Open

broken links like “/docs/howto/update-hook-example” #2006

Botato300 opened this issue May 19, 2025 · 2 comments · May be fixed by #2008

Comments

@Botato300
Copy link

Botato300 commented May 19, 2025

URL for broken page

https://git-scm.com/docs/howto/update-hook-example

Problem

In some cases, urls such as:
https://git-scm.com/docs/howto/update-hook-example
(which I found in the “Repository Administration” section of giteveryday)

make a redirect:
https://github.com/git/git/blob/HEAD/Documentation/howto/update-hook-example.txt
(with .txt at the end of the url) but this changed 4 months ago and now it ends in .adoc

If I am not mistaken, the problem is in this part of the code in the update-docs.rb file:

check_paths.each do |path|
        doc_path = "#{SITE_ROOT}external/docs/content/#{path}.html"
        if !File.exist?(doc_path)
          type = 'blob'
          target = path.sub(/^docs\//, '')
          if target == 'api-index'
            type = 'tree'
            target = 'technical'
          elsif target == 'howto-index'
            type = 'tree'
            target = 'howto'
          else
            target += '.txt' -- PROBLEM HERE: change to .adoc
          end
          front_matter = { "redirect_to" => "https://github.com/git/git/#{type}/HEAD/Documentation/#{target}" } # ltrim `docs/`
          FileUtils.mkdir_p(File.dirname(doc_path))
          File.open(doc_path, "w") do |out|
            out.write(wrap_front_matter(front_matter))
          end
        end
`
@dscho
Copy link
Member

dscho commented May 20, 2025

@Botato300 sounds like you could already open a Pull Request!

@Botato300 Botato300 linked a pull request May 20, 2025 that will close this issue
@Botato300
Copy link
Author

@Botato300 sounds like you could already open a Pull Request!

I tried to make a Pull Request but it gave me an error so I backed out... I'll try again

@dscho dscho linked a pull request May 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants