mirror of
https://github.com/Django-LiveView/docs.git
synced 2025-12-14 14:36:28 +01:00
Update links and add deploy script
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
73
deploy.sh
Executable file
73
deploy.sh
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "========================================="
|
||||
echo "Django LiveView Docs - Build & Deploy"
|
||||
echo "========================================="
|
||||
|
||||
# Colors for output
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Configuration
|
||||
REMOTE_USER="debian"
|
||||
REMOTE_HOST="home.server"
|
||||
REMOTE_PATH="/home/debian/www/django-liveview-docs/public"
|
||||
LOCAL_BUILD_PATH="./public/"
|
||||
|
||||
# Check if remote directory has correct permissions
|
||||
if ! ssh "${REMOTE_USER}@${REMOTE_HOST}" "test -w ${REMOTE_PATH}" 2>/dev/null; then
|
||||
echo -e "${YELLOW}WARNING: No write permissions on ${REMOTE_PATH}${NC}"
|
||||
echo -e "${YELLOW}Please run this command on ${REMOTE_HOST}:${NC}"
|
||||
echo -e "${BLUE} sudo chown -R ${REMOTE_USER}:${REMOTE_USER} ${REMOTE_PATH}${NC}"
|
||||
echo ""
|
||||
read -p "Press ENTER after fixing permissions, or Ctrl+C to cancel..."
|
||||
fi
|
||||
|
||||
# Step 1: Build the documentation
|
||||
echo -e "\n${BLUE}[1/3]${NC} Building documentation with Emacs..."
|
||||
docker compose up one-el --build
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED}✗ Build failed!${NC}"
|
||||
exit 1
|
||||
fi
|
||||
echo -e "${GREEN}✓ Build completed${NC}"
|
||||
|
||||
# Step 2: Verify build output
|
||||
echo -e "\n${BLUE}[2/3]${NC} Verifying build output..."
|
||||
if [ ! -d "$LOCAL_BUILD_PATH" ]; then
|
||||
echo -e "${RED}✗ Build directory not found: $LOCAL_BUILD_PATH${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FILE_COUNT=$(find "$LOCAL_BUILD_PATH" -type f | wc -l)
|
||||
echo -e "${GREEN}✓ Found $FILE_COUNT files to deploy${NC}"
|
||||
|
||||
# Step 3: Deploy to server
|
||||
echo -e "\n${BLUE}[3/3]${NC} Deploying to $REMOTE_HOST..."
|
||||
|
||||
# Create a temporary directory on remote
|
||||
TEMP_DIR="/tmp/django-liveview-docs-deploy-$$"
|
||||
ssh "${REMOTE_USER}@${REMOTE_HOST}" "mkdir -p ${TEMP_DIR}"
|
||||
|
||||
# Copy files to temp directory
|
||||
echo -e "${BLUE}Copying files...${NC}"
|
||||
scp -rq "${LOCAL_BUILD_PATH}"* "${REMOTE_USER}@${REMOTE_HOST}:${TEMP_DIR}/"
|
||||
|
||||
# Move files to final destination
|
||||
echo -e "${BLUE}Installing files...${NC}"
|
||||
ssh "${REMOTE_USER}@${REMOTE_HOST}" "bash -c 'rm -rf ${REMOTE_PATH}/* && mv ${TEMP_DIR}/* ${REMOTE_PATH}/ && rmdir ${TEMP_DIR}'"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED}✗ Deploy failed!${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}=========================================${NC}"
|
||||
echo -e "${GREEN}✓ Deployment completed successfully!${NC}"
|
||||
echo -e "${GREEN}=========================================${NC}"
|
||||
echo -e "\nDocs are now live at: ${BLUE}https://docs.djangoliveview.dev${NC}"
|
||||
6
one.org
6
one.org
@@ -164,7 +164,7 @@ application = ProtocolTypeRouter({
|
||||
- ~data-room~ on ~<html>~ — unique identifier for WebSocket room (user-specific or shared)
|
||||
- ~data-controller="page"~ on ~<body>~ — activates the Stimulus controller
|
||||
|
||||
We strongly recommend that you follow the [[#/tutorial/][Tutorial]] to see the installation in action.
|
||||
We strongly recommend that you follow the [[#/quick-start/][Quick start]] to see the installation in action.
|
||||
|
||||
* Handlers
|
||||
:PROPERTIES:
|
||||
@@ -803,8 +803,6 @@ This project is maintained by [[https://andros.dev][Andros Fenollosa]] in his fr
|
||||
|
||||
Welcome to the quick start. Here you will learn how to create your first real-time SPA using Django LiveView. I assume you have a basic understanding of Django and Python.
|
||||
|
||||
All the steps are applied in a [[https://github.com/Django-LiveView/minimal-template][minimalist template]].
|
||||
|
||||
** Step 1: Installation
|
||||
|
||||
#+BEGIN_SRC sh
|
||||
@@ -946,8 +944,6 @@ python manage.py runserver
|
||||
|
||||
That's it! Click the button and see real-time updates. 🎉
|
||||
|
||||
You can also interact with the [[https://django-liveview-demo-minimal-template.andros.dev/][online demo]].
|
||||
|
||||
Congratulations! You have created your first real-time SPA using Django LiveView.
|
||||
|
||||
* Source code
|
||||
|
||||
2
onerc.el
2
onerc.el
@@ -100,7 +100,7 @@
|
||||
(:li.nav-main__item
|
||||
(:a.button.nav-main__link (@ :href "/docs/install/" :class ,(when (string= "docs" navigator-active) class-name-navigator-active)) "📚 Docs"))
|
||||
(:li.nav-main__item
|
||||
(:a.button.nav-main__link (@ :href "/tutorial/" :class ,(when (string= "tutorial" navigator-active) class-name-navigator-active)) "🎓 Tutorial"))
|
||||
(:a.button.nav-main__link (@ :href "/quick-start/" :class ,(when (string= "tutorial" navigator-active) class-name-navigator-active)) "🎓 Quick start"))
|
||||
(:li.nav-main__item
|
||||
(:a.button.nav-main__link (@ :href "/books/" :class ,(when (string= "books" navigator-active) class-name-navigator-active)) "📖 Books"))
|
||||
(:li.nav-main__item
|
||||
|
||||
Reference in New Issue
Block a user