Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

⭕️ AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.

License

NotificationsYou must be signed in to change notification settings

huynguyengl99/django-astrowind

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.
Table of Contents

Demo

https://django-astrowind.netlify.app/

Getting Started

  • If you haven't launched theDjango-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
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

Commands

All commands are run from the root of the project, from a terminal:

CommandAction
npm installInstalls dependencies
npm run devStarts local dev server atlocalhost:3000
npm run buildBuild your production site to./dist/
npm run sync:contentSync your content from backend API (cache)
npm run sync:schemaSync your schema from backend
npm run sync:typeSync your type with backend API
npm run sync:allSync schema, type & content from backend API
npm run previewPreview your build locally, before deploying
npm run formatFormat codes with Prettier
npm run lint:eslintRun Eslint
npm run astro ...Run CLI commands likeastro add,astro preview

Configuration

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',  ...}

Deploy

Predeploy

NOTE: Make sure you have deployed yourDjango-headless-cms backend. Then, create aCMS API key and save it for your deployment. Next, update your backend server URL in theProduction settings.

Deploy to production (manual)

  • 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 atdist 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!

Deploy to Netlify

Clone this repository on own GitHub account and deploy to Netlify:

Netlify Deploy button

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.

Deploy to Vercel

Clone this repository on own GitHub account and deploy to Vercel:

Deploy with Vercel


Frequently Asked Questions

  • Why?

Contributing

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.

Acknowledgements

Initially created byonWidget and maintained by a community ofcontributors. Fork and edited byHuy Nguyen

License

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Astro56.6%
  • TypeScript34.4%
  • JavaScript6.5%
  • CSS1.2%
  • Handlebars0.9%
  • HTML0.2%
  • MDX0.2%

[8]ページ先頭

©2009-2025 Movatter.jp