Skip to content

Commit

Permalink
Add "This Week in D" to the front page
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberShadow committed Oct 22, 2015
1 parent 5019e76 commit 589be8f
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
43 changes: 35 additions & 8 deletions css/style.css
Expand Up @@ -482,22 +482,49 @@ body.dcompiler dt a.anchor:hover:before

.notice
{
display: block;
padding: 0.5em;
text-align: center;
font-weight: bold;
margin-bottom: 0.5em;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
text-decoration: none;
background-color: white;
border: 1px dotted #633;
}

a.notice:hover
{
background: inherit; /* $(menu_bg_hover) */
}

.notice, table.notice-table td
{
background-color: white;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
border: 1px dotted #633;
text-align: center;
padding: 0.5em;
}

.notice, table.notice-table td a
{
text-decoration: none;
font-weight: bold;
display: block;
}

table.notice-table
{
border: none;
width: 100%;
}

table.notice-table td
{
vertical-align: middle;
}

/* padding between left and right cell */
table.notice-table td:nth-child(2)
{
visibility: hidden;
border: 0;
padding: 0.25em;
}

/* These are different kinds of <pre> sections */
.bnf /* grammar */
{
Expand Down
2 changes: 0 additions & 2 deletions doc.ddoc
Expand Up @@ -3,8 +3,6 @@ ROOT = .
SELF_PATH =
BODYCLASS = doc
PROJECT = dlang.org
LAYOUT_SUFFIX=
$(SCRIPTLOAD $(ROOT_DIR)js/run-main-website.js)
_=

NAVIGATION=
Expand Down
9 changes: 8 additions & 1 deletion index.dd
Expand Up @@ -5,7 +5,11 @@ $(D_S D Programming Language,
$(SECTION1 The D Programming Language$(BR) $(SPANC slogan, Modern convenience. Modeling power. Native efficiency.),

$(NOTICE DMD $(LATEST) Released$(BR)<a href="download.html">Download</a> &middot; <a href="changelog/$(LATEST).html">Changelog</a>)
$(NOTICE_L http://dconf.org/2015/schedule/index.html, Videos and Slides from DConf 2015)
$(TABLEC notice-table, $(TR $(TD
$(WEB arsdnet.net/this-week-in-d/, This Week in D)
)$(TD)$(TD
$(WEB dconf.org/2015/schedule/index.html, Videos and Slides from DConf 2015)
)))
<br>

<div style="text-align: right; font-size: 11px; margin-bottom: -35px; margin-right: 5px; position: relative; z-index: 10000">
Expand Down Expand Up @@ -646,5 +650,8 @@ Macros:
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
)
)
LAYOUT_SUFFIX=
$(SCRIPTLOAD $(ROOT_DIR)js/run-main-website.js)
$(SCRIPTLOAD http://arsdnet.net/this-week-in-d/twid-latest.js)
LAYOUT_TITLE=
_=
13 changes: 13 additions & 0 deletions js/dlang.js
Expand Up @@ -76,3 +76,16 @@
}
});
})(jQuery);

// "This Week in D" integration
// setTwid is called from http://arsdnet.net/this-week-in-d/twid-latest.js
// which is included in index.html
function setTwid(url, title, description) {
$('table.notice-table td:first-child').html(
$('<a>')
.attr('href', url)
.append($('<span>').text(title + ':'))
.append($('<br>'))
.append($('<span>').text(description))
);
}

0 comments on commit 589be8f

Please sign in to comment.