mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Merge commit '00c4484c7092181729f6f470805bc7d72e8ad17b'
This commit is contained in:
@@ -34,7 +34,7 @@ notesforauthors:
|
||||
|
||||
The spoiler is that you can even deploy your entire website from any compatible OS with no configuration. Using SFTP for example:
|
||||
|
||||
```
|
||||
```txt
|
||||
hugo --gc --minify
|
||||
rclone sync --interactive --sftp-host sftp.example.com --sftp-user www-data --sftp-ask-password public/ :sftp:www/
|
||||
```
|
||||
@@ -49,7 +49,7 @@ For the next commands, we will assume you configured a remote you named ``hugo-w
|
||||
|
||||
The above 'spoiler' commands could become:
|
||||
|
||||
```
|
||||
```txt
|
||||
hugo --gc --minify
|
||||
rclone sync --interactive public/ hugo-www:www/
|
||||
```
|
||||
|
@@ -27,7 +27,7 @@ notesforauthors:
|
||||
|
||||
The spoiler is that you can deploy your entire website with a command that looks like the following:
|
||||
|
||||
```
|
||||
```txt
|
||||
hugo && rsync -avz --delete public/ www-data@ftp.topologix.fr:~/www/
|
||||
```
|
||||
|
||||
@@ -45,13 +45,13 @@ sudo apt-get install openssh-client
|
||||
|
||||
Then generate your ssh key. First, create the `.ssh` directory in your home directory if it doesn't exist:
|
||||
|
||||
```
|
||||
```txt
|
||||
~$ cd && mkdir .ssh & cd .ssh
|
||||
```
|
||||
|
||||
Next, execute this command to generate a new keypair called `rsa_id`:
|
||||
|
||||
```
|
||||
```txt
|
||||
~/.ssh/$ ssh-keygen -t rsa -q -C "For SSH" -f rsa_id
|
||||
```
|
||||
|
||||
@@ -59,7 +59,7 @@ You'll be prompted for a passphrase, which is an extra layer of protection. Ente
|
||||
|
||||
To make logging in easier, add a definition for your web host to the file `~/.ssh/config` with the following command, replacing `HOST` with the IP address or hostname of your web host, and `USER` with the username you use to log in to your web host when transferring files:
|
||||
|
||||
```
|
||||
```txt
|
||||
~/.ssh/$ cat >> config <<EOF
|
||||
Host HOST
|
||||
Hostname HOST
|
||||
@@ -71,13 +71,13 @@ EOF
|
||||
|
||||
Then copy your ssh public key to the remote server with the `ssh-copy-id` command:
|
||||
|
||||
```
|
||||
```txt
|
||||
~/.ssh/$ ssh-copy-id -i rsa_id.pub USER@HOST.com
|
||||
```
|
||||
|
||||
Now you can easily connect to the remote server:
|
||||
|
||||
```
|
||||
```txt
|
||||
~$ ssh user@host
|
||||
Enter passphrase for key '/home/mylogin/.ssh/rsa_id':
|
||||
```
|
||||
@@ -88,40 +88,40 @@ Now that you can log in with your SSH key, let's create a script to automate dep
|
||||
|
||||
Create a new script called `deploy` the root of your Hugo tree:
|
||||
|
||||
```
|
||||
```txt
|
||||
~/websites/topologix.fr$ editor deploy
|
||||
```
|
||||
|
||||
Add the following content. Replace the `USER`, `HOST`, and `DIR` values with your own values:
|
||||
|
||||
```
|
||||
```bash
|
||||
#!/bin/sh
|
||||
USER=my-user
|
||||
HOST=my-server.com
|
||||
DIR=my/directory/to/topologix.fr/ # the directory where your web site files should go
|
||||
|
||||
hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR}
|
||||
hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR} # this will delete everything on the server that's not in the local public folder
|
||||
|
||||
exit 0
|
||||
```
|
||||
|
||||
Note that `DIR` is the relative path from the remote user's home. If you have to specify a full path (for instance `/var/www/mysite/`) you must change `~/${DIR}` to `${DIR}` inside the command line. For most cases you should not have to.
|
||||
Note that `DIR` is the relative path from the remote user's home. If you have to specify a full path (for instance `/var/www/mysite/`) you must change `~/${DIR}` to `${DIR}` inside the command-line. For most cases you should not have to.
|
||||
|
||||
Save and close, and make the `deploy` file executable:
|
||||
|
||||
```
|
||||
```txt
|
||||
~/websites/topologix.fr$ chmod +x deploy
|
||||
```
|
||||
|
||||
Now you only have to enter the following command to deploy and update your website:
|
||||
|
||||
```
|
||||
```txt
|
||||
~/websites/topologix.fr$ ./deploy
|
||||
```
|
||||
|
||||
Your site builds and deploys:
|
||||
|
||||
```
|
||||
```txt
|
||||
Started building sites ...
|
||||
Built site for language en:
|
||||
0 draft content
|
||||
|
@@ -4,7 +4,6 @@ linktitle: Host on 21YunBox
|
||||
description: Host your Hugo site with 21YunBox's blazing fast Chinese CDN, fully-managed SSL and auto deploys from Gitee.
|
||||
date: 2021-01-06
|
||||
publishdate: 2021-01-06
|
||||
lastmod: 2021-01-06
|
||||
categories: [hosting and deployment]
|
||||
keywords: [21yunbox,hosting,deployment]
|
||||
authors: [Toby Glei]
|
||||
@@ -62,4 +61,5 @@ Every deploy automatically and instantly invalidates the CDN cache, so your user
|
||||
Add your own domains to your site easily using 21YunBox's [custom domains](https://www.21yunbox.com/docs/#/custom-domains) guide.
|
||||
|
||||
## Support
|
||||
|
||||
Click [here](https://www.21yunbox.com/docs/#/contact) to contact with 21YunBox' experts if you need help.
|
||||
|
@@ -4,7 +4,6 @@ linktitle: Host on AWS Amplify
|
||||
description: Develop and deploy a cloud-powered web app with AWS Amplify.
|
||||
date: 2018-01-31
|
||||
publishdate: 2018-01-31
|
||||
lastmod: 2018-01-31
|
||||
categories: [hosting and deployment]
|
||||
keywords: [amplify,hosting,deployment]
|
||||
authors: [Nikhil Swaminathan]
|
||||
@@ -14,7 +13,6 @@ menu:
|
||||
weight: 10
|
||||
weight: 10
|
||||
sections_weight: 10
|
||||
draft: false
|
||||
aliases: []
|
||||
toc: true
|
||||
---
|
||||
@@ -37,12 +35,12 @@ AWS Amplify is a combination of client library, CLI toolchain, and a Console for
|
||||
1. Connect a branch from your GitHub, Bitbucket, GitLab, or AWS CodeCommit repository. Connecting your repository allows Amplify to deploy updates on every code commit to a branch.
|
||||

|
||||
|
||||
1. Accept the default build settings. The Amplify Console automatically detects your Hugo build settings and output directory.
|
||||
1. Accept the default build settings. The Amplify Console automatically detects your Hugo build settings and output directory.
|
||||

|
||||
|
||||
1. Review your changes and then choose **Save and deploy**. The Amplify Console will pull code from your repository, build changes to the backend and frontend, and deploy your build artifacts at `https://master.unique-id.amplifyapp.com`. Bonus: Screenshots of your app on different devices to find layout issues.
|
||||
|
||||
## Using a Newer Version of Hugo
|
||||
## Using a newer version of Hugo
|
||||
|
||||
If you need to use a different, perhaps newer, version of Hugo than the version currently supported by AWS Amplify:
|
||||
|
||||
@@ -53,5 +51,4 @@ If you need to use a different, perhaps newer, version of Hugo than the version
|
||||
1. From the selection, click **Hugo** and ensure the version field says `latest`
|
||||
1. Click **Save** to save the changes.
|
||||
|
||||
|
||||
[Quick Start]: /getting-started/quick-start/
|
||||
|
@@ -18,6 +18,6 @@ toc: true
|
||||
aliases: []
|
||||
---
|
||||
|
||||
You can create and deploy a Hugo web application to Azure Static Web Apps. The final result is a new Azure Static Web App with associated GitHub Actions that give you control over how the app is built and published. You'll learn how to create a Hugo app, setup an Azure Static Web App and deploy the Hugo app to Azure.
|
||||
You can create and deploy a Hugo web application to Azure Static Web Apps. The final result is a new Azure Static Web App with associated GitHub Actions that give you control over how the app is built and published. You'll learn how to create a Hugo app, set up an Azure Static Web App and deploy the Hugo app to Azure.
|
||||
|
||||
Here's the tutorial on how to [Publish a Hugo site to Azure Static Web Apps](https://docs.microsoft.com/en-us/azure/static-web-apps/publish-hugo).
|
||||
|
101
docs/content/en/hosting-and-deployment/hosting-on-azure.md
Normal file
101
docs/content/en/hosting-and-deployment/hosting-on-azure.md
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
title: Host on Azure Static Web Apps
|
||||
linktitle: Host on Azure Static Web Apps
|
||||
description: Deploy Hugo to Azure Static Web Apps and automate the whole process with Github Action Workflow
|
||||
date: 2021-03-12
|
||||
publishdate: 2021-03-12
|
||||
categories: [hosting and deployment]
|
||||
keywords: [azure,git,deployment,hosting]
|
||||
authors: [Aaron Powell]
|
||||
menu:
|
||||
docs:
|
||||
parent: "hosting-and-deployment"
|
||||
weight: 10
|
||||
weight: 10
|
||||
sections_weight: 10
|
||||
toc: true
|
||||
---
|
||||
|
||||
[Azure Static Web Apps] is a service that automatically builds and deploys full stack web apps to Azure from a Git repository, using [GitHub Actions] or [Azure DevOps].
|
||||
|
||||
_The following documentation covers how to use GitHub Actions for the deployment. If you are using Azure DevOps, follow the Microsoft documentation._
|
||||
|
||||
## Assumptions
|
||||
|
||||
1. You have Git 2.8 or greater [installed on your machine][installgit].
|
||||
2. You have a GitHub account. [Signing up][ghsignup] for GitHub is free.
|
||||
3. You have an Azure account. You can sign up for a [Free Trail][azuretrial].
|
||||
4. You have a ready-to-publish Hugo website or have at least completed the [Quick Start][].
|
||||
|
||||
## Deploy Hugo to Azure Static Web Apps
|
||||
|
||||
1. Navigate to the [Azure Portal][azureportal]
|
||||
2. Click **Create a Resource**
|
||||
3. Search for **Static Web Apps**
|
||||
4. Click **Static Web Apps**
|
||||
5. Click **Create**
|
||||
|
||||

