Edit index file (or any other file after upload)
halterbaik.pages.dev this is my page. This is my trial page because my first time using it. I want to know can i edit the index file? Because i need to change the google verification site and the canonical of the page. THanks
18 Replies
Pages isn't too much of a traditional host, it's not meant to be used as a "file locker". You cannot edit specific files, or download content back, you can only upload everything again as a new version.
You mentioned in general-discussions you used wrangler (I think?). When you first did
wrangler pages deploy <dir>
, it uploaded your entire directory. You just need to edit those files, and repeat the same command. It'll take care of finding what changed and only reuploading what is needed for you, and create a new deployment.
If you didn't use wrangler and instead uploaded everything via the dashboard, you'd just reupload everything again that way with the changes made.
If you used Git-based project a (Github repo, for example), you'd just commit the changes there and Pages CI/CD would run and build them.YEs i upload everything via the dashboard, so it means i can reupload anything on the same sites? for example halterbaik.pages.dev, i can just reupload the index.html file?
You need to reupload all files, even if they have not changed. If you only reupload index.html, that would be the only file your website would have. For example, you need to include your logo-pentaslot.webp, fav.png, etc
So i reupload here ?
That would be creating a new one, select your current Pages Project under Pages & Workers, and then you'll find create new deployment
(This is one of the reasons why using Github/a git-based project is recommended, it makes this a lot easier, but if you can't, Direct Upload still works fine)
I cant find the new deployment
I only find ddelete deployment on the manage deployment tab
go back to the Pages Project Deployments tab
don't go inside of a deployment
it's just in the default page of a Direct Upload Pages Project
Ah okey thank you so much
So i just need to reupload everything there right?
yea, like you did with the first deploy, but with the changes
Ok thank you, so its easier if i upload via github ?
It's easier to use a Github based project, yea. You can just commit the changes you make, and Pages will build your repo (if it's just html/css/etc, it just pulls down the repo and uploads it)
You commit the change on github, and pages will automatically update it?
Indeed, Pages watches for changes and runs a build on any commit (by default, exact behavior is configurable)
(It's Technically more accurate to say Github notifies Pages of any changes (via Webhooks) and then the build is run, but that's all done for you when you link the Github Repo)
I have question @Chaika can you tell me why when I uploaded new deployment. why does the url still use old build?
Please make your own post