diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f164c3a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,90 @@ +# Sample workflow for building and deploying an Astro site to GitHub Pages +# +# To get started with Astro see: https://docs.astro.build/en/getting-started/ +# +name: Deploy Astro site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +env: + BUILD_PATH: "." # default value when not using subfolders + # BUILD_PATH: subfolder + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + echo "runner=yarn" >> $GITHUB_OUTPUT + echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + echo "runner=npx --no-install" >> $GITHUB_OUTPUT + echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine package manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: ${{ steps.detect-package-manager.outputs.manager }} + cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }} + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + working-directory: ${{ env.BUILD_PATH }} + - name: Build with Astro + run: | + ${{ steps.detect-package-manager.outputs.runner }} astro build \ + --site "${{ steps.pages.outputs.origin }}" \ + --base "${{ steps.pages.outputs.base_path }}" + working-directory: ${{ env.BUILD_PATH }} + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ${{ env.BUILD_PATH }}/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/DECAP_CMS_SETUP.md b/DECAP_CMS_SETUP.md new file mode 100644 index 0000000..5636dcb --- /dev/null +++ b/DECAP_CMS_SETUP.md @@ -0,0 +1,94 @@ +# Decap CMS Setup for ARC Website + +## Overview +This website uses Decap CMS (formerly Netlify CMS) for content management. It allows authorized users to create, edit, and manage blog posts through a web interface. + +## Setup Instructions + +### 1. Enable Netlify Identity +1. Go to your Netlify dashboard +2. Navigate to your site settings +3. Go to "Identity" tab +4. Click "Enable Identity" +5. In Identity settings, configure: + - Registration: "Invite only" (recommended) + - External providers: Enable GitHub, Google, etc. as needed + - Git Gateway: Enable this service + +### 2. Configure Git Gateway +1. In your site's Identity settings +2. Go to "Services" tab +3. Enable "Git Gateway" +4. This allows Decap CMS to commit directly to your GitHub repository + +### 3. Invite Users +1. In Identity tab, click "Invite users" +2. Enter email addresses of content editors +3. They will receive invitation emails + +### 4. Access the CMS +- CMS URL: `https://your-site.netlify.app/admin/` +- Users can log in with their invited credentials +- The CMS will redirect to `/decapcms/` for the actual interface + +## Features + +### Turkish Interface +- All field labels are in Turkish +- Configured for Turkish content creators +- Default author set to "TA1SPH" + +### Blog Post Management +- Create new blog posts +- Edit existing posts +- Upload featured images +- Organize with categories and tags +- Markdown editor for content + +### File Structure +- Blog posts are stored in `src/data/post/` +- Images are stored in `src/assets/images/` +- Posts use the format: `YYYY-MM-DD-slug.md` + +## Configuration Files + +### `/public/decapcms/config.yml` +Main configuration file that defines: +- Backend (Git Gateway) +- Collections (Blog posts) +- Fields and their types +- Media handling + +### `/public/decapcms/index.html` +The CMS interface HTML file + +### `/public/_redirects` +Netlify redirect rules for admin routing + +## Usage + +1. Users navigate to `/admin/` +2. They are redirected to the CMS interface +3. After authentication, they can: + - Create new blog posts + - Edit existing posts + - Upload images + - Manage categories and tags + +## Security + +- Only invited users can access the CMS +- All changes are committed to the main repository +- GitHub Actions will automatically deploy changes +- Content is version-controlled through Git + +## Troubleshooting + +### Common Issues: +1. **Can't log in**: Check if Identity is enabled and user is invited +2. **Can't save posts**: Ensure Git Gateway is enabled +3. **Images not uploading**: Check media folder permissions +4. **Changes not deploying**: Verify GitHub Actions workflow + +### Support +For technical issues, contact the development team or check the Decap CMS documentation at https://decapcms.org/docs/ \ No newline at end of file diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 0000000..4412301 --- /dev/null +++ b/public/_redirects @@ -0,0 +1 @@ +/admin/* /decapcms/index.html 200 \ No newline at end of file diff --git a/public/decapcms/config.yml b/public/decapcms/config.yml index 841a67b..d0e0358 100644 --- a/public/decapcms/config.yml +++ b/public/decapcms/config.yml @@ -5,25 +5,21 @@ backend: media_folder: 'src/assets/images' public_folder: '/_astro' +site_url: https://ym1ktc.github.io/ARC-Web-Sitesi +display_url: https://ym1ktc.github.io/ARC-Web-Sitesi + collections: - name: 'post' - label: 'Post' - folder: 'src/content/post' + label: 'Blog Yazıları' + folder: 'src/data/post' create: true + slug: '{{year}}-{{month}}-{{day}}-{{slug}}' fields: - - { label: 'Title', name: 'title', widget: 'string' } - - { label: 'Excerpt', name: 'excerpt', widget: 'string' } - - { label: 'Category', name: 'category', widget: 'string' } - - { - label: 'Tags', - name: 'tags', - widget: 'list', - allow_add: true, - allow_delete: true, - collapsed: false, - field: { label: 'Tag', name: 'tag', widget: 'string' }, - } - - { label: 'Image', name: 'image', widget: 'string' } - - { label: 'Publish Date', name: 'publishDate', widget: 'datetime', required: false } - - { label: 'Author', name: 'author', widget: 'string' } - - { label: 'Content', name: 'body', widget: 'markdown' } + - { label: 'Başlık', name: 'title', widget: 'string' } + - { label: 'Yayın Tarihi', name: 'date', widget: 'datetime', format: 'YYYY-MM-DD HH:mm:ss' } + - { label: 'Yazar', name: 'author', widget: 'string', default: 'TA1SPH' } + - { label: 'Kategoriler', name: 'categories', widget: 'list', allow_add: true, allow_delete: true, collapsed: false, field: { label: 'Kategori', name: 'category', widget: 'string' } } + - { label: 'Etiketler', name: 'tags', widget: 'list', allow_add: true, allow_delete: true, collapsed: false, field: { label: 'Etiket', name: 'tag', widget: 'string' } } + - { label: 'Düzen', name: 'layout', widget: 'string', default: 'post' } + - { label: 'Öne Çıkan Görsel', name: 'image', widget: 'image', media_folder: '/src/assets/images', public_folder: '~/assets/images', required: false } + - { label: 'İçerik', name: 'body', widget: 'markdown' } diff --git a/public/decapcms/index.html b/public/decapcms/index.html index baab0e4..2554d80 100644 --- a/public/decapcms/index.html +++ b/public/decapcms/index.html @@ -4,11 +4,23 @@ - Content Manager + ARC İçerik Yöneticisi + diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 524a26f..4f353f4 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -35,6 +35,9 @@ const { language, textDirection } = I18N; + + + @@ -44,5 +47,18 @@ const { language, textDirection } = I18N; + + + diff --git a/src/pages/admin.astro b/src/pages/admin.astro new file mode 100644 index 0000000..a329f6f --- /dev/null +++ b/src/pages/admin.astro @@ -0,0 +1,15 @@ +--- +// Redirect to decap CMS +--- + + + + + + + +

Redirecting to CMS...

+ + \ No newline at end of file