-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Rebuild GDC site as a vibe.d server, converting all pages to markdown. #6
Conversation
|
@jpf91 - also, lets talk implementing /downloads into this server. |
|
|
||
| // Catch all GET requests and push them through our main handler. | ||
| auto router = new URLRouter; | ||
| router.get("*", toDelegate(&handleRequest)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you only a single request handler, router is not necessary, you can do straight listenHTTP(settings, &handleRequest); (in fact router is implemented as multiplexing handler)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if I do it that way, wouldn't the handler need to check the type of request? (As in, discards anything that isn't a GET request)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Though I don't see why you would want to reject any other HTTP requests other than trying to go for RESTful style semantic purity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I tested various commands, all came back as bad requests, so I guess your suggestion is fine.
Yes, RESTful style semantic purity. eg: GET and POST should not perform the same action. ;-)
|
@ibuclaw I think the simplest approach for Also moving part of our email discussion here: OT caching is probably important for the download page. @Dicebot does vibe-d have some nice caching helpers? I guess the simplest approach is to string cachedSite()
{
static string cachedString;
static SysTime lastCheck;
//Hopefully compiles down to a simple integer add / comparison
if(Clock.currTime() < lastCheck + dur!msecs(100))
return cachedString;
else
{
if(sourceFileChanged())
{
cachedString = renderPage();
}
lastCheck = Clock.currTime();
return cachedString;
}
} |
|
@jpf91 not something I am aware of. But it can be implemented by built-in tools of reverse proxy in front of vibe.d, for example |
|
@jpf91 I was thinking some sort of output range / custom AA to store cached pages. Notable fields: As for downloads, I think things should be split up/separated in a nicer way. That goes perhaps for the ftp view too. If it's going to be used as an archive of releases, then the toplevel should be a directory named after the version number. But then again, maybe the downloads page can be cleaned up using only CSS changes. |
|
Do you think we need an archive html page for 'old releases'? Otherwise we could simply keep the most recent release on |
|
I don't see a need for old releases/archives. For the D front-end, it should always be the latest (2.065). For GCC, it should be OK to keep 2 versions (4.9.x, 4.8.x) as there are those who are still on older systems. :) |
|
I detect clip-art in those wilder designs! The whole wolf thing was a joke anyway, one I'm starting to regret >< I don't know if you noticed, but one of the doodle sheets I shared had a C that looked like a Gnu on its side, kinda/sorta/ifyasquintabit. I was thinking of putting it on bottom face of an inside-out cube, but it looked awful. I also doodled a G that is made out of an n and a u stacked on top of each other, but I didn't think anyone would be interested in that. |
|
I just took a look at a few reference images for inspiration, and it turns out that wolves have a dark area around their eyes that is gibbous moon shaped. Turns out I already drew some wolves without noticing ^^ |
It's all drawn by my own hand-ish in inkscape. I say hand-ish because I'm limited to a trackpad on my laptop. I'm also not much of an artist behold simple stuff. So clip-art would be a nice way of describing my work. :) |
|
I've actually been working on a visual overhaul since this pull: http://staging.dgnu.org So I will go ahead and merge this (just need to do a cursory rebase to make sure everything is in order) and raise a new pull for the new-new site. @jpf91 - Any thoughts on what I've changed on the downloads page? |
Rebuild GDC site as a vibe.d server, converting all pages to markdown.
|
The new design looks great! BTW: The download tables don't scale to well for very small windows (same problem with the old design) but I couldn't figure out how to make that work. |
|
Done! I've also right aligned the link too (as per the old design). Yeah, I need to work out how to best layout the tables. |
|
OK, I've tweaked the downloads page, it's not as fancy as before, but it is more consistent now on smaller screens vs larger. |
|
That's much better :-) One last nitpick: can we keep alternating colors for the table rows? |
|
They are alternated. Albeit there is not much difference between the two shades of grey. :) |
|
Weird, I could swear I used ctrl-f5 to reload the page... Anyway with caches cleared I now get these alternating colors, so I think this is good to go. |
Files are checked for changes every 5 seconds. So time for cache to refresh is.... |
|
@ibuclaw looks like the download links don't work for some reason? |
|
I noticed. Somehow it tries to retrieve (on the server) |
|
What was the reason you decided against diet? |
|
From what I recall of testing, when you make a change to a diet template, you must recompile (taking down the server with it) in order to load in the new changes. However, I can't test now as it seems that vibe.d no longer builds with D2.065 |
Correct and interesting to hear that this was the deal breaker. I usually compile my sites on my development machine, upload the binaries and restart the systemd service. So there is no real downtime. |
Except for the small blip when you restart the service. ;-) One of the nice things about this was that I can add an unlimited number of pages without the need for recompiling. I just push the changes in and they are there on the server. |
Actually, I was attempting to build with my experimental copy of 2.066, hmm... |

Rather than using diet templates, it functions in the following way:
The benefit of this being that templates can be loaded onto the server dynamically and without requiring a restart of the entire service to make a change.
As of writing, the memory consumption and build time was > 50% reduction in comparison to using Diet templates to compile only four pages in CTFE.
The only time when a site rebuild would be required is for fixing any of the todo listed items in src/app.d.
Before:

After:
