Fixed, easy to remember URLs for posts

Walter Bright newshound at digitalmars.com
Tue Dec 12 01:03:47 PST 2006


Bill Baxter wrote:
> It would be nice if there were a simple url we could use for referring 
> to D newsgroup posts in a fixed way regardless whatever the web 
> interface du-jour happens to be.
> 
> Something as close as possible to the Xref tag in the headers of the 
> posts themselves would be nice.  The Xref looks like:
>   digitalmars.com digitalmars.D.announce:6086
> So the url could be like:
>   http://www.digitalmars.com/ng/digitalmars.D.announce/6086
> 
> Then that would just bounce you to the current location of the web 
> interface, which currently is:
> 
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=6086 
> 
> 
> And then we wouldn't have to worry anymore about article urls being too 
> long, or about old links to the specific NG web interface dying.
> 
> I suspect one of you PHP/Apache wizards out there could whip this up in 
> less than the time it took me to write this post. ;-)

I use Ddoc macros in the documentation:

NG_cpp = <a 
href="http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=c++&artnum=$0">c++/$0</a>
NG_cpp_beta = <a 
href="http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=c++.beta&artnum=$0">c++.beta/$0</a>
NG_cpp_command_line = <a 
href="http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=c++.command-line&artnum=$0">c++.command-line/$0</a>
NG_D_gnu = <a 
href="http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=D.gnu&artnum=$0">D.gnu/$0</a>
NG_digitalmars_D = <a 
href="http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=$0">D/$0</a>
NG_digitalmars_D_bugs = <a 
href="http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=$0">D.bugs/$0</a>
NG_digitalmars_D_learn = <a 
href="http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.learn&artnum=$0">D.learn/$0</a>
NG_digitalmars_D_announce = <a 
href="http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.announce&artnum=$0">D.announce/$0</a>

Which eases things considerably. The news archiver will also translate 
the URLs in the postings when creating the archive pages. That doesn't 
work for the web interface, though.



More information about the Digitalmars-d mailing list