瀏覽代碼

README files are not shown on the summary page by default

Change-Id: I421a6b8f8c8eaa5d34b7629858de76fc96458cd3
tags/v1.4.0
James Moger 10 年之前
父節點
當前提交
fab099270c

+ 2
- 0
releases.moxie 查看文件

- Change the WAR baseFolder context parameter to a JNDI env-entry to improve enterprise deployments - Change the WAR baseFolder context parameter to a JNDI env-entry to improve enterprise deployments
- Removed internal Gitblit ref exclusions in the upload pack - Removed internal Gitblit ref exclusions in the upload pack
- Removed "show readme" setting in favor of automatic detection - Removed "show readme" setting in favor of automatic detection
- README files are not shown on the summary page by default, this can be changed with web.summaryShowReadme
- Support plain text, markdown, confluence, mediawiki, textile, tracwiki, or twiki "readme" files - Support plain text, markdown, confluence, mediawiki, textile, tracwiki, or twiki "readme" files
- Determine best commit id (e.g. "master") for the tree and docs pages and use that in links - Determine best commit id (e.g. "master") for the tree and docs pages and use that in links
- By default GO will now bind to all interfaces for both http and https connectors. This simplifies setup for first-time users. - By default GO will now bind to all interfaces for both http and https connectors. This simplifies setup for first-time users.
- { name: 'git.mirrorPeriod', defaultValue: '30 mins' } - { name: 'git.mirrorPeriod', defaultValue: '30 mins' }
- { name: 'web.commitMessageRenderer', defaultValue: 'plain' } - { name: 'web.commitMessageRenderer', defaultValue: 'plain' }
- { name: 'web.showBranchGraph', defaultValue: 'true' } - { name: 'web.showBranchGraph', defaultValue: 'true' }
- { name: 'web.summaryShowReadme', defaultValue: 'false' }
- { name: 'server.redirectToHttpsPort', defaultValue: 'true' } - { name: 'server.redirectToHttpsPort', defaultValue: 'true' }
contributors: contributors:
- James Moger - James Moger

+ 15
- 0
src/main/distrib/data/gitblit.properties 查看文件

# SINCE 0.5.0 # SINCE 0.5.0
web.summaryRefsCount = 5 web.summaryRefsCount = 5
# Show a README file, if available, on the summary page.
#
# SINCE 1.4.0
web.summaryShowReadme = false
# The number of items to show on a page before showing the first, prev, next # The number of items to show on a page before showing the first, prev, next
# pagination links. A default of 50 is used for any invalid value. # pagination links. A default of 50 is used for any invalid value.
# #
# SINCE 1.3.0 # SINCE 1.3.0
web.reflogChangesPerPage = 10 web.reflogChangesPerPage = 10
# Specify the names of documents in the root of your repository to be displayed
# in tabs on your repository docs page. If the name is not found in the root
# then no tab is added. The order specified is the order displayed. Do not
# specify a file extension as the aggregation of markup extensions + txt are used
# in the search algorithm.
#
# SPACE-DELIMITED
# SINCE 1.4.0
web.documents = readme home index changelog contributing submitting_patches copying license notice authors
# Registered file extensions to ignore during Lucene indexing # Registered file extensions to ignore during Lucene indexing
# #
# SPACE-DELIMITED # SPACE-DELIMITED

+ 1
- 1
src/main/java/com/gitblit/wicket/pages/SummaryPage.html 查看文件

<i style="vertical-align: middle;" class="icon-book"></i> <i style="vertical-align: middle;" class="icon-book"></i>
<span style="font-weight:bold;vertical-align:middle;" wicket:id="readmeFile"></span> <span style="font-weight:bold;vertical-align:middle;" wicket:id="readmeFile"></span>
</div> </div>
<div style="border:1px solid #ddd;border-radius: 0 0 3px 3px;padding: 20px;">
<div style="border:1px solid #ddd;border-radius: 0 0 3px 3px;padding: 15px 20px;">
<div wicket:id="readmeContent"></div> <div wicket:id="readmeContent"></div>
</div> </div>
</wicket:fragment> </wicket:fragment>

+ 17
- 11
src/main/java/com/gitblit/wicket/pages/SummaryPage.java 查看文件

add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty()); add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());
add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs, false).hideIfEmpty()); add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs, false).hideIfEmpty());
RevCommit head = JGitUtils.getCommit(r, null);
MarkupProcessor processor = new MarkupProcessor(GitBlit.getSettings());
MarkupDocument markupDoc = processor.parseReadme(r, repositoryName, getBestCommitId(head));
if (markupDoc.markup == null) {
add(new Label("readme").setVisible(false));
if (GitBlit.getBoolean(Keys.web.summaryShowReadme, false)) {
// show a readme on the summary page
RevCommit head = JGitUtils.getCommit(r, null);
MarkupProcessor processor = new MarkupProcessor(GitBlit.getSettings());
MarkupDocument markupDoc = processor.parseReadme(r, repositoryName, getBestCommitId(head));
if (markupDoc == null || markupDoc.markup == null) {
add(new Label("readme").setVisible(false));
} else {
Fragment fragment = new Fragment("readme", MarkupSyntax.PLAIN.equals(markupDoc.syntax) ? "plaintextPanel" : "markdownPanel", this);
fragment.add(new Label("readmeFile", markupDoc.documentPath));
// Add the html to the page
Component content = new Label("readmeContent", markupDoc.html).setEscapeModelStrings(false);
fragment.add(content.setVisible(!StringUtils.isEmpty(markupDoc.html)));
add(fragment);
}
} else { } else {
Fragment fragment = new Fragment("readme", MarkupSyntax.PLAIN.equals(markupDoc.syntax) ? "plaintextPanel" : "markdownPanel", this);
fragment.add(new Label("readmeFile", markupDoc.documentPath));
// Add the html to the page
Component content = new Label("readmeContent", markupDoc.html).setEscapeModelStrings(false);
fragment.add(content.setVisible(!StringUtils.isEmpty(markupDoc.html)));
add(fragment);
// global, no readme on summary page
add(new Label("readme").setVisible(false));
} }
// Display an activity line graph // Display an activity line graph

Loading…
取消
儲存