How to deploy a static site to Cloudflare Pages step by step guide

Sdílet
Vložit
  • čas přidán 18. 02. 2022
  • Learn how to deploy a static site to Cloudflare Pages, and host a static website for free. In this example, I connect a GitHub account to Cloudflare, and deploy a Hugo static site. However, this is the same process as deploying other types of sites such as an Eleventy site, Elder.js site, Astro site, Angular application, Zola site, Vue application, Svelte site, Sphinx site, Remix site, React application, Preact site, Nuxt.js site, Next.js site, Jekyll site, Gatsby site, and Blazor Site.
    View the blog post here: www.dannymoran.com/cloudflare...
    Hi, I’m Danny Moran, a London based IT consultant and blogger. You can view all my blog posts at: www.dannymoran.com
  • Věda a technologie

Komentáře • 14

  • @th3morontv376
    @th3morontv376 Před měsícem +1

    Thanks! ive been trying to fix this for hours, as i added the settings in the DNS manually, but didnt know i had to do it on the page setting aswell. This worked!

    • @danny_moran
      @danny_moran  Před měsícem

      Glad you got it working! Thanks for watching!

  • @ClickLancer
    @ClickLancer Před 5 měsíci +1

    Great tutorial! Straight to the point, and shows exactly what I was looking for!

  • @kelsiemurphy444
    @kelsiemurphy444 Před 4 měsíci +1

    You added your environment variable for the Hugo version in this video. How would you access this within the site? Would it be an identical approach to accessing it from a local .env file, or are further steps needed? Thank you for this.

    • @danny_moran
      @danny_moran  Před 4 měsíci

      Sorry, I'm not sure what you mean. When Cloudflare builds the site from the contents of the Git repo, then it will use the variables to configure some of the settings.

  • @joedyer1989
    @joedyer1989 Před 8 měsíci +1

    Hey! Did you buy your custom domain via cloudflare or another registrar?

    • @danny_moran
      @danny_moran  Před 8 měsíci +1

      No, I purchase my domains using a different registrar. I then change the name servers for the domain to point at Cloudflare so they host all of the DNS.
      Thanks for watching!

    • @joedyer1989
      @joedyer1989 Před 8 měsíci +1

      I have this issue when adding the second domain (without www) it's just stuck on 'initializing' - the site still loads if i visit the domain but it's just annoying :(@@danny_moran

    • @danny_moran
      @danny_moran  Před 8 měsíci

      I've not come across this before. It might be best to post on the Cloudflare Community or in the Cloudflare Discord, they are usually quick to provide suggestions and should be able to assist.

    • @joedyer1989
      @joedyer1989 Před 8 měsíci +1

      thanks dan - also one more question, did you set up one of your domains to redirect to the other to avoid any duplicate content in regards to search engines, e.g redirect non-www to www domain? I wondered how you did this if so@@danny_moran

    • @danny_moran
      @danny_moran  Před 8 měsíci +1

      I redirect my root domain (non-www) to the www subdomain. I always prefer using a subdomain.
      I have a Cloudflare page rule setup that forwards dannymoran.com/* to www.dannymoran.com/$1 using a 301 http code.

  • @Jbziscool1
    @Jbziscool1 Před 6 měsíci +1

    Tysm