-
Notifications
You must be signed in to change notification settings - Fork 21
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
Preview local custom HTML pages #90
Comments
Hi there. Dugway takes all of its data from live Big Cartel stores, so to preview your reseller page you'd need to add it to a real store on bigcartel.com and then point your theme's config.ru subdomain to it. This is a clever idea though, so I'll mark this as a feature request for consideration. |
Hi and thanks for your answer. It was my first guess but my store is now on maintenance mode. When the dugway server tries to fetch data from a live store in maintenance mode, the terminal throws a bunch of errors, and it makes sense to forbid access to closed stores data. A workaround would be to allow access with a login and a password in the theme’s config.ru. Should I open a specific issue with the thrown errors? |
Yeah, Dugway uses the Big Cartel read-only API which doesn't provide data on accounts in maintenance mode. I think it'd be a good additional feature request if you'd like to write up a new issue, but it would impact a few things. Namely storing sensitive info in config.ru and committing that to version control, but that can all be worked around. |
Can I back up to the original issue/question? I created an "about" page on my bigcartel site and created an about.html document in my source directory. when i access Can someone point me where in the source code to look for that? |
@pjv Can you clarify exactly what you expect the behavior to be? Dugway (and the Big Cartel platform in general) understand a limited subset of pages. Anything beyond the default set is considered a custom page and the content for those pages is pulled from the store which you configure dugway to point at. It seems you're trying to have custom pages loaded from the filesystem which is not something dugway currently supports. If that's the case perhaps you could write that up as a separate issue and we can discuss the merits/goals of such an idea in there. |
I guess I wasn't clear with my comment. I understand that what I am asking about (and what I believe that the OP was asking about) is not functionality that dugway currently provides. I want to change that. Since I am a django/python guy and not a rails/ruby guy and don't have an orientation on where to look to start hacking on dugway, to save me reading through all the source code, I was hoping that someone familiar with how the app is structured could point me to the file or files that I would have to change to make dugway be able to render custom pages the same way it renders its pre-defined default pages. In my reality, if I have to paste code into the bigcartel site to see it rendered every time I make changes to it while I am in development, it sort of renders dugway useless, right? |
@pjv Thanks that's more clear. I've refreshed myself on the code and without actually attempting it I think adding this functionality would be reasonably straightforward. The place you're likely looking to add functionality would be in the Store class. Say around here https://github.com/bigcartel/dugway/blob/master/lib/dugway/store.rb#L32 Essentially I think you'll want to have that pull in pages that exist in the filesystem (say all pages in a custom_pages subdirectory?). The trouble you may run into however is that these pages are assumed to be static per dugway run and the Store class memoizes the pages into a variable. You would need some additional cleverness to make it actually update your pages without resetting the dugway server each time. |
Thanks a lot @outerim, that was exactly what I needed. All I had to do was add the following line into the
perfect. Thanks! |
I'm glad it worked out. I'm going to leave this open since dugway should support a more general solution. |
Similar to my problem. I tried to see if the file layout.html I write this: {% if page.full_path contains '/faq' %}
insert your code here
{% endif %} It works, but this can only be a single file can be included? How do I create a custom page layouts unique with dugway? Thank you for your help! |
I am also having a similar issue. I would like to create a custom about page layout for my theme. Where can I add the path that was referenced above? The store.rb file? Thank you! |
yes, i was able to get this working by hacking the
one caveat is that it has been some time since i set this up and i don't know how dugway may have changed in the interim, so YMMV. |
@pjv Thank you for your help! But I downloaded Dugway from the terminal following the video and I cannot find the store.rb file. Am I totally missing something? Thank you for your help! |
you might be missing something about how rubygem based projects like dugway work. i'm not a ruby expert by any stretch, but when you are using dugway, all of its source code is stored on your system somewhere as a rubygem. that will be different for different systems depending on how your system has ruby set up. you need to find the gem and then you will find store.rb. |
Awesome! Thank you for all of your help @pjv ! This was very helpful. |
@pjv I can not find the |
I've found the store.rb file, made the edits, and now I'm trying to implement them, but it seems as if dugway is calling the old version. I'm new-ish to Ruby so I could really use some help. Thank you! |
i had to create the same custom pages (same name) in my big cartel store in order to get it working. so if i added a page called "blat" to store.rb, i added a custom page in bigcartel called "blat". other than that, if dugway really is seeing a different store.rb than the one you edited, i can't help you. how the ruby environment is set up on your computer is specific to how you set it up. you may have to learn about how ruby environments are managed and how yours in particular is. |
If I want to preview a new custom page — let’s say resellers.html from the source directory— 127.0.0.1:9292/resellers throws a Not Found error. Is there a way — or is it possible — to preview local custom html pages using Dugway server?
The text was updated successfully, but these errors were encountered: