I am new to website building and recently found out how to use Github Pages to build my own website on a domain I bought from Google Domains.
I have the photo I want to display in the hero section in the photos folder, titled hero.jpg. However, once I commit to GitHub, the photo doesn't show up.
I noticed that I cannot access hero.jpg at my-site.com/photos/hero.jpg so maybe this is the problem.
Could someone please advise me on the proper way to specify the path to images in HTML using the url function? Right now, I'm trying background: url("assets/photos/hero.jpg")
Thanks so much in advance!
Though i cannot find the said repository as the link is broken, i got similar issue of displaying background image.
This is my project tree structure
-- assets
-- images
-- image.jpg
-- js
-- css
-- styles.css
index.html
My background image didn't display when i did this
background: url("assets/images/image.jpg")
My background image displayed when i did this instead
background: url("../images/image.jpg")
This has worked for me, i hope it works for you.
On everything except OSX and Windows paths are case sensitive. Change the .jpg in your CSS to .JPG or rename the file in your git repo.
Related
I am having trouble getting graphs that I render through .Rmd files to show up on my github.io page. I create the .Rmd file on my computer, use blogdown::serve_site() to create the .html file. The site renders fine with all graphs on my computer. There is a folder for each .html page that has graphs in it, in .png form, on my computer, under /static/portfolio. When I go to put it on github.io, any pictures that I have linked to show up, but all graphs that I have created do not. I figure it is an issue of setting a path correctly, but I cannot figure it out myself. I am using the creative portfolio theme if that makes a difference.
You can find my source code here.
I am using Django web frame work. I am taking pdf files from users (notes/book/etc). Then I want to display those pdf in website, but I could not find a way. Methods that failed 1)iframe 2)simple rendering using django 3)pdf.js library. Also browser blocks rendering initially. Care to suggest a method and steps to implement it.
I the answer to your problem is here :
https://docs.djangoproject.com/en/3.0/howto/outputting-pdf/
Well the answer has to be very very clear here. You can not display pdf using. There is no such library for that. Like pdf.js for javascript based frameworks. I have done the research. So if you want a really good pdf viewer for your django powered website you have to use pdf.js for sure. I have asked people working with django professionally.
output in firefox
ouput in chromium browser
Now 2nd output is what we want
here is the code
I've got a Marzipano sample with all the necessary files and folders. When I open index.html a 360 viewer runs in the browser and everything works fine.
Now I want to get the same thing working inside of Django project.
The directory structure for Marzipano sample looks this:
vendor/
tiles/
img/
data.js
index.html
index.js
styles.css
The only folder I care is tiles, which has many folders with images.
To get this working in Django I have to put those images in the right place in the static folder of Django project.
I tried to figure out where exactly inside of JavaScript files the image paths are set, but unfortunately I have very poor knowledge of JavaScript.
I would be grateful for any advice.
If anyone ever comes across this problem, one way to solve it is through web server configuration. I am working with nginx and I could open a 360 viewer at desired URL by using 'location' directive:
location /gallery-360/ {
root home/user/project;
}
This way there is no need to deal with Django urls, views and static files issues.
I'm working on a Drupal 8.6 multi site installation, where every site has it's own database, and I'm having a problem where the first time a content is shared on Facebook it uses the wrong image.
The meta tag is configured right, it is something like this:
<meta property="og:image" content="https://xxxx.com/image.jpg?itok=w8tMeCC0" />
This image problem happens only at the first share and I believe it happens because the image has not been created yet at the moment of the first share.
I would like to know what I could do to force the image to be generated as soon as the content is published and if there is a way to create all the missing images.
I found this post and I'm trying to implement in a module (I never worked on Drupal before) but I don't even know how to schedule this piece of script to be executed.
Is there an existing module or setting that does that?
Thanks for any help!
Have you tried the facebook Debugger?
https://developers.facebook.com/tools/debug/
Facebook usually stores the metatags in cache during shares. What I usually do is debug the webpage at least once with the right metatags configured in the debugger and ensure the page loads correctly there.
Afterwards, the share will be loading all the assets correctly.
I hope someone can help out with this one. I have been using djangocms to build a simple frontend centric website for a client so they can maintain their own content. There is nothing fancy in this setup. Just a few template.html files, a little css and djangocms to pull it all together. There are no other forms, models, views or anything at this stage. Just pure djangocms.
Originally I was working with django 1.8.6 and the image picker seemed to work fine. I could upload my files and next to each one there is a selector icon which works and all was great. See below image. This was using cmsplugin-filer.
Then I tried to upgrade the website to Django version 1.11.13 and I started to run into this problem. The file select that you see above is no longer available to the user. I have spent days working on this and in my travels I found that apparently cmsplugin-filer is now deprecated. So I removed it and switched to the recommended djangocms-filer install thinking that might solve my problem...but no. After many many hours of head scratching I figured it must be something in my project throwing things out, so I have done a 100% clean install using the prescribed djangocms-installer. Other than connecting it to a postgresql database, it is a completely vanilla installation, and yet it still does not work. All I get is the image below. A simple tick box but no way of selecting the image nor anyway of saving what I have selected. Uploading files is fine and I can create folders and images upload into them perfectly fine.
Below is a snapshot of my pip freeze showing everything installed in my virtualenv and the associated versions.
My settings file is almost 100% standard so I don't understand why I can't get this to work. Note: If, when I am adding the plugin to my template, I don't select the Choose File Button but simply drag an image into the grey rectangle, it all works fine. My file gets uploaded into the unsorted uploads folder and the image is selected into my template all in one go, but using the choose file route, where I have more control over my files and how they are stored, doesn't.
Does anyone have any idea what I might be missing please?
UPDATE:
Django CMS overrides some static files and there are some old ones in your browser cache. You need to clear your caches or open the page using incognito window.