Introducing: Representatives. swedishwin.com, chud.win, and soyzellig.party positions are vacant.


The new Community missions system is now live! Where anyone can propose a task, discuss nominations, or join the current mission. Community missions give editors a place to turn requests from the Janny noticeboard into focused projects. No mission can be too small

Module:News/archive

From Soyjak Wiki, the free ensoyclopedia
Jump to navigationJump to search

This module lists every released Soy Chronicle issue for the Archives, newest first, grouped by month. Everything comes from the issue records in Module:News/data. This requires no manual handling.

Usage

Do not invoke it directly. Call it through {{News/archive}}, on its own line:

{{News/archive}}

It takes no parameters.

Output

For each month that has an issue, a level-3 heading such as === November 2026 ===, then, one paragraph per issue:

'''No. 3''' · November 29, 2026 · [[Soyjak Wiki:The Soy Chronicle/2026-11-29|Another edition]]
Short description of the issue.

keep in mind that:

  • Only listed issues appear. Drafts and embargoed issues are left out until their release date. If the entry hasn't appeared yet, purge the cache of the page.
  • The headings show in the table of contents, and links such as #November 2026 work. They however have no "edit" links, since they are generated.
  • The title and summary are shown as plain text. A missing title is replaced by the number and date; a missing title or summary shows an error and adds the page to Category:Newspaper pages with errors.
  • With no released issues, it shows "No issues yet."

Settings

In Module:News/config:

  • archiveMonthFormat: the heading format.
  • shortDateFormat: the entry date.
  • The archiveEntry and archiveEmpty labels: the entry line and the empty message.

local p = {}

local News = require('Module:News')

local function entry(state, issue)
	local rec = issue.rec
	local number = News.numberText(state, issue)
	local date = News.formatDate(News.need('shortDateFormat'), issue.date)
	local title, problem = nil, ''
	if rec.title then
		title = mw.text.nowiki(rec.title)
	else
		title = number .. ', ' .. date
		problem = ' ' .. News.errorText(state, 'missingField', { id = issue.id, field = 'title' })
	end
	local line = News.text(
		state,
		'archiveEntry',
		{ number = number, date = date, title = News.link(issue.page, title) }
	) .. problem
	if rec.summary then return line .. '<br>' .. mw.text.nowiki(rec.summary) end
	return line .. ' ' .. News.errorText(state, 'missingField', { id = issue.id, field = 'summary' })
end

function p.main(frame)
	local state = News.newState()
	local out, month = {}, nil
	for _, issue in ipairs(News.listed(News.today(frame))) do
		local key = issue.date:sub(1, 7)
		if key ~= month then
			month = key
			table.insert(out, '=== ' .. News.formatDate(News.need('archiveMonthFormat'), issue.date) .. ' ===')
		end
		table.insert(out, entry(state, issue))
	end
	if #out == 0 then return News.finish(state, News.text(state, 'archiveEmpty')) end
	return News.finish(state, table.concat(out, '\n\n'))
end

return p