Skip to content

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

Open
@Botato300

Description

@Botato300

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
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions