From 57aba37be1c26e62d50132f835d82ab029ae30c7 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Sat, 1 Feb 2025 03:32:29 -0600 Subject: [PATCH] No tailwind D: --- Makefile | 26 +--- content/favourite_tools_list.md | 9 +- lib/stylegen/base.css | 14 -- lib/stylegen/gen.sh | 137 ----------------- pages/templates/home.html | 8 +- pages/templates/layouts/base.html | 7 +- pages/templates/layouts/post.html | 5 +- pages/templates/partials/header.html | 10 +- public/css/base.css | 65 ++++++++ public/css/components.css | 148 ++++++++++++++++++ public/css/layout.css | 87 +++++++++++ public/css/prose.css | 222 +++++++++++++++++++++++++++ 12 files changed, 551 insertions(+), 187 deletions(-) delete mode 100644 lib/stylegen/base.css delete mode 100755 lib/stylegen/gen.sh create mode 100644 public/css/base.css create mode 100644 public/css/components.css create mode 100644 public/css/layout.css create mode 100644 public/css/prose.css diff --git a/Makefile b/Makefile index 8629f91..a6694fd 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,7 @@ DOCS := 📚 BINARY_NAME := atri.dad DOCKER_IMAGE := atri-dot-dad GO_FILES := $(wildcard *.go) -CSS_INPUT := lib/stylegen/base.css -CSS_OUTPUT := public/css/styles.css +# CSS files are now static and don't need generation # Docker detection DOCKER_ENV := $(shell if [ -f /.dockerenv ]; then echo true; else echo false; fi) @@ -48,9 +47,7 @@ ensure-swag: reset: @echo "$(CLEAN) Performing complete project reset..." @rm -f $(BINARY_NAME) - @rm -f $(CSS_OUTPUT) - @rm -rf public/css/* - @rm -f tailwind.config.js + @rm -rf public/css/styles.css @rm -rf docs/docs.go docs/swagger.json docs/swagger.yaml @go clean -cache -testcache -modcache @rm -rf $(BASE_PATH)/tw # Remove the 'tw' directory @@ -59,31 +56,16 @@ reset: clean: @echo "$(CLEAN) Cleaning build artifacts..." @rm -f $(BINARY_NAME) - @rm -f $(CSS_OUTPUT) - @rm -rf $(BASE_PATH)/lib/stylegen/tw # Remove the 'tw' directory + @rm -f public/css/styles.css @echo "$(CHECK) Cleanup complete" -stylegen: - @echo "$(CSS) Generating CSS styles..." - @echo "Current working directory: $$(pwd)" - @echo "Contents of current directory:" - @ls -la - @echo "\nContents of lib/stylegen:" - @ls -la lib/stylegen - @chmod +x $(BASE_PATH)/lib/stylegen/gen.sh - @$(BASE_PATH)/lib/stylegen/gen.sh \ - -e "html" \ - -d "$(BASE_PATH)/pages/templates" \ - -o "$(BASE_PATH)/public/css" - @echo "$(CHECK) CSS generation complete" - swaggergen: ensure-swag @echo "$(DOCS) Generating Swagger documentation..." @swag init @echo "$(CHECK) Swagger docs generated" # Combined generation target -generate: stylegen swaggergen +generate: swaggergen build: generate @echo "$(BUILD) Building binary..." diff --git a/content/favourite_tools_list.md b/content/favourite_tools_list.md index 3bd9a28..a6d6444 100644 --- a/content/favourite_tools_list.md +++ b/content/favourite_tools_list.md @@ -15,4 +15,11 @@ I change what I use _constantly_ in order to find something that feels just righ 7. Dataflare - A simple but powerful cross-platform database client. Supports most common databases, including LibSQL which is rare! 8. Bruno - A simple and powerful API client, similar to Postman. An critical tool to debug API endpoints. -I hope you found this helpful! This will be periodically updated to avoid outdated recommendations. \ No newline at end of file +I hope you found this helpful! This will be periodically updated to avoid outdated recommendations. + +```javascript +let x = 2; +console.log(x); +``` +## H2 +### H3 \ No newline at end of file diff --git a/lib/stylegen/base.css b/lib/stylegen/base.css deleted file mode 100644 index e21092c..0000000 --- a/lib/stylegen/base.css +++ /dev/null @@ -1,14 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer base { - html, - container, - body { - height: 100%; - width: 100%; - overflow-y: auto; - position: fixed; - } -} diff --git a/lib/stylegen/gen.sh b/lib/stylegen/gen.sh deleted file mode 100755 index 77ae8ef..0000000 --- a/lib/stylegen/gen.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env bash - -# Define the version of the binary to download -VERSION="v1.7.27" - -# Parse command-line arguments -while [[ $# -gt 0 ]]; do - case $1 in - -e|--extensions) - EXTENSIONS="$2" - shift; shift - ;; - -d|--directory) - DIRECTORY="$2" - shift; shift - ;; - -o|--output-dir) - OUTPUT_DIR="$2" - shift; shift - ;; - *) - echo "Unknown argument: $1" - exit 1 - ;; - esac -done - -# Get the directory where this script is located -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -echo "Script directory: $SCRIPT_DIR" - -OS=$(uname -s) -ARCH=$(uname -m) - -# Normalize OS and ARCH identifiers -case $OS in - "Darwin") - OS="macos" - ;; - "Linux") - OS="linux" - ;; - "CYGWIN"*|"MINGW"*|"MSYS"*) - OS="windows" - ;; - *) - echo "Unknown operating system: $OS" - exit 1 - ;; -esac - -case $ARCH in - "x86_64") - ARCH="x64" - ;; - "arm64"|"aarch64") - ARCH="arm64" - ;; - *) - echo "Unsupported architecture: $ARCH" - exit 1 - ;; -esac - -echo "Detected OS: $OS" -echo "Detected Architecture: $ARCH" - -# Function to construct the binary download URL based on version, OS, and architecture -get_binary_url() { - echo "https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/$VERSION/tailwindcss-extra-$OS-$ARCH" -} - -# Create the 'tw' directory for storing the downloaded binary -TW_DIR="${SCRIPT_DIR}/tw" -mkdir -p "$TW_DIR" - -# Set the binary path -BINARY="${TW_DIR}/tailwindcss-extra-${OS}-${ARCH}" - -# Check if the binary is already downloaded, otherwise download it -if [ ! -f "$BINARY" ]; then - echo "Binary not found, downloading version $VERSION..." - - DOWNLOAD_URL=$(get_binary_url) - - if [ -z "$DOWNLOAD_URL" ]; then - echo "No suitable release found for this OS and architecture." - exit 1 - fi - - # Download the binary - curl -L "$DOWNLOAD_URL" -o "$BINARY" - echo "Downloaded binary to: $BINARY" -fi - -# Make the binary executable -chmod +x "$BINARY" - -echo "Using binary: $BINARY" -echo "Extensions: $EXTENSIONS" -echo "Directory: $DIRECTORY" -echo "Output Directory: $OUTPUT_DIR" - -# Initialize an array for name conditions -name_conditions=() - -# Assuming $EXTENSIONS is a comma-separated list of extensions -IFS=',' read -ra ADDR <<< "$EXTENSIONS" -for ext in "${ADDR[@]}"; do - name_conditions+=(-name "*.$ext") -done - -# Use find with the array of conditions -INCLUDE_FILES=$(find "$DIRECTORY" -type f \( "${name_conditions[@]}" \)) - -echo "Files found: $INCLUDE_FILES" - -INCLUDE_FILES_ARRAY=$(echo "$INCLUDE_FILES" | awk '{printf "\"%s\",", $0}' | sed 's/,$//') - -# Generate Tailwind config in script directory -CONFIG_FILE="${SCRIPT_DIR}/tailwind.config.js" -echo "module.exports = { - content: [$INCLUDE_FILES_ARRAY], - theme: { - extend: {}, - }, - daisyui: { - themes: [\"night\"], - }, - plugins: [require('daisyui'), require('@tailwindcss/typography')], -}" > "$CONFIG_FILE" - -# Run the binary with the generated config -"$BINARY" build -i "${SCRIPT_DIR}/base.css" -c "$CONFIG_FILE" -o "${OUTPUT_DIR}/styles.css" --minify - -# Wait for all background processes to finish -wait diff --git a/pages/templates/home.html b/pages/templates/home.html index 7f9448f..49f91ee 100644 --- a/pages/templates/home.html +++ b/pages/templates/home.html @@ -17,7 +17,7 @@ Atridad Lahiji // Root {{define "main"}}

- {{.Title}} + {{.Title}}

@@ -26,7 +26,7 @@ Atridad Lahiji // Root

Places I exist:

-
+