diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-12-17 14:06:23 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-17 14:06:23 +0000 |
| commit | fe9844b8eac1daf3eeedf141e223d0733c892fa0 (patch) | |
| tree | e89ac30c35b3cd518c563db965fd44197cf0a6a0 /src | |
| parent | 250152cc1b6a67bd18f4b211856fa98ec06d8eda (diff) | |
Update production from staging (#48)
* Edit README (#28)
* Corrects Lallans instructions
* Adds instructions for adding a Scotsoun release
* Documents infrastructure
* Better contribution guidance
* Update README (#29)
* Updates references to branch names in README
* ESLint ignores Markdown
* Documents Coding Style
* Specifies upstream branch in README where salient
* Fixes Sangschaw winners list in Eiks 30 (#35)
* Fixes Sangschaw winners list in Eiks 30 (#36)
* Fixes Sangschaw winners list in Eiks 30 (#38)
* Eiks 31 (#41)
* Eiks 31
* Prettier dl's
* Prettier headings
---------
Co-authored-by: Joe Carstairs <jcarstairs@scottlogic.com>
* Reorder news (#42)
* Reslugs news items
* Fixes typo in getMostRecentNewsItem()
* Fixes typo in newUtils.getDate()
* Sorts news index from most recent to oldest
* Eiks 31 fixes (#43)
* Eiks 31 fixes
* Improves list styling
* Links to Leid title track on YouTube (#45)
* Eiks 31 fixes (#47)
* Links to Leid title track on YouTube
* Corrects Sangschaw pricing
* Update production (#37) (#49)
* Edit README (#28)
* Corrects Lallans instructions
* Adds instructions for adding a Scotsoun release
* Documents infrastructure
* Better contribution guidance
* Update README (#29)
* Updates references to branch names in README
* ESLint ignores Markdown
* Documents Coding Style
* Specifies upstream branch in README where salient
* Fixes Sangschaw winners list in Eiks 30 (#35)
* Fixes Sangschaw winners list in Eiks 30 (#36)
* Fixes Sangschaw winners list in Eiks 30 (#38)
---------
Co-authored-by: Joe Carstairs <jcarstairs@scottlogic.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/LallansIssueContributions.astro | 8 | ||||
| -rw-r--r-- | src/components/LallansIssueContributors.astro | 4 | ||||
| -rw-r--r-- | src/components/Scotsoun.astro | 2 | ||||
| -rw-r--r-- | src/content/news/en-GB/2023-03-17-eiks-30.mdx (renamed from src/content/news/en-GB/2023-03-17-eiks-an-ens-30.mdx) | 0 | ||||
| -rw-r--r-- | src/content/news/en-GB/2023-12-10-eiks-31.mdx | 120 | ||||
| -rw-r--r-- | src/content/news/sco/2023-03-17-eiks-30.mdx (renamed from src/content/news/sco/2023-03-17-eiks-an-ens-30.mdx) | 0 | ||||
| -rw-r--r-- | src/content/news/sco/2023-12-10-eiks-31.mdx | 116 | ||||
| -rw-r--r-- | src/lib/newsUtils.ts | 20 | ||||
| -rw-r--r-- | src/pages/[locale]/news/[...slug].astro | 23 | ||||
| -rw-r--r-- | src/pages/[locale]/news/index.astro | 6 |
10 files changed, 266 insertions, 33 deletions
diff --git a/src/components/LallansIssueContributions.astro b/src/components/LallansIssueContributions.astro index 5d3084d..165829d 100644 --- a/src/components/LallansIssueContributions.astro +++ b/src/components/LallansIssueContributions.astro @@ -15,13 +15,15 @@ const t = translate(locale); <section> <h2>Contributions</h2> - <ul class="lallans-issue__contributions"> + <ul class="product__contributions"> { contributions.map((contribution) => ( <li> - <span class="italic">{contribution.title}</span> + <span class="product__contribution__title">{contribution.title}</span> {'author' in contribution && ( - <span> {t(tSite, { key: 'by' }) + ' ' + contribution.author}</span> + <span class="product__contribution__author"> + {t(tSite, { key: 'by' }) + ' ' + contribution.author} + </span> )} </li> )) diff --git a/src/components/LallansIssueContributors.astro b/src/components/LallansIssueContributors.astro index 5ac5d42..4a5683c 100644 --- a/src/components/LallansIssueContributors.astro +++ b/src/components/LallansIssueContributors.astro @@ -8,9 +8,9 @@ interface Props { const { contributors } = Astro.props; --- -<section class="lallans-contributors"> +<section> <h2>Contributors</h2> - <ul> + <ul class="product__contributors"> {contributors.map((contributor) => <li>{contributor}</li>)} </ul> </section> diff --git a/src/components/Scotsoun.astro b/src/components/Scotsoun.astro index bbf9730..cca330d 100644 --- a/src/components/Scotsoun.astro +++ b/src/components/Scotsoun.astro @@ -56,7 +56,7 @@ const t = translate(locale); scotsoun?.trackList && scotsoun.trackList.length > 1 && ( <> <h2>Track list</h2> - <ol> + <ol class="product__track-list"> {scotsoun.trackList.map((track) => ( <li>{track}</li> ))} diff --git a/src/content/news/en-GB/2023-03-17-eiks-an-ens-30.mdx b/src/content/news/en-GB/2023-03-17-eiks-30.mdx index 34a83ac..34a83ac 100644 --- a/src/content/news/en-GB/2023-03-17-eiks-an-ens-30.mdx +++ b/src/content/news/en-GB/2023-03-17-eiks-30.mdx diff --git a/src/content/news/en-GB/2023-12-10-eiks-31.mdx b/src/content/news/en-GB/2023-12-10-eiks-31.mdx new file mode 100644 index 0000000..aff0d2a --- /dev/null +++ b/src/content/news/en-GB/2023-12-10-eiks-31.mdx @@ -0,0 +1,120 @@ +--- +title: Eiks an Ens 31 +summary: >- + The 2024 Sangschaw is open for submissions! Not only that, learn about a new + Scots-language audio guide at Linlithgow Palace and an upcoming album release + from our very own Wullie Hershaw. +--- +import Link from '$components/Link.astro'; + +## Sangschaw open for submissions! + +Our annual writing competition, the _Sangschaw_, is open for submissions until +the 31st of January! As ever, we will provide feedback for every entry +regardless of whether or not you win an award. It’s unusual for competitions +like us to provide feedback on entries, but we think it’s important to help +writers develop. We have three prizes: + +- The **Robert McLellan Prize for Scots Prose**: up to 3000 words of original + Scots prose. +- The **John MacPhail Law Prize for Translation**: up to 3000 words of + original translation into Scots from another language. Provide along with a + copy of the original text. +- The **Hugh MacDiarmaid Tassie for Poetry**: up to 60 lines of original Scots + poetry. + +Writers new and old are all welcome, so don’t hold back! We look forward to +having your entries! + +You can enter for £5 for one category, £10 for two or £12 for all three, +whether that’s all in the same category or spread across the three. You can +submit either by email or by post. + +### Submitting by email + +If you would like to submit by email, first pay by bank transfer to the +following account. Remember, it’s £5 for one submission or £12 for three. + +<dl> + <dt>Account name</dt> + <dd>Scots Language Society</dd> + + <dt>Account number</dt> + <dd>00153458</dd> + + <dt>Sort code</dt> + <dd>83 47 00</dd> +</dl> + +Then, send your entries to +<Link href="mailto:failte@go-plus.net">failte@go-plus.net</Link> along with +proof of payment. For example, you could send a picture of you bank statement, +or a copy of the transaction reference. + +### Submitting by post + +If you would rather submit by post, send your entries with cash or cheque, +as well as your name and address on a separate sheet of paper, to the following +address: + +<address> + Sangschaw + c/o 6 Dryden Place + Edinburgh + EH9 1RP +</address> + +Remember it’s £5 per submission or £12 for three. Address any +cheque to the Scots Language Society. + +## Upcoming album release: _Leid_ + +Our very own Wullie Hershaw will soon be releasing a new album of contemporary +Scots songs titled _Leid_. It will be coming early in the new year, so stay +tuned in! + +To whet your appetite, you can +<Link href="https://www.youtube.com/watch?v=23YYajAFNHQ">listen to the title track on YouTube</Link>. +You can also have a listen to the musical work of his group, +<Link href="https://thebowhillplayers.bandcamp.com">the Bowhill Players on Bandcamp</Link>. + +## New audio guide at Linlithgow Palace + +This winter, the good folks at Historic Environment Scotland have translated +their audio guides for visitors into Scots for the first time. The aim is to +promote the status of the Scots language as well as to give visitors the +opportunity to hear the voices of the court in something approaching their own +language. + +You can read more +<Link href="https://hes-newsroom.prgloo.com/news/new-scots-lug-in-guide-at-lithgae-palace">about the new audio guides on the Historic Environment Scotland website</Link>. + +As far as we know, this is the first such venture, not only by Historic +Environment Scotland, but at any major tourist attraction. Can anybody think of +anything similar? Answers on a postcard please! + +## Haven’t received Lallans 103 yet? + +It has come to the attention of George, our membership secretary, that there +has been an error with the posting of _Lallans_ 103. Two members, both +subscribers entitled to issue 103, failed to receive their copies. + +If you haven’t yet received your copy of _Lallans_ 103, which he posted out on +Wednesday the 7th of November, please email George at +<Link href="mailto:georgetwatt@hotmail.com">georgetwatt@hotmail.com</Link> +and make us aware of it. A copy of _Lallans_ 103 will be posted out to you +straight away! + +## New format for Eiks an Ens + +Old friends will recall that _Eiks an Ens_ has formerly been a literary +magazine to accompany _Lallans_. We on the Committee felt that this neither +gave _Eiks_ the distinct identity which it deserved, nor took full advantage of +the opportunity it afforded to hold our community together. + +Therefore, this is the first issue of _Eiks_ to take a new format, where we’ll +be endeavouring to share current affairs in the world of Scots language and +literature, especially where it relates directly to our membership. + +So send us in your inside information! If you’ve spotted something you think we +ought to share in the next _Eiks_, send it to lallans@hotmail.co.uk. diff --git a/src/content/news/sco/2023-03-17-eiks-an-ens-30.mdx b/src/content/news/sco/2023-03-17-eiks-30.mdx index 201642c..201642c 100644 --- a/src/content/news/sco/2023-03-17-eiks-an-ens-30.mdx +++ b/src/content/news/sco/2023-03-17-eiks-30.mdx diff --git a/src/content/news/sco/2023-12-10-eiks-31.mdx b/src/content/news/sco/2023-12-10-eiks-31.mdx new file mode 100644 index 0000000..3569788 --- /dev/null +++ b/src/content/news/sco/2023-12-10-eiks-31.mdx @@ -0,0 +1,116 @@ +--- +title: Eiks an Ens 31 +summary: >- + The 2024 Sangschaw is open for submeissions! Forby, lairn about a new lug-in + guide at Lithgae Pailace and an upcomin album release bi our ain Wullie + Hershaw. +--- +import Link from '$components/Link.astro'; + +## Sangschaw open for submeissions! + +Our annual scrievin competeition, the _Sangschaw_, is open for submeissions +until the 31st o Januar! As ey, we will provide feedback for ilka entry nae +maiter whither ye win a tassie or no. There’s no mony competeitions provide +feedback on entries, but we think it’s important tae help writers develop. We +hae three tassies: + +- The **Robert McLellan Tassie for Scots Prose**: up til 3000 wirds o oreiginal + Scots prose. +- The **John MacPhail Law Tassie for Owersettin**: up til 3000 wirds o + oreiginal owersettin intil Scots frae anither leid. Provide alang wi a copy o + the oreiginal text. +- The **Hugh MacDiarmaid Tassie for Poesie**: up til 60 lines o oreiginal Scots + poesie. + +New writers and auld haunds ar aa walcome, sae dinnae be blate! We luik forrit +tae haein your entries! + +It’s £5 for ae submeission, or £12 for three, whither in the same categorie +or in different categories. Ye can either submit by email or by post. + +### Submittin by email + +Gin ye want tae submit by email, first pey by bank transfer til the follaein +account. Mind it’s £5 per submeission or £12 for three. + +<dl> + <dt>Account nem</dt> + <dd>Scots Language Society</dd> + + <dt>Account number</dt> + <dd>00153458</dd> + + <dt>Sort code</dt> + <dd>83 47 00</dd> +</dl> + +Syne, send your entries til +<Link href="mailto:failte@go-plus.net">failte@go-plus.net</Link> alang wi pruif +o peyment. For ensaumple, you could send a photae o your bank +statement, or a copy o the transaction reference. + +### Submittin by post + +Gin ye want tae submit by post, send them wi cash or cheque as weill as your nem +and your return address on a separate sheet o paper til the follaein address: + +<address> + Sangschaw + c/o 6 Dryden Place + Edinburgh + EH9 1RP +</address> + +Mind it’s £5 per submeission or £12 for three. Address ony +cheque til the Scots Language Society. + +## Upcomin album release: _Leid_ + +Our ain Wullie Hershaw will shuin be releasin a new album o contemporar Scots +sangs titled _Leid_. It will be comin early in the new year, sae haud tuned in! + +For tae whet your appetite, you can +<Link href="https://www.youtube.com/watch?v=23YYajAFNHQ">lug in til the title track on YouTube</Link>. +Ye can forby pree the muisical wark o his group, +<Link href="https://thebowhillplayers.bandcamp.com">the Bowhill Players on +Bandcamp</Link>. + +## New lug-in guide at Lithgae Pailace + +This winter, the guid fowks at Historic Environment Scotland hae owerset their +lug-in guides for veisitors intil Scots for the first time. The aim is tae +promuive the status o the Scots leid as weill as tae gie veisitors the +opportunitie tae hear the vyces o the court in somethin like their ain leid. + +Ye can read mair +<Link href="https://hes-newsroom.prgloo.com/news/new-scots-lug-in-guide-at-lithgae-palace">about the new lug-in guides on the Historic Environment Scotland wabsteid</Link>. + +As faur as we ken, this is first sic ventur, no juist bi Historic Environment +Scotland, but frae ony major tourist attraction. Can onybody mind o ocht +similar? Answers on a postcaird pleise! + +## No received Lallans 103 yet? + +It haes cam tae the notice o George, our membership secretar, that thare haes +been a mishanter wi the postin o _Lallans_ 103. Twa memmers, baith subscribers +awed _Lallans_ 103, didnae receive thair copies. + +Gin ye haenae yet received yer copy o _Lallans_ 103, that he postit out on +Wadnesday 7th o November, pleise email George at +<Link href="mailto:georgetwatt@hotmail.com"> georgetwatt@hotmail.com</Link> an +mak us ken o it. A copy o _Lallans_ 103 will be postit out tae ye straucht awa! + +## New format for Eiks an Ens + +Auld freinds will mind that _Eiks an Ens_ haes formerlie been a leiterar magazine +tae accompanie _Lallans_. We on the Comatee felt that this didnae gie Eiks an +Ens the distinct purpose that it deserved, and it didnae tak fu advauntage o +the opportunitie _Eiks_ affuirdit tae jeel our communitie thegether. + +Sae this is the first issue o _Eiks_ tae tak a new format, whaur we’ll be +ettlin tae skair current affairs i the warld o Scots leid and leitratur, +especially whaur it effeirs directly til our membership. + +Sae send us in your inside information! Gin ye’ve spottit somethin you think +we shuid skair in the neist _Eiks_, send it til lallans@hotmail.co.uk. diff --git a/src/lib/newsUtils.ts b/src/lib/newsUtils.ts index aa711e3..bffc7d6 100644 --- a/src/lib/newsUtils.ts +++ b/src/lib/newsUtils.ts @@ -1,5 +1,6 @@ +import locales from '$i18n/locales'; import type Locale from '$types/Locale'; -import { CollectionEntry, getCollection } from 'astro:content'; +import { getCollection, type CollectionEntry } from 'astro:content'; export async function getMostRecentNewsItem(locale: Locale) { const allNews = await getCollection('news'); @@ -8,7 +9,7 @@ export async function getMostRecentNewsItem(locale: Locale) { if (!someNewsItem) { return null; } - return allNewsInLocale.reduce((prev, curr) => (isBefore(curr, prev) ? curr : prev), someNewsItem); + return allNewsInLocale.reduce((prev, curr) => (isBefore(prev, curr) ? curr : prev), someNewsItem); } export function getLocale(newsItem: CollectionEntry<'news'>) { @@ -18,7 +19,13 @@ export function getLocale(newsItem: CollectionEntry<'news'>) { export function getHref(newsItem: CollectionEntry<'news'>) { const locale = getLocale(newsItem); - return `/${locale}/news/${newsItem.slug.replace('/', '-')}`; + return `/${locale}/news/${getSlug(newsItem)}`; +} + +export function getSlug(newsItem: CollectionEntry<'news'>) { + const toLowerCase = (s: string) => s.toLowerCase(); + const matchLocales = new RegExp(`(${locales.map(toLowerCase).join('|')})/`); + return newsItem.slug.replace(matchLocales, ''); } export function isNewsItemInLocale(newsItem: CollectionEntry<'news'>, locale: Locale) { @@ -26,7 +33,7 @@ export function isNewsItemInLocale(newsItem: CollectionEntry<'news'>, locale: Lo return newsItemLocale === locale; } -function isBefore(item1: CollectionEntry<'news'>, item2: CollectionEntry<'news'>) { +export function isBefore(item1: CollectionEntry<'news'>, item2: CollectionEntry<'news'>) { const date1 = getDate(item1); const date2 = getDate(item2); if (!date2) { @@ -39,6 +46,7 @@ function isBefore(item1: CollectionEntry<'news'>, item2: CollectionEntry<'news'> } export function getDate(newsItem: CollectionEntry<'news'>) { - const match = newsItem.id.match(/(?<=(en-GB|sco))\/(\d\d\d\d-\d\d-\d\d)/)?.[2]; - return match ? new Date(match) : null; + const matchDate = new RegExp(`(${locales.join('|')})/(\\d\\d\\d\\d-\\d\\d-\\d\\d)`); + const date = newsItem.id.match(matchDate)?.[2]; + return date ? new Date(date) : null; } diff --git a/src/pages/[locale]/news/[...slug].astro b/src/pages/[locale]/news/[...slug].astro index e3b8b36..a24e65a 100644 --- a/src/pages/[locale]/news/[...slug].astro +++ b/src/pages/[locale]/news/[...slug].astro @@ -1,28 +1,13 @@ --- -import locales from '$i18n/locales'; import Article from '$layouts/Article.astro'; -import type Locale from '$types/Locale'; -import { CollectionEntry, getCollection } from 'astro:content'; +import { getCollection } from 'astro:content'; +import { getLocale, getSlug } from '$lib/newsUtils'; export async function getStaticPaths() { - function localeFromSlug(slug: CollectionEntry<'news'>['slug']): Locale | undefined { - const lowerCaseLocale = new RegExp(`^(${locales.map((l) => l.toLocaleLowerCase()).join('|')})`); - const matchedLowerCaseLocale = slug.match(lowerCaseLocale)?.[1]; - switch (matchedLowerCaseLocale) { - case 'sco': - return 'sco'; - case 'en-gb': - return 'en-GB'; - default: - console.warn('Could not find locale in slug %s', slug); - return undefined; - } - } - return (await getCollection('news')).map((entry) => ({ params: { - slug: entry.slug.replace('/', '-'), - locale: localeFromSlug(entry.slug), + slug: getSlug(entry), + locale: getLocale(entry), }, props: { entry }, })); diff --git a/src/pages/[locale]/news/index.astro b/src/pages/[locale]/news/index.astro index 37e7dd6..112f87b 100644 --- a/src/pages/[locale]/news/index.astro +++ b/src/pages/[locale]/news/index.astro @@ -5,12 +5,14 @@ import Page from '$layouts/Page.astro'; import { getLocaleFromPathOrThrow } from '$lib/getLocaleFromPath'; import localeStaticPaths from '$lib/localeStaticPaths'; import { getCollection } from 'astro:content'; -import { isNewsItemInLocale } from '$lib/newsUtils'; +import { isBefore, isNewsItemInLocale } from '$lib/newsUtils'; import NewsIndex from '$components/NewsIndex/NewsIndex.astro'; const allNews = await getCollection('news'); const locale = getLocaleFromPathOrThrow(Astro.url.pathname); -const allNewsInLocale = allNews.filter((item) => isNewsItemInLocale(item, locale)); +const allNewsInLocale = allNews + .filter((item) => isNewsItemInLocale(item, locale)) + .sort((a, b) => (isBefore(a, b) ? 1 : isBefore(b, a) ? -1 : 0)); const t = translate(locale); export async function getStaticPaths() { |
