Removed Air
This commit is contained in:
parent
3200f6d817
commit
d5ca3a2591
14 changed files with 8 additions and 180 deletions
46
.air.toml
46
.air.toml
|
@ -1,46 +0,0 @@
|
|||
root = "."
|
||||
testdata_dir = "testdata"
|
||||
tmp_dir = "tmp"
|
||||
|
||||
[build]
|
||||
args_bin = ["-ip", "127.0.0.1", "-port", "3000"]
|
||||
bin = "./tmp/main"
|
||||
pre_cmd = []
|
||||
cmd = "cd lib/stylegen && ./gen.sh -e html -d ../../pages/templates -o ../../public/css && cd ../.. && go build -o ./tmp/main ."
|
||||
delay = 1000
|
||||
exclude_dir = ["assets", "tmp", "vendor", "testdata", "lib/stylegen"]
|
||||
exclude_file = []
|
||||
exclude_regex = ["_test.go"]
|
||||
exclude_unchanged = false
|
||||
follow_symlink = false
|
||||
full_bin = ""
|
||||
include_dir = []
|
||||
include_ext = ["go", "tpl", "tmpl", "html"]
|
||||
include_file = []
|
||||
kill_delay = "0s"
|
||||
log = "build-errors.log"
|
||||
poll = false
|
||||
poll_interval = 0
|
||||
post_cmd = []
|
||||
rerun = false
|
||||
rerun_delay = 500
|
||||
send_interrupt = false
|
||||
stop_on_error = false
|
||||
|
||||
[color]
|
||||
app = ""
|
||||
build = "yellow"
|
||||
main = "magenta"
|
||||
runner = "green"
|
||||
watcher = "cyan"
|
||||
|
||||
[log]
|
||||
main_only = false
|
||||
time = false
|
||||
|
||||
[misc]
|
||||
clean_on_exit = false
|
||||
|
||||
[screen]
|
||||
clear_on_rebuild = false
|
||||
keep_scroll = true
|
|
@ -14,5 +14,4 @@ This is my personal website!
|
|||
1. Run ```go get```
|
||||
2. Duplicate the .env.example file and call it .env
|
||||
3. Fill out the required .env values
|
||||
4. Run ```go install github.com/cosmtrek/air@latest``` to download Air for live reload
|
||||
5. Run ```air``` to start the dev server (macOS and Linux only)
|
||||
4. Run ```go run main.go```
|
||||
|
|
1
go.mod
1
go.mod
|
@ -19,6 +19,7 @@ require (
|
|||
)
|
||||
|
||||
require (
|
||||
github.com/atridadl/daisygen v0.1.7
|
||||
github.com/disintegration/imaging v1.6.2
|
||||
github.com/fatih/color v1.17.0
|
||||
github.com/gorilla/feeds v1.2.0
|
||||
|
|
2
go.sum
2
go.sum
|
@ -6,6 +6,8 @@ github.com/alecthomas/chroma/v2 v2.14.0/go.mod h1:QolEbTfmUHIMVpBqxeDnNBj2uoeI4E
|
|||
github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
|
||||
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
|
||||
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
github.com/atridadl/daisygen v0.1.7 h1:k6h8C79W5ZL22vhnSLF+0Z025VCW4pAXAEsRPD3A6H4=
|
||||
github.com/atridadl/daisygen v0.1.7/go.mod h1:SPMjjfhhVg7Fgtw1NUGDBHOT8+NuPeUsEICkFkYOzRc=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
|
14
lib/stylegen/base.css
vendored
14
lib/stylegen/base.css
vendored
|
@ -1,14 +0,0 @@
|
|||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base {
|
||||
html,
|
||||
container,
|
||||
body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
position: fixed;
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# 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
|
||||
|
||||
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")
|
||||
ARCH="arm64"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
# Construct the binary file name
|
||||
BINARY="./tw/${OS}-${ARCH}"
|
||||
if [ "$OS" = "windows" ]; then
|
||||
BINARY="${BINARY}.exe"
|
||||
else
|
||||
# Set execute permissions on the binary
|
||||
chmod +x $BINARY
|
||||
fi
|
||||
|
||||
echo "Extensions: $EXTENSIONS"
|
||||
echo "Directory: $DIRECTORY"
|
||||
echo "Output Directory: $OUTPUT_DIR"
|
||||
|
||||
# Set default values if not provided
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-../../public/css}"
|
||||
DIRECTORY="${DIRECTORY:-.}"
|
||||
|
||||
if [[ -z "$EXTENSIONS" ]]; then
|
||||
echo "No extensions provided."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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"
|
||||
|
||||
# Optionally, remove leading './' if necessary
|
||||
INCLUDE_FILES=$(echo "$INCLUDE_FILES" | sed 's|^\./||')
|
||||
|
||||
INCLUDE_FILES_ARRAY=$(echo "$INCLUDE_FILES" | awk '{printf "\"%s\",", $0}' | sed 's/,$//')
|
||||
|
||||
# Generate Tailwind config
|
||||
echo "module.exports = {
|
||||
content: [$INCLUDE_FILES_ARRAY],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
daisyui: {
|
||||
themes: [\"night\"],
|
||||
},
|
||||
plugins: [require('daisyui'), require('@tailwindcss/typography')],
|
||||
}" > tailwind.config.js
|
||||
|
||||
# Delete original CSS file if it exists
|
||||
rm -f "${OUTPUT_DIR}/styles.css"
|
||||
|
||||
# Run the binary with the generated config
|
||||
$BINARY build -i ./base.css -c tailwind.config.js -o "${OUTPUT_DIR}/styles.css" --minify
|
||||
|
||||
# Wait for all background processes to finish
|
||||
wait
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3
main.go
3
main.go
|
@ -10,6 +10,7 @@ import (
|
|||
"atri.dad/lib"
|
||||
"atri.dad/pages"
|
||||
|
||||
daisygen "github.com/atridadl/daisygen/generator"
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
|
@ -22,6 +23,8 @@ func main() {
|
|||
// Load environment variables
|
||||
godotenv.Load(".env")
|
||||
|
||||
daisygen.Generate("html", "./pages/templates", "./public/css")
|
||||
|
||||
// Initialize Echo router
|
||||
e := echo.New()
|
||||
|
||||
|
|
2
public/css/styles.css
vendored
2
public/css/styles.css
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue