mirror of
https://github.com/getzola/zola
synced 2025-01-21 08:13:58 +00:00
315 lines
17 KiB
HTML
315 lines
17 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-gb">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="Everything you need to make a static site engine in one binary.">
|
|
<meta name="author" content="Vincent Prouillet">
|
|
<title>Sourcehut Pages | Zola </title>
|
|
<link rel="stylesheet" href="https://www.getzola.org/site.css">
|
|
<link rel="icon" href="https://www.getzola.org/favicon.ico">
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<a class="header__logo white" href="https://www.getzola.org/">Zola</a>
|
|
<nav>
|
|
<ul>
|
|
<li><a class="white" href="https://www.getzola.org/documentation/" class="nav-link">Docs</a></li>
|
|
<li><a class="white" href="https://www.getzola.org/themes/" class="nav-link">Themes</a></li>
|
|
<li><a class="white" href="https://zola.discourse.group/" class="nav-link">Forum</a></li>
|
|
<li><a class="white" href="https://github.com/getzola/zola" class="nav-link">GitHub</a></li>
|
|
</ul>
|
|
<div class="search-container">
|
|
<input id="search" type="search" placeholder="🔎 Search the docs">
|
|
|
|
<div class="search-results">
|
|
<div class="search-results__items"></div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<div class="content content--reversed">
|
|
|
|
|
|
<div class="documentation">
|
|
<aside class="documentation__sidebar">
|
|
<ul>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Getting Started</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/installation/">Installation</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/cli-usage/">CLI usage</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/directory-structure/">Directory structure</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/configuration/">Configuration</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Content</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/section/">Section</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/page/">Page</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/shortcodes/">Shortcodes</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/linking/">Internal links & deep linking</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/table-of-contents/">Table of Contents</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/syntax-highlighting/">Syntax Highlighting</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/taxonomies/">Taxonomies</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/search/">Search</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/sass/">Sass</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/image-processing/">Image processing</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/multilingual/">Multilingual sites</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Templates</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/pages-sections/">Sections and Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/pagination/">Pagination</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/taxonomies/">Taxonomies</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/feeds/">Feeds</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/sitemap/">Sitemap</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/robots/">Robots.txt</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/404/">404 error page</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/archive/">Archive</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Themes</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/themes/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/themes/installing-and-using-themes/">Installing & using themes</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/themes/creating-a-theme/">Creating a theme</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/themes/extending-a-theme/">Customizing a theme</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Deployment</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="active">
|
|
<a href="https://www.getzola.org/documentation/deployment/sourcehut/">Sourcehut Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/netlify/">Netlify</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/github-pages/">GitHub Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/gitlab-pages/">GitLab Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/codeberg-pages/">Codeberg Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/edgio/">Edgio</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/vercel/">Vercel</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/zeabur/">Zeabur</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/cloudflare-pages/">Cloudflare Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/flyio/">Fly.io</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/aws-s3/">AWS S3 Bucket</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/docker-image/">Docker image</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
</ul>
|
|
</aside>
|
|
<div class="documentation__content">
|
|
|
|
<h1>Sourcehut Pages</h1>
|
|
<p>Deploying your static Zola website on <a href="https://srht.site">Sourcehut Pages</a> is very simple.</p>
|
|
<p>You need to create a <code>.build.yml</code> manifest file in the root folder of your Zola project and push your changes to the
|
|
Sourcehut git/hg repository.
|
|
To create your <code>.build.yml</code> file you can start with <a href="https://git.sr.ht/~sircmpwn/pages.sr.ht-examples">a template</a> or use the following example:</p>
|
|
<pre data-lang="yaml" style="background-color:#383838;color:#e6e1dc;" class="language-yaml "><code class="language-yaml" data-lang="yaml"><span style="color:#e8bf6a;">image</span><span>: </span><span style="color:#a5c261;">alpine/edge
|
|
</span><span style="color:#e8bf6a;">packages</span><span>:
|
|
</span><span> - </span><span style="color:#a5c261;">hut
|
|
</span><span> - </span><span style="color:#a5c261;">zola
|
|
</span><span style="color:#e8bf6a;">oauth</span><span>: </span><span style="color:#a5c261;">pages.sr.ht/PAGES:RW
|
|
</span><span style="color:#e8bf6a;">environment</span><span>:
|
|
</span><span> </span><span style="color:#e8bf6a;">site</span><span>: </span><span style="color:#a5c261;">your_username.srht.site
|
|
</span><span style="color:#e8bf6a;">sources</span><span>:
|
|
</span><span> - </span><span style="color:#a5c261;">https://git.sr.ht/~your_username/my-website
|
|
</span><span style="color:#e8bf6a;">tasks</span><span>:
|
|
</span><span> - </span><span style="color:#e8bf6a;">build</span><span>: </span><span style="color:#cc7833;">|
|
|
</span><span style="color:#a5c261;"> cd my-website
|
|
</span><span style="color:#a5c261;"> zola build
|
|
</span><span> - </span><span style="color:#e8bf6a;">package</span><span>: </span><span style="color:#cc7833;">|
|
|
</span><span style="color:#a5c261;"> cd my-website
|
|
</span><span style="color:#a5c261;"> tar -C public -cvz . > ../site.tar.gz
|
|
</span><span> - </span><span style="color:#e8bf6a;">upload</span><span>: </span><span style="color:#cc7833;">|
|
|
</span><span style="color:#a5c261;"> hut pages publish -d $site site.tar.gz
|
|
</span></code></pre>
|
|
<p>This manifest will clone your source code, build the website and upload the generated static files to the domain
|
|
you specified in <code>site</code>.
|
|
For publishing the website, the build manifest uses <code>hut</code>, a commandline tool which takes care of automatically
|
|
generating authentication tokens, so there is nothing else you need to do.</p>
|
|
<p>From this template you need to customize the variable <code>site</code> with the domain that will host your website and
|
|
<code>sources</code> to point to your Sourcehut git/hg public URL (in this example <code>my-website</code> is the name of the repository).</p>
|
|
<p>Then commit and push your changes:</p>
|
|
<pre data-lang="sh" style="background-color:#383838;color:#e6e1dc;" class="language-sh "><code class="language-sh" data-lang="sh"><span>$ git push
|
|
</span><span>Enumerating objects: 5, done.
|
|
</span><span>...
|
|
</span><span>remote: Build started:
|
|
</span><span>remote: https://builds.sr.ht/</span><span style="color:#d0d0ff;">~</span><span>your_username/job/430625 </span><span style="color:#cc7833;">[</span><span>.build.yml</span><span style="color:#cc7833;">]
|
|
</span><span>To git.sr.ht:</span><span style="color:#d0d0ff;">~</span><span>your_username/www
|
|
</span><span> fbe9afa..59ae556 master -</span><span style="color:#cc7833;">></span><span> master
|
|
</span></code></pre>
|
|
<p>The build job will be automatically triggered.
|
|
Notice that Sourcehut returns a direct link to the build page, where you can check the progress and success status.</p>
|
|
<p>By default you can use a subdomain of Sourcehut Pages to host your static website - <code>your_username.srht.site</code>.
|
|
If you want to use a custom domain (e.g. "blog.mydomain.org"), you will need to configure a DNS record to point to
|
|
the Sourcehut server.
|
|
Instructions on how to do this are available on <a href="https://srht.site/custom-domains">Sourcehut</a>.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<footer>
|
|
©2017-2025 — <a class="white" href="https://www.vincentprouillet.com">Vincent Prouillet</a> and <a class="white" href="https://github.com/getzola/zola/graphs/contributors">contributors</a>
|
|
</footer>
|
|
|
|
<script type="text/javascript" src="https://www.getzola.org/elasticlunr.min.js"></script>
|
|
<script type="text/javascript" src="https://www.getzola.org/search.js"></script>
|
|
</body>
|
|
</html>
|