Angular-App running with github pages /docs cant find assets

Im trying to host my angular app with github pages.

I build a /docs folder with the command

ng build --output-path docs --base-href /portfolio/


The /assets folder which contains images and the translation-keys for the ngx/translate can't be found.

The /assets folder is at /portfolio/src/assets as usual and I also added it to the /docs folder.

Thats the path I use to call the pictures:


At localhost its working fine.

1 answer

  • answered 2022-04-28 13:52 rohithpoya

    You can build by using the below command

    ng build --output-path docs --base-href

    You should give the complete path for the base href.


    Also please add path for the image like this

    <img class="flag" src="assets/images/flags/de.png">

    Your image is showing in the below path,

    Attaching screenshot,

    enter image description here

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum