Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add small subtitle below title #12

Open
kodehat opened this issue Oct 1, 2024 · 10 comments
Open

Add small subtitle below title #12

kodehat opened this issue Oct 1, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@kodehat
Copy link
Owner

kodehat commented Oct 1, 2024

Could be empty by default (and hidden) and shown when filled.

@kodehat kodehat added the enhancement New feature or request label Oct 1, 2024
@gargantuadev
Copy link

Hello there!
I would like to do it, may you kindly add the hacktoberfest label to the issue and assign it to me? Thankssssss

@kodehat
Copy link
Owner Author

kodehat commented Oct 15, 2024

Hi,
I have already added the hacktoberfest topic to the repository itself, which should be enough to make its issues count for Hacktoberfest. 😉

@gargantuadev
Copy link

Hello again, I tried to install it, but it's giving me issues. Has this been deployed for a Linux Machine?

@kodehat
Copy link
Owner Author

kodehat commented Oct 15, 2024

Yes. Works on Linux/macOS and Windows. Make sure you have followed the hints/instructions in the README.

@gargantuadev
Copy link

I don't know ahah, I installed as it is written, but then honestly I don't know how to start it....
I used air, but it giving some errors, for the frontend I was running the npm run watch (I already did the build), but on my side is not working, do you have any suggestion?

@kodehat
Copy link
Owner Author

kodehat commented Oct 15, 2024

Make sure that you have also generated the HTML user interfaces using templ. Otherwise posting some details regarding the errors you receive, could also help to understand your problems.

@gargantuadev
Copy link

Hello there, I receive this error when I do "air" from the terminal to run the backend (I installed air as suggested in the README):

image

The other problem is (Imho) that build.sh file runs only in Linux and not in Windows. I tried to convert it to a build.bat and tried to change the variable cmd in .air.toml file but does not work either.

When I run air, in the command line I'm seeing this:

  __    _   ___
 / /\  | | | |_)
/_/--\ |_| |_| \_ v1.61.0, built with Go go1.23.2

watching .
!exclude assets
watching docs
watching docs\images
watching internal
watching internal\build
watching internal\components
watching internal\config
watching internal\metrics
watching internal\models
watching internal\server
watching internal\utils
!exclude node_modules
!exclude static
!exclude tmp
building...
CMD will not recognize non .exe file for execution, path: npm run build && templ generate . && build.bat

> [email protected] build
> npm run build:css && npm run build:js


> [email protected] build:css
> tailwindcss -i assets/css/main.css build -m -o static/css/main.css


Rebuilding...

Done in 238ms.

> [email protected] build:js
> esbuild assets/js/main.js --bundle --minify --sourcemap --outfile=static/js/main.js


  static\js\main.js      102.4kb
  static\js\main.js.map  420.3kb

Done in 19ms
(✓) Complete [ updates=5 duration=57.865ms ]
[Go vgo] Building portkey in .\ at  with commit N/A in version dev.
malformed import path "github.com/kodehat/portkey/internal/build.BuildTime=": invalid char '='
malformed import path "-X": leading dash
malformed import path "github.com/kodehat/portkey/internal/build.CommitHash=N/A": invalid char '='
malformed import path "github.com/kodehat/portkey/internal/build.Version=dev": invalid char '='
malformed import path "github.com/kodehat/portkey/internal/build.GoVersion=go": invalid char '='
running...
The system cannot find the file LOGLEVEL=DEBUG.
Process Exit with Code: 1

The cmd that I changed is this:
cmd = "npm run build && templ generate . && build.bat"

And the .bat file is this one:

@echo off
setlocal

REM Define variables
set TARGET_PACKAGE=github.com/kodehat/portkey/internal/build
for /f "tokens=2 delims==" %%i in ('powershell -command "Get-Date -Format yyyy.MM.dd_HH:mm:ss -AsUTC"') do set BUILD_TIME=%%i
set commit_hash=
set version=dev
set go_version=unknown
set output=.\

REM Parse arguments
:parse_args
if "%1"=="" goto args_done
if "%1"=="-o" (
    set output=%2
    shift
) else if "%1"=="-v" (
    set version=%2
    shift
)
shift
goto parse_args
:args_done

REM Get the latest commit hash
for /f %%i in ('git log -1 --pretty=format:%%h 2^>nul') do set commit_hash=%%i
if "%commit_hash%"=="" (
    set commit_hash=N/A
)

REM Get Go version
for /f %%i in ('go version 2^>nul') do (
    for %%j in (%%i) do (
        set go_version=%%j
    )
)

REM Set the ldflags for the build
set FLAG=-X %TARGET_PACKAGE%.BuildTime=%BUILD_TIME%
set FLAG=%FLAG% -X %TARGET_PACKAGE%.CommitHash=%commit_hash%
set FLAG=%FLAG% -X %TARGET_PACKAGE%.Version=%version%
set FLAG=%FLAG% -X %TARGET_PACKAGE%.GoVersion=%go_version%

REM Build the Go binary
echo [Go v%go_version%] Building portkey in %output% at %BUILD_TIME% with commit %commit_hash% in version %version%.
set CGO_ENABLED=0
go build -o "%output%" -ldflags "%FLAG%"

endlocal

@kodehat
Copy link
Owner Author

kodehat commented Oct 19, 2024

Ah, good point. I already thought about issues like this, but as I‘m developing on Linux, I never experienced problems. Just remove LOGLEVEL=DEBUG from the full_bin line in .air.toml. As it‘s just for debug output, it’s not that important.
I will sort this out for Windows in a dedicated issue later.

@gargantuadev
Copy link

No worries, I'm trying to buy a new pc so I can install Linux on it, but on this one I really can't ahah.
I'm still receiving an error:


/ /\ | | | |)
/
/--\ || || _ v1.61.0, built with Go go1.23.2

watching .
!exclude assets
watching docs
watching docs\images
watching internal
watching internal\build
watching internal\components
watching internal\config
watching internal\metrics
watching internal\models
watching internal\server
watching internal\utils
!exclude node_modules
!exclude static
!exclude tmp
building...
CMD will not recognize non .exe file for execution, path: npm run build && templ generate . && build.bat

[email protected] build
npm run build:css && npm run build:js

[email protected] build:css
tailwindcss -i assets/css/main.css build -m -o static/css/main.css

Rebuilding...

Done in 313ms.

[email protected] build:js
esbuild assets/js/main.js --bundle --minify --sourcemap --outfile=static/js/main.js

static\js\main.js 102.4kb
static\js\main.js.map 420.3kb

Done in 25ms
(✓) Complete [ updates=5 duration=93.9812ms ]
[Go vgo] Building portkey in .\ at with commit N/A in version dev.
malformed import path "github.com/kodehat/portkey/internal/build.BuildTime=": invalid char '='
malformed import path "-X": leading dash
malformed import path "github.com/kodehat/portkey/internal/build.CommitHash=N/A": invalid char '='
malformed import path "github.com/kodehat/portkey/internal/build.Version=dev": invalid char '='
malformed import path "github.com/kodehat/portkey/internal/build.GoVersion=go": invalid char '='
running...
CMD will not recognize non .exe file for execution, path: "path_to_portkey\portkey"
'"path_to_portkey\portkey"' is not recognized as an internal or external command,
operable program or batch file.
Process Exit with Code: 1

Still a problem because the .bat probably is not correct somehow :/

@kodehat
Copy link
Owner Author

kodehat commented Oct 20, 2024

I have just changed some stuff in .air.toml by removing usage of build.sh and DEBUG log level, so that local development with air should work across different operating systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants