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