@@ -97,6 +97,9 @@ CHANGE_SUFFIX = \
9797 for f in ` find " $3 " -iname ' *.$1' ` ; do\
9898 mv $$f ` dirname $$ f ` /` basename $$ f .$1 ` .$2; done
9999
100+ # Caches the latest D blog post for the front page
101+ DBLOG_LATEST =
102+
100103# Disable all dynamic content that could potentially have an unrelated impact
101104# on a diff
102105ifeq (1,$(DIFFABLE ) )
@@ -105,6 +108,7 @@ ifeq (1,$(DIFFABLE))
105108else
106109 CHANGELOG_VERSION_MASTER := "v${LATEST}..upstream/master"
107110 CHANGELOG_VERSION_STABLE := "v${LATEST}..upstream/stable"
111+ DBLOG_LATEST=$G/dblog_latest.ddoc $G/twid_latest.ddoc
108112endif
109113
110114# ###############################################################################
@@ -166,7 +170,7 @@ STYLES=$(addsuffix .css, $(addprefix css/, \
166170# HTML Files
167171# ###############################################################################
168172
169- DDOC =$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME )
173+ DDOC =$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME ) $( DBLOG_LATEST )
170174STD_DDOC =$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-release ${GENERATED}/modlist-${LATEST}) $(NODATETIME )
171175STD_DDOC_PRE =$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-prerelease ${GENERATED}/modlist-prerelease) $(NODATETIME )
172176SPEC_DDOC =${DDOC} spec/spec.ddoc
@@ -377,6 +381,22 @@ dlangspec.txt : $(DMD) macros.ddoc plaintext.ddoc dlangspec-consolidated.d
377381dlangspec.verbatim.txt : $(DMD ) verbatim.ddoc dlangspec-consolidated.d
378382 $(DMD ) -conf= -Df$@ verbatim.ddoc dlangspec-consolidated.d
379383
384+ # ###############################################################################
385+ # Fetch the latest article from the official D blog
386+ # ###############################################################################
387+
388+ $G/dblog_latest.ddoc :
389+ @echo " Receiving the latest DBlog article. Disable with DIIFABLE=1"
390+ curl -s --retry 3 --retry-delay 5 http://blog.dlang.org | grep -m1 ' entry-title' | \
391+ sed -E ' s/^.*<a href="(.+)" rel="bookmark">([^<]+)<\/a>.*<time class="updated" datetime="[^"]+">([^<]*)<\/time>.*Author *<\/span><a [^>]+>([^<]+)<\/a>.*/DBLOG_LATEST_TITLE=\2|DBLOG_LATEST_LINK=\1|DBLOG_LATEST_DATE=\3|DBLOG_LATEST_AUTHOR=\4/' | \
392+ tr ' |' ' \n' > $@
393+
394+ $G/twid_latest.ddoc :
395+ @echo " Receiving the latest TWID article. Disable with DIIFABLE=1"
396+ curl -s --retry 3 --retry-delay 5 http://arsdnet.net/this-week-in-d/twid-latest.js | grep setTwid | \
397+ sed -E ' s/.*setTwid\("([^"]+)", "([^"]+)", "([^"]+)"\).*/TWID_LATEST_LINK=\1|TWID_LATEST_DATE=\2|TWID_LATEST_TITLE=\3/' | \
398+ tr ' |' ' \n' > $@
399+
380400# ###############################################################################
381401# Git rules
382402# ###############################################################################
0 commit comments