Project: Build a blog with Eleventy, Codeberg and Cloudflare

  1. Buy thisdesignercodes.com domain on Cloudflare
  2. Create new repository in Codeberg
  3. Clone project locally
    git clone https://codeberg.org/mariocarabotta/thisdesignercodes.git
    cd $thisdesignercodes
  4. Install Eleventy
    npm init -y
    npm install @11ty/eleventy
  5. Create index.html file in main folder
  6. Run Eleventy to check everything is working as expected
    npx @11ty/eleventy
  7. Create .gitignore file in main folder, including
    _site
    node_modules
  8. Commit
  9. Download and add deploy-pages.sh script file to main folder
  10. Remove -- ":!:$ssg_output_dir" from deploy-pages.sh
  11. Set variables in deploy-pages.sh
    ssg_build_cmd="npx @11ty/eleventy --pathprefix=thisdesignercodes"
    ssg_output_dir="_site"
    remote="origin"
    remote_branch="pages"
  12. Create pages branch
    git worktree add --orphan pages
    git --work-tree pages commit --allow-empty --message "Initial commit"
    git worktree remove pages
  13. Test script
    chmod +x deploy-pages.sh
    ./deploy-pages.sh
  14. Create .domains file in main folder, including
    thisdesignercodes.com
  15. Create .eleventy.js file in main folder, including
    ssg_build_cmd="npx @11ty/eleventy --pathprefix=thisdesignercodes"
    ssg_output_dir="_site"
    remote="origin"
    remote_branch="pages"
  16. Commit
  17. In Cloudflare, update DNS to
    A @ 217.197.91.145
    AAAA @ 2001:67c:1401:20f0::1
    TXT @ "pages.thisdesignercodes.mariocarabotta.codeberg.page"
  18. For the above, set proxy status as DNS only
  19. Start messing around with Eleventy for realzzzzz

References and credits