Is it possible to set the location of the done and close buttons to something other than the root.

275 views
Skip to first unread message

Richard Coady

unread,
Apr 3, 2020, 11:46:54 AM4/3/20
to codelab-authors
Hi,

We are trying to do one of the following 

1. Set the location of the done url is this possible?

2. If 1 is not possible is it possible to hide the done button and close button at the top

We can do by modifying the pages but really want to avoid doing this if at all possible.

Thanks
Richard

Andrea Galliani

unread,
Oct 20, 2020, 11:13:14 AM10/20/20
to codelab-authors
I have the same problem. At least I would hide the "done" button, but actually I didn't find anything...how did you resolved ?

Wu-chang Feng

unread,
Oct 20, 2020, 12:28:56 PM10/20/20
to Andrea Galliani, codelab-authors
If you're using the site tools to generate a landing page for your codelabs, I believe the "Done" and the "X" are set up to return you to that page by default.  Otherwise, I believe it will go to '/' on the web server hosting the codelab.  I think it can be overridden using the flags shown in "claat -h"

Wu-chang

--
You received this message because you are subscribed to the Google Groups "codelab-authors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codelab-autho...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/codelab-authors/49351c48-79fd-4a50-ae31-aed0ad3d5e9en%40googlegroups.com.

Josimar M. Rocha

unread,
Oct 20, 2020, 7:52:16 PM10/20/20
to codelab-authors
Hi.
I modified the codelab buttons (I translated and also modified the original link). This is what you want?
You will see that the link to the "Done" ("Terminar") button is from a page that I put together with the codelab index: it is "josimar.html" page (https://github.com/jos1mar/jos1mar.github.io)
I couldn't get this link to work properly, but I changed the link 😀
PS: the codelab you will see is a test. The only useful thing about it is the modified buttons. I don't know why it is opening in the last section. I was learning to work with codelabs but I had to take a break (or give up?) 😕
If it helps you I can explain what I did.
--

code...@gmail.com

unread,
Oct 21, 2020, 10:46:55 AM10/21/20
to codelab-authors
So I can see that your "Done" button has a new link.  What file did you edit to make this work?  Was the file "codelab-elements.js"?

Just sharing some thoughts,  I can see that you have the native-shim.js, custom-elements.js, prettify.js, and codelab-elements.js located in your 'img' folder.  I think most people when they run the tutorial, myself included, leave it to the default settings which will fetch those files from  "https://storage.googleapis.com".  So I believe if you need to use the prefix with claat -prefix to point to where you are storing them or change the template file.

As for the template file, I noticed when running the help from claat -h, as Wu-chang mentioned, there is a note not to use the default templates and you should specify a local file path to a Go template file, but does not state how or where to do so.  But looking at the claat/render/template.html you can see that it uses the claat -prefix to update the html to point to your javascript files, (I think)




So I do not know if someone can confirm a few things:
1. What files can be edited to change the codelab pages when generated.
2. Whether you will have to recompile claat from the source or can use the released bin file to use those changes
3. How to change the location for the template file. 

I think with that information we should be able to update the return location for the X and Done buttons.  or at least get a little closer :)

Thanks

Sean

Josimar M. Rocha

unread,
Oct 21, 2020, 11:26:40 AM10/21/20
to codelab-authors
Hi.
Yes, I edited the file "codelab-elements.js", this is where the buttons are.
I did the following:
1. the index.html file generated by Claat depends on this file: "https://storage.googleapis.com/codelab-elements/codelab-elements.js"
2. I suppose it is not possible to edit the file "codelab-elements.js"
3. So I manually changed the index.html replacing "https://storage.googleapis.com/codelab-elements/" with "img /"
4. I created the folder "img", as seen here: https://github.com/jos1mar/jos1mar.github.io
5. I downloaded all the files at "https://storage.googleapis.com/codelab-elements/" and put it in the "img /" folder
6. I changed the file "codelab-elements.js" in the region where the tag "<a href="#" id="menu">" appears
That's what I did.

Alexander Ivanov ✔

unread,
Dec 29, 2020, 12:40:31 PM12/29/20
to codelab-authors
I absolutely don't see any useful loading in such actions. It looks like claat is a google codelabs creation tool and its not supported any independent project for full customization.

Alexander Ivanov ✔

unread,
Jan 26, 2021, 10:31:15 PM1/26/21
to codelab-authors
OK.

I figured out a bit about the source codes.

How can I pass my variable to a soy file?

Reply all
Reply to author
Forward
0 new messages