|
||||
|
||||
6. For **Subscription**, accept the subscription that is listed or select a new one from the drop-down list.
|
||||
7. In _Resource group_, select **New**. In _New resource group name_, enter **hugo-static-app** and select **OK**.
|
||||
8. Next, a name for your app in the **Name** box. Valid characters include `a-z`, `A-Z`, `0-9` and `-`.
|
||||
9. For _Region_, select an available region close to you.
|
||||
10. For _SKU_, select **Free**.
|
||||
|
||||

|
||||
|
||||
11. Click the **Sign in with GitHub** button.
|
||||
12. Select the **Organization** under which your repo exists.
|
||||
13. Select the Hugo app you wish to deploy as the _Repository_ .
|
||||
14. For the _Branch_ select the branch you want to deploy (eg: **main**).
|
||||
15. Select **Hugo** under the _Build Presets_, which will populate the configuration files with the standard Hugo build options
|
||||
* **App Location** is the path in the Git repo where Hugo's config file is
|
||||
* **Api Location** is the path where the Serverless API is (or left blank if there is no API)
|
||||
* **Artifact Location** is the path where Hugo publishes to
|
||||
16. Click **Review + Create** to review the details and then **Create** to start the creation of the Azure Static Web Apps and create the GitHub Action workflow for deployment.
|
||||
|
||||
A GitHub Action workflow will immediately start a build using Hugo and deployment to Azure. The website can be accessed via the URL shown on the _Overview_ page of the Azure Static Web Apps resource in Azure.
|
||||
|
||||
## Using A Custom Hugo Version
|
||||
|
||||
When you create a Static Web App, a [workflow file][swaconfig] is generated which contains the deployment settings for the site. You can configure a specific Hugo version in the workflow file by providing a value for `HUGO_VERSION` in the `env` section of the `Azure/static-web-apps-deploy` GitHub Action.
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
build_and_deploy_job:
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
|
||||
runs-on: ubuntu-latest
|
||||
name: Build and Deploy Job
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: Build And Deploy
|
||||
id: builddeploy
|
||||
uses: Azure/static-web-apps-deploy@v1
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
action: "upload"
|
||||
app_location: "/" # App source code path
|
||||
api_location: "api" # Api source code path - optional
|
||||
output_location: "public" # Built app content directory - optional
|
||||
env:
|
||||
HUGO_VERSION: 0.100.2
|
||||
```
|
||||
|
||||
## Use a Custom Domain
|
||||
|
||||
Azure Static Web Apps supports custom domains as a CNAME or APEX domain mapping. You can configure the custom domains via the Azure Portal. Refer to the [official documentation for custom domains][domains] for more information.
|
||||
|
||||
[Azure Static Web Apps]: https://docs.microsoft.com/azure/static-web-apps/?WT.mc_id=javascript-26008-aapowell
|
||||
[GitHub Actions]: https://docs.github.com/en/actions
|
||||
[Azure DevOps]: https://docs.microsoft.com/azure/static-web-apps/publish-devops?WT.mc_id=javascript-26008-aapowell
|
||||
[ghsignup]: https://github.com/join
|
||||
[installgit]: https://git-scm.com/downloads
|
||||
[azuretrial]: https://azure.microsoft.com/free/?WT.mc_id=javascript-26008-aapowell
|
||||
[azureportal]: https://portal.azure.com/
|
||||
[swaconfig]: https://docs.microsoft.com/azure/static-web-apps/github-actions-workflow?WT.mc_id=javascript-26008-aapowell
|
||||
[domains]: https://docs.microsoft.com/azure/static-web-apps/custom-domain?WT.mc_id=javascript-26008-aapowell
|
||||
[Quick Start]: /getting-started/quick-start/
|
@@ -4,7 +4,6 @@ linktitle: Host on Firebase
|
||||
description: You can use Firebase's free tier to host your static website; this also gives you access to Firebase's NOSQL API.
|
||||
date: 2017-03-12
|
||||
publishdate: 2017-03-12
|
||||
lastmod: 2017-03-15
|
||||
categories: [hosting and deployment]
|
||||
keywords: [hosting,firebase]
|
||||
authors: [Michel Racic]
|
||||
@@ -14,7 +13,6 @@ menu:
|
||||
weight: 20
|
||||
weight: 20
|
||||
sections_weight: 20
|
||||
draft: false
|
||||
toc: true
|
||||
aliases: []
|
||||
---
|
||||
@@ -28,21 +26,23 @@ aliases: []
|
||||
|
||||
Go to the [Firebase console][console] and create a new project (unless you already have a project). You will need to globally install `firebase-tools` (node.js):
|
||||
|
||||
```
|
||||
```txt
|
||||
npm install -g firebase-tools
|
||||
```
|
||||
|
||||
Log in to Firebase (setup on your local machine) using `firebase login`, which opens a browser where you can select your account. Use `firebase logout` in case you are already logged in but to the wrong account.
|
||||
|
||||
|
||||
```
|
||||
```txt
|
||||
firebase login
|
||||
```
|
||||
|
||||
In the root of your Hugo project, initialize the Firebase project with the `firebase init` command:
|
||||
|
||||
```
|
||||
```txt
|
||||
firebase init
|
||||
```
|
||||
|
||||
From here:
|
||||
|
||||
1. Choose Hosting in the feature question
|
||||
@@ -51,24 +51,54 @@ From here:
|
||||
4. Accept the default for the publish directory, which is `public`
|
||||
5. Choose "No" in the question if you are deploying a single-page app
|
||||
|
||||
## Deploy
|
||||
## Using Firebase & Github CI/CD
|
||||
|
||||
To deploy your Hugo site, execute the `firebase deploy` command, and your site will be up in no time:
|
||||
In new versions of Firebase, some other questions apply:
|
||||
|
||||
6. Set up automatic builds and deploys with GitHub?
|
||||
|
||||
Here you will be redirected to login in your GitHub account to get permissions. Confirm.
|
||||
|
||||
7. For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository)
|
||||
|
||||
Include the repository you will use in the format above (Account/Repo)
|
||||
Firebase script with retrive credentials, create a service account you can later manage in yout github settings.
|
||||
|
||||
8. Set up the workflow to run a build script before every deploy?
|
||||
|
||||
Here is your oportunity to include some commands before you run the deploy.
|
||||
|
||||
9. Set up automatic deployment to your site's live channel when a PR is merged?
|
||||
|
||||
You can let in the default option (main)
|
||||
|
||||
After that Firebase has been set in your project with CI/CD. After that run:
|
||||
|
||||
```
|
||||
hugo && firebase deploy
|
||||
```
|
||||
|
||||
## CI Setup
|
||||
With this you will have the app initialized manualy. After that you can manage and fix your github workflow from: https://github.com/your-account/yout-repo/actions
|
||||
|
||||
Don't forget to update your static pages before push!
|
||||
|
||||
## Manual Deploy
|
||||
|
||||
To deploy your Hugo site, execute the `firebase deploy` command, and your site will be up in no time:
|
||||
|
||||
```txt
|
||||
hugo && firebase deploy
|
||||
```
|
||||
|
||||
## CI Setup (Other tools)
|
||||
|
||||
You can generate a deploy token using
|
||||
|
||||
|
||||
```
|
||||
```txt
|
||||
firebase login:ci
|
||||
```
|
||||
|
||||
You can also set up your CI (e.g., with [Wercker][]) and add the token to a private variable like `$FIREBASE_DEPLOY_TOKEN`.
|
||||
You can also set up your CI and add the token to a private variable like `$FIREBASE_DEPLOY_TOKEN`.
|
||||
|
||||
{{% note %}}
|
||||
This is a private secret and it should not appear in a public repository. Make sure you understand your chosen CI and that it's not visible to others.
|
||||
@@ -76,7 +106,7 @@ This is a private secret and it should not appear in a public repository. Make s
|
||||
|
||||
You can then add a step in your build to do the deployment using the token:
|
||||
|
||||
```
|
||||
```txt
|
||||
firebase deploy --token $FIREBASE_DEPLOY_TOKEN
|
||||
```
|
||||
|
||||
@@ -84,6 +114,6 @@ firebase deploy --token $FIREBASE_DEPLOY_TOKEN
|
||||
|
||||
* [Firebase CLI Reference](https://firebase.google.com/docs/cli/#administrative_commands)
|
||||
|
||||
[console]: https://console.firebase.google.com
|
||||
[console]: https://console.firebase.google.com/
|
||||
[Quick Start]: /getting-started/quick-start/
|
||||
[signup]: https://console.firebase.google.com/
|
||||
|
@@ -43,11 +43,11 @@ The GitHub Actions used in these instructions pull source content from the `main
|
||||
As mentioned in the [GitHub Pages documentation][ghorgs], you can host a user/organization page in addition to project pages. Here are the key differences in GitHub Pages websites for Users and Organizations:
|
||||
|
||||
1. You must create a repository named `<USERNAME>.github.io` or `<ORGANIZATION>.github.io` to host your pages
|
||||
2. By default, content from the `main` branch is used to publish GitHub Pages - rather than the `gh-pages` branch which is the default for project sites. However, the GitHub Actions in these instructions publish to the `gh-pages` branch. Therefore, if you are publishing Github pages for a user or organization, you will need to change the publishing branch to `gh-pages`. See the instructions later in this document.
|
||||
2. By default, content from the `main` branch is used to publish GitHub Pages - rather than the `gh-pages` branch which is the default for project sites. However, the GitHub Actions in these instructions publish to the `gh-pages` branch. Therefore, if you are publishing GitHub pages for a user or organization, you will need to change the publishing branch to `gh-pages`. See the instructions later in this document.
|
||||
|
||||
## Build Hugo With GitHub Action
|
||||
|
||||
GitHub executes your software development workflows. Everytime you push your code on the GitHub repository, Github Actions will build the site automatically.
|
||||
GitHub executes your software development workflows. Every time you push your code on the GitHub repository, GitHub Actions will build the site automatically.
|
||||
|
||||
Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on [actions-hugo](https://github.com/marketplace/actions/hugo-setup)):
|
||||
|
||||
@@ -57,7 +57,7 @@ name: github pages
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # Set a branch to deploy
|
||||
- main # Set a branch that will trigger a deployment
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
@@ -55,7 +55,7 @@ pages:
|
||||
See [this list](https://gitlab.com/pages/hugo/container_registry) if you wish to use a particular Hugo version to build your site.
|
||||
{{% /note %}}
|
||||
|
||||
## Push Your Hugo Website to GitLab
|
||||
## Push your Hugo website to GitLab
|
||||
|
||||
Next, create a new repository on GitLab. It is *not* necessary to make the repository public. In addition, you might want to add `/public` to your .gitignore file, as there is no need to push compiled assets to GitLab or keep your output website in version control.
|
||||
|
||||
@@ -73,13 +73,13 @@ git remote add origin https://gitlab.com/YourUsername/your-hugo-site.git
|
||||
git push -u origin master
|
||||
```
|
||||
|
||||
## Wait for Your Page to Build
|
||||
## Wait for your page to build
|
||||
|
||||
That's it! You can now follow the CI agent building your page at `https://gitlab.com/<YourUsername>/<your-hugo-site>/pipelines`.
|
||||
|
||||
After the build has passed, your new website is available at `https://<YourUsername>.gitlab.io/<your-hugo-site>/`.
|
||||
|
||||
## Next Steps
|
||||
## Next steps
|
||||
|
||||
GitLab supports using custom CNAME's and TLS certificates. For more details on GitLab Pages, see the [GitLab Pages setup documentation](https://about.gitlab.com/2016/04/07/gitlab-pages-setup/).
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Hosting on KeyCDN"
|
||||
title: "Host on KeyCDN"
|
||||
date: 2017-09-12
|
||||
description: "Accelerate your Hugo site globally with a KeyCDN integration. This tutorial shows you how to setup your static site as a GitLab page behind a KeyCDN pull zone."
|
||||
description: "Accelerate your Hugo site globally with a KeyCDN integration. This tutorial shows you how to set up your static site as a GitLab page behind a KeyCDN pull zone."
|
||||
categories: [hosting and deployment]
|
||||
keywords: [keycdn,hosting,deployment,cdn]
|
||||
menu:
|
||||
@@ -11,7 +11,6 @@ menu:
|
||||
slug: ""
|
||||
aliases: []
|
||||
toc: false
|
||||
draft: false
|
||||
---
|
||||
|
||||
[KeyCDN](https://www.keycdn.com/) provides a multitude of features to help accelerate and secure your Hugo site globally including Brotli compression, Let's Encrypt support, Origin Shield, and more.
|
||||
@@ -24,7 +23,7 @@ draft: false
|
||||
|
||||
## Create a KeyCDN Pull Zone
|
||||
|
||||
The first step will be to login to your KeyCDN account and create a new zone. Name this whatever you like and select the [Pull Zone](https://www.keycdn.com/support/create-a-pull-zone/) option. As for the origin URL, your site will be running on [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html) with a URL of `https://youruser.gitlab.io/reponame/`. Use this as the Origin URL.
|
||||
The first step will be to log in to your KeyCDN account and create a new zone. Name this whatever you like and select the [Pull Zone](https://www.keycdn.com/support/create-a-pull-zone/) option. As for the origin URL, your site will be running on [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html) with a URL of `https://youruser.gitlab.io/reponame/`. Use this as the Origin URL.
|
||||
|
||||

|
||||
|
||||
@@ -36,7 +35,7 @@ Ensure that you use your Zone URL or Zone alias as the `BASEURL` variable in the
|
||||
|
||||
Your `.gitlab-ci.yml` file should look similar to the example below. Be sure to modify any variables that are specific to your setup.
|
||||
|
||||
```
|
||||
```yml
|
||||
image: alpine:latest
|
||||
|
||||
variables:
|
||||
@@ -82,7 +81,7 @@ The Zone ID and API key are used to purge your zone – it’s not strictly need
|
||||
|
||||
Now it’s time to push the newly created repository to GitLab:
|
||||
|
||||
```
|
||||
```bash
|
||||
git remote add origin git@gitlab.com:youruser/ci-example.git
|
||||
git push -u origin master
|
||||
```
|
||||
|
@@ -4,7 +4,6 @@ linktitle: Host on Netlify
|
||||
description: Netlify can host your Hugo site with CDN, continuous deployment, 1-click HTTPS, an admin GUI, and its own CLI.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-03-11
|
||||
categories: [hosting and deployment]
|
||||
keywords: [netlify,hosting,deployment]
|
||||
authors: [Ryan Watters, Seth MacLeod]
|
||||
@@ -14,7 +13,6 @@ menu:
|
||||
weight: 10
|
||||
weight: 10
|
||||
sections_weight: 10
|
||||
draft: false
|
||||
aliases: []
|
||||
toc: true
|
||||
---
|
||||
@@ -39,7 +37,7 @@ Selecting GitHub will bring up an authorization modal for authentication. Select
|
||||
|
||||

|
||||
|
||||
## Create a New Site with Continuous Deployment
|
||||
## Create a new site with continuous deployment
|
||||
|
||||
You're now already a Netlify member and should be brought to your new dashboard. Select "New site from git."
|
||||
|
||||
@@ -57,9 +55,9 @@ Select the repo you want to use for continuous deployment. If you have a large n
|
||||
|
||||

|
||||
|
||||
Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you wanted published, your [build command][], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch.
|
||||
Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you want to publish, your [build command][], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch.
|
||||
|
||||
## Configure Hugo Version in Netlify
|
||||
## Configure Hugo version in Netlify
|
||||
|
||||
You can [set Hugo version](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for your environments in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console.
|
||||
|
||||
@@ -67,14 +65,14 @@ For production:
|
||||
|
||||
{{< code file="netlify.toml" codeLang="toml" >}}
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.83.1"
|
||||
HUGO_VERSION = "0.99.1"
|
||||
{{< /code >}}
|
||||
|
||||
For testing:
|
||||
|
||||
{{< code file="netlify.toml" codeLang="toml" >}}
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.83.1"
|
||||
HUGO_VERSION = "0.99.1"
|
||||
{{< /code >}}
|
||||
|
||||
The Netlify configuration file can be a little hard to understand and get right for the different environment, and you may get some inspiration and tips from this site's `netlify.toml`:
|
||||
@@ -107,7 +105,7 @@ The [`git clone` method for installing themes][installthemes] is not supported b
|
||||
|
||||
A *better* approach is to install a theme as a proper git submodule. You can [read the GitHub documentation for submodules][ghsm] or those found on [Git's website][gitsm] for more information, but the command is similar to that of `git clone`:
|
||||
|
||||
```
|
||||
```txt
|
||||
cd themes
|
||||
git submodule add https://github.com/<THEMECREATOR>/<THEMENAME>
|
||||
```
|
||||
@@ -116,7 +114,7 @@ It is recommended to only use stable versions of a theme (if it’s versioned) a
|
||||
|
||||
Switch to the theme's directory and list all available versions:
|
||||
|
||||
```
|
||||
```txt
|
||||
cd themes/<theme>
|
||||
git tag
|
||||
# exit with q
|
||||
@@ -124,25 +122,24 @@ git tag
|
||||
|
||||
You can checkout a specific version as follows:
|
||||
|
||||
```
|
||||
```txt
|
||||
git checkout tags/<version-name>
|
||||
```
|
||||
|
||||
You can update a theme to the latest version by executing the following command in the *root* directory of your project:
|
||||
|
||||
```
|
||||
```txt
|
||||
git submodule update --rebase --remote
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
You now have a live website served over https, distributed through CDN, and configured for continuous deployment. Dig deeper into the Netlify documentation:
|
||||
You now have a live website served over HTTPS, distributed through CDN, and configured for continuous deployment. Dig deeper into the Netlify documentation:
|
||||
|
||||
1. [Using a Custom Domain][]
|
||||
2. [Setting up HTTPS on Custom Domains][httpscustom]
|
||||
3. [Redirects and Rewrite Rules][]
|
||||
|
||||
|
||||
[app.netlify.com]: https://app.netlify.com
|
||||
[build command]: /getting-started/usage/#the-hugo-command
|
||||
[config]: /getting-started/configuration/
|
||||
|
@@ -37,9 +37,9 @@ Static sites are **completely free** on Render and include the following:
|
||||
|
||||
## Assumptions
|
||||
|
||||
* You have an account with GitHub or GitLab.
|
||||
* You have completed the [Quick Start][] or have a Hugo website you are ready to deploy and share with the world.
|
||||
* You have a Render account. You can sign up at https://render.com/register.
|
||||
- You have an account with GitHub or GitLab.
|
||||
- You have completed the [Quick Start][] or have a Hugo website you are ready to deploy and share with the world.
|
||||
- You have a Render account. You can sign up at https://render.com/register.
|
||||
|
||||
## Deployment
|
||||
|
||||
|
Reference in New Issue
Block a user