From 6b29dccaef08f62994da2a0db955dce5ad0245fc Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Sat, 6 Dec 2025 11:17:20 +0100 Subject: [PATCH] Update links and add deploy script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- deploy.sh | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ one.org | 6 +---- onerc.el | 2 +- 3 files changed, 75 insertions(+), 6 deletions(-) create mode 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..ab75796 --- /dev/null +++ b/deploy.sh @@ -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}" diff --git a/one.org b/one.org index c0759c6..f2bbbbd 100644 --- a/one.org +++ b/one.org @@ -164,7 +164,7 @@ application = ProtocolTypeRouter({ - ~data-room~ on ~~ — unique identifier for WebSocket room (user-specific or shared) - ~data-controller="page"~ on ~~ — 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 diff --git a/onerc.el b/onerc.el index 21cad46..2b313a6 100644 --- a/onerc.el +++ b/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