- Notifications
You must be signed in to change notification settings - Fork1
⭕️ AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.
License
huynguyengl99/django-astrowind
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Fork fromAstrowind
Django AstroWind is a free and open-source template to make your website usingAstro 4.0 +Tailwind CSS +Django headless CMS. Ready to start a new project and designed taking into account web best practices.
Everything of Astrowind plus:
- ✅Multi language supports.
- ✅Switch language supports.
- ✅Django headless CMS integration.
https://django-astrowind.netlify.app/
If you haven't launched the
Django-headless-cms
backend yet, please refer to theIntroduction and follow the tutorials.Create a
.env
file from the.env.TEMPLATE file,then input your created CMS API key from your backend to VITE_CMS_API_KEY.
NOTE: VITE_CMS_API_KEY is required to fetch content, don't forget to get that one from backend.
- Install the required packages:
npm install
- Run the following command to sync api schema (located atsrc/schemas/), schema type (located atsrc/types/) and the content (located atsrc/contents/auto-*):
npm run sync:all
- If you want to sync content only, run this command:
npm run sync:content
- Run the following command to start the server:
npm run dev
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install | Installs dependencies |
npm run dev | Starts local dev server atlocalhost:3000 |
npm run build | Build your production site to./dist/ |
npm run sync:content | Sync your content from backend API (cache) |
npm run sync:schema | Sync your schema from backend |
npm run sync:type | Sync your type with backend API |
npm run sync:all | Sync schema, type & content from backend API |
npm run preview | Preview your build locally, before deploying |
npm run format | Format codes with Prettier |
npm run lint:eslint | Run Eslint |
npm run astro ... | Run CLI commands likeastro add ,astro preview |
Basic configuration file:./src/config.yaml
site:name:'Example'site:'https://example.com'base:'/'# Change this if you need to deploy to Github Pages, for exampletrailingSlash:ignoregoogleSiteVerificationId:false# Or some value,apps:blog:isEnabled:truepostsPerPage:6post:isEnabled:truepermalink:'/%slug%'# Variables: %slug%, %year%, %month%, %day%, %hour%, %minute%, %second%, %category%robots:index:truelist:isEnabled:truepathname:'blog'# Blog main path, you can change this to "articles" (/articles)robots:index:truecategory:isEnabled:truepathname:'blog/category'# Category main path /category/some-category, you can change this to "group" (/group/some-category)robots:index:truetag:isEnabled:truepathname:'blog/tag'# Tag main path /tag/some-tag, you can change this to "topics" (/topics/some-category)robots:index:falseisRelatedPostsEnabled:truerelatedPostsCount:4analytics:vendors:googleAnalytics:id:null# or "G-XXXXXXXXXX"ui:theme:'system'# Values: "system" | "light" | "dark" | "light:only" | "dark:only"tokens:default:fonts:sans:InterVariableserif:InterVariableheading:InterVariablecolors:default:rgb(16 16 16)heading:rgb(0 0 0)muted:rgb(16 16 16 / 66%)bgPage:rgb(255 255 255)primary:rgb(1 97 239)secondary:rgb(1 84 207)accent:rgb(109 40 217)dark:fonts:{}colors:default:rgb(229 236 246)heading:rgb(247, 248, 248)muted:rgb(229 236 246 / 66%)bgPage:rgb(3 6 32)primary:rgb(1 97 239)secondary:rgb(1 84 207)accent:rgb(109 40 217)
Languages settings file located atsrc/utils/languages.ts. Update yourDEFAULT_LANG
andLANGUAGE_MAP
to your desired target languages:
// Update your default language targetexportconstDEFAULT_LANG='en';// Uncomment the below to choose your desired languagesexportconstLANGUAGE_MAP={en:'English',// af: 'Afrikaans', ...}
NOTE: Make sure you have deployed your
Django-headless-cms
backend. Then, create aCMS API key and save it for your deployment. Next, update your backend server URL in theProduction settings.
- Update your.env file (or export the environment variables):
VITE_CMS_API_KEY=your-production-keyVITE_CMS_API_URL=https://your-production.url
-You can create an optimized production build with:
VITE_APP_ENV=production npm run build
- Now, your website is ready to be deployed. All generated files are located at
dist
folder, which you can deploy the folder to any hosting service youprefer.
NOTE: Deployment to Vercel has not yet been updated to include the abilityto fetch content and cache it. If you have knowledge about this, please feel free to contribute. Thank you!
Clone this repository on own GitHub account and deploy to Netlify:
When deploying to Netlify, don't forget to addVITE_CMS_API_KEY
andVITE_CMS_API_URL
to your environmentvariables on the dashboard or use the CLI.
If you update the auto schema section insrc/content/config.ts, don't forget to add orupdate it in thecache-django-astrowind Netlify plugin.
Clone this repository on own GitHub account and deploy to Vercel:
- Why?
If you have any idea, suggestions or find any bugs, feel free to open a discussion, an issue or create a pull request.That would be very useful for all of us and we would be happy to listen and take action.
Initially created byonWidget and maintained by a community ofcontributors. Fork and edited byHuy Nguyen
Django AstroWind is licensed under the MIT license — see theLICENSE file for details.
About
⭕️ AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- Astro56.6%
- TypeScript34.4%
- JavaScript6.5%
- CSS1.2%
- Handlebars0.9%
- HTML0.2%
- MDX0.2%