Skip to content

Conversation

@wilzbach
Copy link
Contributor

I just had this crazy idea and funnily it works quite well - even with Ddoc :)

This definition is only used when DIFFABLE is not set, so it won't be possible to preview this on the DAutoTest, but here's how it will look in action:

image.

For a local build without internet, curl will fail silently and it will just create an empty file.
On subsequent runs, this target won't be executed. (No .PHONY).

This approach is also nicer than the previous JavaScript injection, because search engines see the new content & they like sites that are updated often.

It's fairly unlikely that the DBlog theme will change soon and if - as said before - it will just silently fail ...

CC @mdparker @JackStouffer @CyberShadow

$(P Stay updated with
$(LINK2 http://arsdnet.net/this-week-in-d,
<cite>This Week in D</cite>) -
$(SPANC twid)
Copy link
Member

@PetarKirov PetarKirov Jun 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep This Week in D. It's pretty cool, despite not having the "official" stamp on it. Just move it below the official blog. May be something like:

Stay updated with the official D Blog and This Week in D:

@wilzbach wilzbach force-pushed the show-latest-dblog branch from e0cf7d9 to 669d49c Compare June 15, 2017 14:48
@wilzbach
Copy link
Contributor Author

Let's keep This Week in D. It's pretty cool, despite not having the "official" stamp on it. Just move it below the official blog. May be something like:

I considered this for a moment, but then dropped it because of space problems:

image

Any ideas?

@adamdruppe
Copy link
Contributor

I didn't get a chance to update twid again since I was out of town again.... I wouldn't mind if you simplified or removed it to save space.

@PetarKirov
Copy link
Member

If space is an issue we can try with this:

Stay updated with:

Or with an even shorter version:

Stay updated with the official D Blog - Compile-Time Sort in D from June 5 2017 and This Week in D - May 28.

@wilzbach
Copy link
Contributor Author

CC @aG0aep6G - as you rescued the Dlang.org template - what's your opinion on this?

CC @popen2 - at DConf you mentioned that you were planning on redesigning dlang.org - maybe you have already an idea in mind?

@aG0aep6G
Copy link
Contributor

CC @aG0aep6G - as you rescued the Dlang.org template - what's your opinion on this?

I really dislike how much the home page currently depends on JavaScript, so this is interesting. It feels weird to generate the "latest" stuff when building the site, but if you do that regularly enough, sure.

Does it work, though? The doc tester shows "from : by . ". Also, https://blog.dlang.org doesn't work. Needs "http://".

Regarding space problems, you could cut the DConf text down. One paragraph instead of two; shorter "thank you" or none at all; "through this YouTube playlist" -> "on YouTube" - stuff like that.

Regarding TWID, it doesn't seem very alive. So I'd go with the blog if only one can get in.

@CyberShadow
Copy link
Member

I think the DConf bit needs to be moved out of the news section and somewhere else, a banner or a sidebar widget. Then there should be enough room for the blog and TWiD in the News section (no need to listify them either, just two paragraphs).

@wilzbach wilzbach force-pushed the show-latest-dblog branch 2 times, most recently from ae2bd8c to 13c53d2 Compare June 16, 2017 01:25
@wilzbach
Copy link
Contributor Author

Does it work, though? The doc tester shows "from : by . ".

Yes as mentioned before, I explicitly disable this (as dynamic content) on the DAutoTest to avoid random changes (DIFFABLE=1 is set on DAutotTest).
However on the deployment, DIFFABLE isn't set. For example, the pending changelog is built similarly.
If the curl trick looks too weird, I can always plugin a simple DScript instead...

Also, https://blog.dlang.org doesn't work. Needs "http://".

Oh thanks!

I think the DConf bit needs to be moved out of the news section and somewhere else, a banner or a sidebar widget. Then there should be enough room for the blog and TWiD in the News section (no need to listify them either, just two paragraphs).

Okay,

  • I also parse TWID at "Compile-Time" now, so there's one ugly layout reflow less on the main page.
  • I removed the "Thank you DConf 2017" notice

image

Now adding the DConf link to "Learn" yields (and slightly adjusting the News intro):

image

@CyberShadow the only place I could find to put the playlist link was the "Learn" section. Better ideas?

@CyberShadow
Copy link
Member

CyberShadow commented Jun 17, 2017

Better ideas?

I was thinking maybe take http://dconf.org/2017/images/dconf_logo_2017.svg, crop it, and put it (with some text) in the sidebar above or under the Tweeter widget, what do you think? Plenty of space there.

@wilzbach wilzbach force-pushed the show-latest-dblog branch from 13c53d2 to 09a00b3 Compare June 18, 2017 23:45
@wilzbach
Copy link
Contributor Author

I was thinking maybe take http://dconf.org/2017/images/dconf_logo_2017.svg, crop it, and put it (with some text) in the sidebar above or under the Tweeter widget, what do you think? Plenty of space there.

Nice idea - like this? Maybe a bit more spacing?

image

@CyberShadow
Copy link
Member

Yep! Could use a bit of text under the logo (essentially what we have in the news section right now).

@wilzbach
Copy link
Contributor Author

Yep! Could use a bit of text under the logo (essentially what we have in the news section right now).

default

image

12px

image

sitemap.dd Outdated
@@ -0,0 +1,203 @@
Ddoc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you add this accidentally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I really need some sleep :P
In any case, we should add this to the gitignore or even better: simply put it into .generated
#1725

# Fetch the latest article from the official D blog
################################################################################

$G/dblog_latest.ddoc:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DIFFABLE, not DIIFABLE

posix.mak Outdated

$G/twid_latest.ddoc:
@echo "Receiving the latest TWID article. Disable with DIIFABLE=1"
curl -s --retry 3 --retry-delay 5 http://arsdnet.net/this-week-in-d/twid-latest.js | grep setTwid | \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to handle special characters nicely?

@@ -0,0 +1,213 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hotlinking it would've been fine, but this is fine too

Copy link
Contributor Author

@wilzbach wilzbach Jun 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer copying - just in case the layout of dconf.org changes ... (I would like to avoid dependencies on other websites wherever possible).

@wilzbach wilzbach force-pushed the show-latest-dblog branch from 5de43ee to 4649c60 Compare June 19, 2017 00:10
index.dd Outdated
<cite>Programming in D</cite>) or
$(LINK2 http://youtube.com/playlist?list=PL3jwVPmk_PRxo23yyoc0Ip_cP3-rCm7eB, watch)
talks from
$(LINK2 http://dconf.org/2017/index.html, DConf17)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I still keep this if we add the DConf banner?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not sure how good the talks are effective for actually learning D.

@wilzbach
Copy link
Contributor Author

wilzbach commented Jun 19, 2017

Is this going to handle special characters nicely?

Example with Regex101

@CyberShadow
Copy link
Member

If I understand that regex correctly, if a TWiD issue has a " in it, it's not going to show up at all.

@CyberShadow
Copy link
Member

I don't understand how RFC 3966 plays in this. The TWiD data is a JavaScript file, it's not URL-encoded.

@wilzbach wilzbach force-pushed the show-latest-dblog branch from 4649c60 to 78589cb Compare June 19, 2017 00:25
@wilzbach
Copy link
Contributor Author

If I understand that regex correctly, if a TWiD issue has a " in it, it's not going to show up at all.
don't understand how RFC 3966 plays in this. The TWiD data is a JavaScript file, it's not URL-encoded.

Yes & Yes, sorry.
Updated the RegEx: https://regex101.com/r/cGz0vE/2 (at least for TWID I hope that this is only a temporary solution anyways as for @adamdruppe it's probably the same effort to write his latest article information in this extracted Ddoc format than JS).

@wilzbach wilzbach force-pushed the show-latest-dblog branch from 78589cb to c408e76 Compare June 19, 2017 00:32
@wilzbach wilzbach dismissed PetarKirov’s stale review June 27, 2017 05:01

TWID now stays part of the main page.

@wilzbach wilzbach force-pushed the show-latest-dblog branch from c408e76 to b29ca60 Compare June 27, 2017 05:05
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.

Some tips to help speed things up:

  • smaller, focused PRs are easier to review than big ones

  • try not to mix up refactoring or style changes with bug fixes or feature enhancements

  • provide helpful commit messages explaining the rationale behind each change

Bear in mind that large or tricky changes may require multiple rounds of review and revision.

Please see CONTRIBUTING.md for more information.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach wilzbach force-pushed the show-latest-dblog branch from b29ca60 to d3df255 Compare June 27, 2017 05:06
@wilzbach
Copy link
Contributor Author

Alrighty, I have fixed all open "issues" and this should be good to go. Anything else blocking this?
(I also squashed the DConf banner changes into one commit).

@CyberShadow
Copy link
Member

@adamdruppe Any news on twid_latest.dd?

posix.mak Outdated

$G/twid_latest.ddoc:
@echo "Receiving the latest TWID article. Disable with DIFFABLE=1"
curl -s --retry 3 --retry-delay 5 http://arsdnet.net/this-week-in-d/twid-latest.js | grep setTwid | \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quotes (and other JS escapes) in TWID titles are still going to show up wrong.

@adamdruppe
Copy link
Contributor

http://arsdnet.net/this-week-in-d/twid_latest.dd

@wilzbach wilzbach force-pushed the show-latest-dblog branch from d3df255 to c99aac3 Compare June 27, 2017 18:30
@wilzbach
Copy link
Contributor Author

Thanks a lot @adamdruppe! Integrated & rebased. Anything else missing? :)

@wilzbach
Copy link
Contributor Author

For reference, this is how it currently looks:

image

image

@CyberShadow
Copy link
Member

Looks great!

@dlang-bot dlang-bot merged commit 1dbd072 into dlang:master Jun 27, 2017
@wilzbach wilzbach deleted the show-latest-dblog branch June 27, 2017 18:48
@wilzbach
Copy link
Contributor Author

And fetching the latest resources on the deploy for dlang.org worked - it's live now :)

Thanks a lot @adamdruppe @mdparker @ZombineDev @aG0aep6G @CyberShadow !

@adamdruppe dlang.org gets built and deployed everytime a PR gets merged to dlang/{dmd,druntime,phobos,dlang.org} - according to your stats that's about 30 times a week or ~ three times a day. So, in the worst case, there might be a lag of a few hours until new articles are propagated on dlang.org.

@CyberShadow
Copy link
Member

If you want, I can add a trigger that forces a rebuild

@adamdruppe
Copy link
Contributor

adamdruppe commented Jun 27, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants