|
|
| Line 1: |
Line 1: |
| − | <includeonly><metadesc>explain xkcd is a wiki dedicated to explaining the webcomic xkcd. Go figure.</metadesc><!--
| |
| − |
| |
| − | Create the 'box' around the comic template
| |
| − |
| |
| − | --><table class="comic-content {{{bodyclass|}}}" cellspacing="5" style="background-color: #FFFFFF;
| |
| − | border: 1px solid #a2a9b1; color: black; font-size: 88%;
| |
| − | line-height: 1.5em; margin: 0.5em 0 0.5em 1em; padding: 0.2em;
| |
| − | text-align: center; width:98%; {{{bodystyle|}}}"><!--
| |
| − |
| |
| − | Comic title in '''BOLD''' and in small caps, like on xkcd.com
| |
| − | -->{{#if:{{{title|}}}|<tr><td style="font-size: 21px; font-variant: small-caps; font-weight: 800; padding-bottom:11px; padding-top:15px;">{{{title}}}</td></tr>}}<!--
| |
| − |
| |
| − | Display the original title and link to it just before the navigation
| |
| − | -->{{#if:{{{ogtitle|}}}|<tr><td style="padding-bottom:12px; padding-top:0px; font-size: 21px" class="plainlinks"><!--
| |
| − |
| |
| − | -->''[[LiveJournal#Template{{!}}Original title]]:'' <!--
| |
| − |
| |
| − | --><span style="font-variant: small-caps; font-weight: 800">[{{{oglink}}} {{{ogtitle}}}]</span></td></tr>}}<!--
| |
| − |
| |
| − | This table will contain a table row (tr) and cell (td)
| |
| − | --><tr><td><!--
| |
| − |
| |
| − | Now make an unordered list which will display as the navigation bar
| |
| − | --><ul style="text-align: center; margin-bottom: 10px;" class="no-link-underline"><!--
| |
| − |
| |
| − | Generate the |< and prev buttons, but only if {{{number}}} exists and is greater than 1
| |
| − | -->{{#ifexpr:{{{number|-1}}}>1<!--
| |
| − |
| |
| − | {{{number}}} is greater than 1; make a list item and put a button in it that links to #1
| |
| − | -->|<li style="background-color: #6E7B91;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"><!--
| |
| − | link to #1
| |
| − | -->[[1: Barrel - Part 1|<span style="color: #FFFFFF; padding: 0 12px;">|<</span>]]</li><!--
| |
| − |
| |
| − | We're not done here yet, let's make the back button
| |
| − | --><li style="background-color: #6E7B91;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"><!--
| |
| − |
| |
| − | Link to the previous comic
| |
| − | -->[[{{#expr:{{{number}}}-1}}|<span style="color: #FFFFFF; padding: 0 12px;">< Prev</span>]]</li><!--
| |
| − |
| |
| − | {{{number}}} doesn't exist or is less than 1; just put non-breaking spaces here
| |
| − | -->| }}<!--
| |
| − |
| |
| − | Regardless of {{{number}}}, we need to make the comic date, link etc.
| |
| − | --><li style="background-color: #6E7B91;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"
| |
| − | class="plainlinks"><!--
| |
| − |
| |
| − | [ and ] makes an external link, vs. [[ and ]] which are internal only.
| |
| − | Depending whether {{{number}}} exists or not, toggle between using wide link mode or number link mode.
| |
| − | Wide link mode requires {{{lappend}}} to be set, while {{{ldomain}}} can default to www
| |
| − | -->[{{#ifexpr:{{{number|-1}}}>=1<!--
| |
| − |
| |
| − | Comic number is probably valid, use number link mode
| |
| − | -->|https://xkcd.com/{{{number}}}<!--
| |
| − |
| |
| − | Comic number is invalid or doesn't exist, use wide link mode
| |
| − | -->|https://{{{ldomain|www}}}.xkcd.com/{{{lappend}}}}}<!--
| |
| − |
| |
| − | Generate the title, with date if it exists
| |
| − | --><span style="color: #FFFFFF; padding: 0 12px;" title="Go to comic #{{{number}}} on xkcd.com"><!--
| |
| − | -->Comic{{#ifexpr:{{{number|-1}}}>= 1| #|}}{{{number|}}}{{#if:{{{date|}}}| ({{#replace:{{{date}}}| | }})}}</span>]</li><!--
| |
| − |
| |
| − | Now make the next and >| buttons, provided the comic number exists
| |
| − | -->{{#ifexist:{{#expr:{{{number|-2}}}+1}}<!--
| |
| − |
| |
| − | Check if this is the LATESTCOMIC. If it is, then don't display the "Next" and >| buttons.
| |
| − | -->|{{#ifexpr:{{LATESTCOMIC}}-{{{number}}}>0<!--
| |
| − |
| |
| − | Comic number is not the latest, generate the buttons
| |
| − | -->|<li style="background-color: #6E7B91;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"><!--
| |
| − | -->[[{{#expr:{{{number}}}+1}}{{!}}<span style="color: #FFFFFF; padding: 0 12px;">Next ></span>]]</li><!--
| |
| − |
| |
| − | Make a button that points to LATESTCOMIC (which is of course the latest comic)
| |
| − | --><li style="background-color: #6E7B91;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"><!--
| |
| − | -->[[{{LATESTCOMIC}}{{!}}<span style="color: #FFFFFF; padding: 0 12px;">>|</span>]]</li><!--
| |
| − |
| |
| − | Comic number (plus one) is the latest, so don't show the buttons
| |
| − | -->| }}| }}</ul><!--
| |
| − | --></td></tr><!--
| |
| − |
| |
| − | Now that the nav bar has been generated, display the rest if given.
| |
| − |
| |
| − | Display the (optional) text just before the image
| |
| − | -->{{#if:{{{before|}}}|<tr><td style="padding-bottom:10px">{{{before}}}</td></tr>}}<!--
| |
| − |
| |
| − | Almost done; just need to display the image, title text, and a bit more
| |
| − | --><tr><td><!--
| |
| − |
| |
| − | {{{custom}}} will replace the image with whatever it contains if it exists
| |
| − | -->{{#if: {{{custom|}}}|{{{custom|}}}<!--
| |
| − |
| |
| − | Now that we know we're not going to replace the image, let's display it if it exists
| |
| − | -->|{{#if:{{{image|}}}|[[File:{{{image|}}}|{{{imagesize|}}}|{{{titletext|}}}]]}}}}<!--
| |
| − |
| |
| − | {{{imagesize}}} will allow the comic to be shrunk if it's especially large
| |
| − |
| |
| − | {{{noexpand}}} will hide the "Click comic to enlarge" notice
| |
| − | -->{{#ifeq:{{{noexpand|}}}|true||
| |
| − | {{#if:{{{imagesize|}}}|<br />[Click comic to enlarge]}}
| |
| − | }}<!--
| |
| − |
| |
| − | If the comic has a title text, then add it in a small print underneath the comic.
| |
| − | Use the custom Title Text STYLE (ttstyle) if given
| |
| − | -->{{#if:{{{titletext|}}}|<br /><span style="margin-top:0.9em; margin-bottom:0.4em; display:inline-block; font-size: 115%; {{{ttstyle|}}}"><!--
| |
| − | --><span<!-- style="color:grey"--> class="plainlinks">''[[Title text|Title text]]:''</span> {{{titletext}}}<!--
| |
| − | --></span>}}<!--</td></tr></table>--><!--
| |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| − | This table will contain a table row (tr) and cell (td)
| |
| − | --><tr><td><!--
| |
| − |
| |
| − | Now make an unordered list which will display as the navigation bar
| |
| − | --><ul style="text-align: center; margin-bottom: 10px;" class="no-link-underline"><!--
| |
| − |
| |
| − | Generate the |< and prev buttons, but only if {{{ognumber}}} IS GIVEN and is not 7
| |
| − | -->{{#if:{{{ognumber|}}}|{{#ifexpr:{{{ognumber|}}}!=7<!--
| |
| − |
| |
| − | {{{ognumber}}} is GIVEN and greater than 1, so make a list item and put a button in it that links to #7
| |
| − | -->|<li style="background-color: #FFFFF;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"><!--
| |
| − | link to #1
| |
| − | -->[[7: Girl sleeping (Sketch -- 11th grade Spanish class)|<span style="color: #6E7B91; padding: 0 12px;">|<</span>]]</li><!--
| |
| − |
| |
| − | Let's make the back button!
| |
| − | PIPE REMOVED--><li style="background-color: #FFFFF;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"><!--
| |
| − |
| |
| − | Link to the previous comic
| |
| − | -->[[{{{ogprev}}}|<span style="color: #6E7B91; padding: 0 12px;">< OG Prev (Comic #{{{ogprev|}}})</span>]]</li><!--
| |
| − |
| |
| − | {{{ognumber}}} is 7; just put non-breaking spaces here
| |
| − | -->| }}}}<!-- NEW 2 CURLY BRACKET here
| |
| − |
| |
| − | Regarding {{{ognumber}}}, we need to say the original comic number at the center.
| |
| − | -->{{#if:{{{ognumber|}}}|<!--{{#ifexpr:{{{ognumber|}}}!=7|--><!--
| |
| − |
| |
| − | Ok it's not #7, go wild
| |
| − | --><li style="background-color: #FFFFFF;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;" class="plainlinks"><!--
| |
| − |
| |
| − | [ and ] makes an external link, vs. [[ and ]] which are internal only.
| |
| − | Depending on whether {{{ognumber}}} is 7 or not, toggle between using wide link mode or number link mode.
| |
| − | Wide link mode requires {{{lappend}}} to be set, while {{{ldomain}}} can default to www
| |
| − | --><!--
| |
| − | NOT USING THESE - [{{#ifexpr:{{{number|-1}}}>=1
| |
| − |
| |
| − | NOT USING THESE - Comic number is probably valid, use number link mode
| |
| − | |https://xkcd.com/{{{number}}}
| |
| − |
| |
| − | NOT USING THESE - Comic number is invalid or doesn't exist, use wide link mode
| |
| − | |https://{{{ldomain|www}}}.xkcd.com/{{{lappend}}}}} would need another two curly because added another IF statement
| |
| − |
| |
| − | Generate the title, with ognote if it exists
| |
| − | -->[[LiveJournal#Template|<span style="color: #6E7B91; padding: 0 12px;" title="Learn why the original xkcd comics were in a different order"><!--
| |
| − | -->ORIGINAL ORDER: Comic #{{{ognumber|}}}<!--
| |
| − | Comic #{{{ognumber|}}} <u>(Original order)</u>
| |
| − |
| |
| − | Add ognote in parenthesis
| |
| − | -->{{#if:{{{ognote|}}}| ({{#replace:{{{ognote}}}| | }})}}</span>]]}}</li><!--
| |
| − |
| |
| − | Now make the next and >| buttons, provided the comic number exists
| |
| − | I won't touch these
| |
| − | -->{{#ifexist:{{#expr:{{{number|-2}}}+1}}<!--
| |
| − |
| |
| − | Check if this is 55 (which is the latest LiveJournal comic). If it is 55, then don't display the "Next" and >| buttons.
| |
| − | -->|{{#ifexpr:55-{{{ognumber}}}>0<!--
| |
| − |
| |
| − | Comic number IS NOT 55, generate the Next buttons
| |
| − | -->|<li style="background-color: #FFFFF;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"><!--
| |
| − | -->[[{{{ognext}}}|<span style="color: #6E7B91; padding: 0 12px;">OG Next > (Comic #{{{ognext}}})</span>]]</li><!--
| |
| − |
| |
| − | Make a button that points to 55 (which is the latest LiveJournal comic)
| |
| − | --><li style="background-color: #FFFFF;
| |
| − | border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray;
| |
| − | display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600;
| |
| − | margin: 0 4px; padding: 1.5px 0;"><!--
| |
| − | -->[[55: Useless{{!}}<span style="color: #6E7B91; padding: 0 12px;">>|</span>]]</li><!--
| |
| − |
| |
| − | Comic number (plus one) is the latest, so don't show the buttons
| |
| − | -->| }}| }}</ul><!-- YES I ADDED TWO
| |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| | SECOND ROW IF NOT OG COMIC | | SECOND ROW IF NOT OG COMIC |
| | This table will contain a table row (tr) and cell (td) | | This table will contain a table row (tr) and cell (td) |
| Line 274: |
Line 63: |
| | Comic number (plus one) is the latest, so don't show the buttons | | Comic number (plus one) is the latest, so don't show the buttons |
| | -->| }}| }}</ul><!-- | | -->| }}| }}</ul><!-- |
| − | -->}}</td></tr></table><!-- | + | --></td></tr>}} |
| − | | |
| − | | |
| − | | |
| − | | |
| − | | |
| − | | |
| − | Add the comics to the standard categories.
| |
| − | | |
| − | Sort this page in categories by number. The padding ensures that #9 comes before #10
| |
| − | It otherwise sorts 'alphanumerically'; since the first character of "10" is "1", it would normally be placed before "9" even though it should be placed after
| |
| − | The padding turns each into 0009 and 0010 etc. Now, since "0" is less than "1", #9 gets sorted before #10.
| |
| − | -->{{#ifexpr:{{{number|-1}}}>=1|{{DEFAULTSORT: {{padleft:{{{number}}}|4}}}}|<!--
| |
| − | -->}}<!--
| |
| − | | |
| − | Only categorise if the page is in the main namespace
| |
| − | -->{{#ifeq:{{NAMESPACE}}|{{ns:0}}<!--
| |
| − | | |
| − | Don't try to categorise the Main Page nor the extra comics
| |
| − | -->|{{#ifeq:{{FULLPAGENAME}}|{{int:mainpage}}||{{#ifeq:{{{extra|}}}|yes|[[Category:Extra comics]]|<!--
| |
| − | | |
| − | Alright, start putting it in the appropriate date categories
| |
| − | -->[[Category:All comics]]{{#if:{{{date|}}}|[[Category:Comics from {{#time:Y|{{{date}}}}}]] <!-- Years
| |
| − | -->[[Category:Comics from {{#time:F|{{{date}}}}}]] <!-- Months
| |
| − | -->[[Category:{{#time:l|{{{date}}}}} comics]] <!-- Weekdays
| |
| − | -->}}}}}}|}}<!--
| |
| − | --></includeonly><noinclude><!--
| |
| − | | |
| − | | |
| − | | |
| − | | |
| − | DOCUMENTATION
| |
| − | -->{{comic/sandbox
| |
| − | | ognumber = 7
| |
| − | | number = 987
| |
| − | | ognext = 12
| |
| − | | ogprev = 8
| |
| − | | date = September 30, 2005
| |
| − | | title = Pi Equals
| |
| − | | oglink = https://web.archive.org/web/20070927001941/http://xkcd-drawings.livejournal.com/?skip=40#:~:text=8%3A44%20pm-,Pi%20equals,-(4%20Comments
| |
| − | | ogtitle = Pi equals
| |
| − | | image = pi.jpg
| |
| − | | titletext = My most famous drawing, and one of the first I did for the site
| |
| − | }}
| |
| − | | |
| − | | |
| − | | |
| − | {{comic/sandbox
| |
| − | | ognumber = 9
| |
| − | | number = 10
| |
| − | | ogprev = 8
| |
| − | | ognext = 12
| |
| − | | ognote =
| |
| − | | date = September 30, 2005
| |
| − | | title = Pi Equals
| |
| − | | oglink = https://web.archive.org/web/20070927001941/http://xkcd-drawings.livejournal.com/?skip=40#:~:text=8%3A44%20pm-,Pi%20equals,-(4%20Comments
| |
| − | | ogtitle = Pi equals
| |
| − | | image = pi.jpg
| |
| − | | titletext = My most famous drawing, and one of the first I did for the site
| |
| − | }}
| |
| − | | |
| − | | |
| − | {{:Template:comic/doc}}
| |
| − | [[Category:Templates]]</noinclude>
| |