Portal:Current events/How to archive the portal

Due to the move of the primary current events page from Current events to Portal:Current events and the advent of a new system that went into effect on July 12, 2006, the archival process for the page changed significantly. Please don't be alarmed by the length of this page; much of the page is just code to make the instructions clearer. The code used for transitioning July 2006 into August 2006 are used as case studies throughout.

Daily
Each day (during July 2006, for this example) when a new day/event is added, three pages get updated: Portal:Current events, Portal:Current events/July 2006, and Portal:Current events/Calendar:


 * Each day, sub-pages of the portal are (automatically) transcluded into the main portal page so that only the previous six days plus the current UTC day are displayed. As a result, during July 31, 2006, part of the code for the primary portal page (Portal:Current events) would have looked like the following:


 * Similarly, the clickable calendar at Portal:Current events/Calendar is auto-updated daily (as of Sat. Feb 21 2009) to reflect the fact that only the corresponding previous seven days appear on the main portal page. During July 31, 2006, given that July 2006 ended on a Monday (in this format the second day of the week), part of the code (at that time) in Portal:Current events/Calendar looked like this:


 * 23
 * 24
 * 25
 * 26
 * 27
 * 28
 * 29
 * 30
 * 31
 * 30
 * 31

The clickable days auto-scroll the portal page to the requested entry.

Periodically
The events in the sidebar on the main portal page (at Portal:Current events/Sidebar) are normally updated quite frequently, but the events in the archived sidebar for the monthly pages (e.g. Portal:Current events/July 2006/Sidebar) should also be updated once in a while. This can be done daily, weekly, biweekly, monthly; whenever someone wants to get around to doing it. This essentially requires copying all of the (in this example, July) deaths from Portal:Current events/Sidebar to the appropriate monthly sidebar: (Portal:Current events/July 2006/Sidebar), and likewise doing the same with all of the events, holidays and observances, trials, ongoing armed conflicts, and elections, taking care not to include Recent events that actually took place during a prior month (in this case, June 2006).

Monthly
Since all the tasks that originally were accomplished at the end of the month under the old archival system are now usually completed at earlier points in the month, the monthly archiving between July 31, 2006 and August 1, 2006 entails only a small amount of work. Again, please do not be alarmed by the length of this section; much of it is code. Most of the "monthly" archival work is done on the first of the month, but a bit is also done on the first Saturday and around the seventh day of the month.

On the first day

 * Create a new month page at Portal:Current events/August 2006 with code similar to that in Portal:Current events/July 2006 (note that the new month - August - should appear in the code four times):


 * Copy the code from Portal:Current events/July 2006/Calendar to Portal:Current events/August 2006/Calendar and alter it such that the dates display correctly for August, not July (note that the first day of the week is Sunday), as follows.


 * NOTE (2009): As a shortcut, locate the most recent month that begins on the same weekday as the newly-current month, copy/paste that month's calendar-formatting data from within the edit page, and using search-and-replace, update the month names (and year number if appropriate) to reflect the new Portal page's (current) month (and year). Also check that the month concludes on the correct day. For example, both February and March 2009's calendars commence on Sunday, identically to the Current Events calendar for June 2008. The only alterations necessary to produce these new calendars are to update the appropriate month/year names, and then delete days 29 and 30 from February '09, and add day 30 for March.


 * The main portal calendar (Portal:Current events/Calendar) is auto-updated (NEW: Feb 21 2009) with pre-loaded subpages so that the dates from both months are linked. Note that dates from the previous month have  added (to add a light blue background), and that no week from the previous month has fewer than seven days in the calendar, even though they may not be linked (NOTE: This style element has been altered of late (as of Feb 1 2009) to only show linked dates from the prev month--see comments to the right of the lines reflecting July 23/24/25):


 * Copy the previous month's sidebar page to the new month's sidebar page (e.g. Portal:Current events/July 2006/Sidebar to Portal:Current events/August 2006/Sidebar) and remove the contents that don't apply to the new month. For example, holidays, elections, and trials that occurred during the previous month, but not the current month should be removed, but the ongoing conflicts, events, and trials that continue into the current month should remain.


 * Make sure to remove every reference to the previous month's sidebar (i.e. in the edit sidebar links). Doing a find and replace in your favored word processing app or wiki editor helps find all the references.


 * If you're not sure which events, trials, etc. remain relevant in the new month, it may be a good idea to copy the events under ongoing in the main sidebar at Portal:Current events/Sidebar.


 * The actions noted under the periodically section are completed &mdash; events are transferred from the primary current events sidebar to the July 2006 sidebar &mdash; if they are not already done.

The link in Portal:Current events/More events does not really need to be updated until the seventh of the month since all of the current month's events will be on the main portal page until then. Additionally, the events at the bottom of the main portal page will be from the last several days of the previous month until the last one is removed from the page on the seventh. For example, between August 1 and August 6, July 31 (and others) will be on the main portal page, but beginning August 7, only August events would be there.

On the first Saturday
On the first Saturday of the new month, the empty full week from the previous month can be removed from Portal:Current events/Calendar. For example, the first Saturday of August 2006 is August 5. Therefore, on that day, the week containing July 23 through July 29 can then be removed from Portal:Current events/Calendar since there are no longer any links in it (all the active links are in a single row, from Sunday through Saturday).

NOTE (2009): This practice also no longer applies, since unlinked previous-month calendar days no longer appear, and week-old linked days from the just-ended month are automatically removed at 00:00:00 UTC.

On the seventh day
Once the seventh day of the new month has arrived, the following should take place:
 * All of the (unlinked) dates from the previous month should be removed from Portal:Current events/Calendar, leaving an incomplete week containing only the first day(s) of the new month. For example, on August 7, 2006, the table cells for July 30 and July 31 should be removed from Portal:Current events/Calendar, leaving just the cells for August 1 through August 5 in the first row (their links will be active). NOTE: As of 2009 this practice no longer applies, as only linked dates appear during the week of transition from one month to the next.
 * The link in Portal:Current events/More events should be updated to the current month. For example, instead of linking to Portal:Current events/July 2006, it should link to Portal:Current events/August 2006. NOTE: As of 2010 this update happens automatically.