Host HTML pages right on your server instance – supports Javascript, and serves unique pages on a repository basis.
Pages Plugin
The Pages plugin provides a simple way to publish web pages in Bitbucket Server. It allows repository administrators to enable serving of static web pages for any existing branch or tag. Once enabled, users will be able to view HTML files of this branch or tag directly in Bitbucket. Its also possible to link to other HTML files or resources like CSS, JavaScript or images by using relative links.
CONTENTS
Feature Highlights
- Simple web hosting Host simple websites directly in Bitbucket Server
- Commit and Publish Just edit, push, and your changes are live
- Version control just happens Automatic version control by Git
- Static web pages for every branch Enable serving of static web pages per branch or tag
- Access control just happens Access control based on repository permissions
- Relative links Supports relative links and files stored in Git LFS
How it works
Repository administrators can enable serving of static web pages for any existing branch or tag in the repository settings screen. Once enabled, the base URL for pages in this branch or tag is being displayed next to the branch or tag name.
Web pages are available under the following URL: /pages/<PROJECT>/<REPOSITORY>/<BRANCH-OR-TAG>
If there is no index.html file available in the root level of a branch or tag, you need to link to the page directly by appending the file path to the URL. Example: /pages/<PROJECT>/<REPOSITORY>/<BRANCH-OR-TAG>/browse/<PATH>/<TO>/<FILE>.html
Once pages have been enabled for a branch or a tag, users will be able to view HTML files of this branch or tag directly in Bitbucket. When clicking on open in the file browser of this branch or tag, the page will be rendered full screen, without the Bitbucket layout. It's also possible to link to other HTML files or resources like CSS, JavaScript or images by using relative links. You can even link to files stored in Git LFS.
Of course by hosting your web pages directly in Bitbucket Server, you also get automatic version control by Git.
Security
Access to web pages is based on repository permissions. Users need at least read access to the repository to view web pages in Bitbucket. For security reasons, pages are not available for branches or tags in personal repositories by default. But in the plugin settings, you can configure which groups are allowed to enable pages in personal repositories.
Note: Only enable pages in repositories and branches or tags where you trust the users who can commit code!
XSS Attacks
For users who want to still use the plugin and are worried about potentially malicious users, we've added an option to disable JavaScript on rendered pages. You can disable JavaScript either on a global level or a repository level.
Pages for Bitbucket Server vs. websites on Bitbucket Cloud
The main difference between Pages for Bitbucket Server and the websites feature of Bitbucket Cloud is that we support websites on a repository level, not just on the account level. This brings the following advantages:
Websites on Bitbucket Cloud | Pages for Bitbucket Server |
---|
On Bitbucket Cloud you can only publish one repository per user. | With the Pages add-on you can publish as many repositories as you want. |
On Bitbucket Cloud you can only publish a single branch of the repository. | With the Pages add-on you can serve static web pages from any branch or tag you like. |
On Bitbucket Cloud the website is public on the internet. Anyone with the URL can access it. | The Pages add-on uses the permissions of the underlying repository, which allows you to control specifically who can access the pages and who not. |
Bitbucket Cloud can only serve a website when the site's URL is <username>.bitbucket.org. | The Pages add-on allows you to use your own custom domain. |
Further Documentation
Error rendering macro 'excerpt-include' : No link could be created for 'DOC:Service Level Agreement'.