From f6b8ef2190134909ec5283acbb48f34347cd61c4 Mon Sep 17 00:00:00 2001 From: Luccas Mateus de Medeiros Gomes Date: Mon, 8 May 2023 08:44:22 -0300 Subject: [PATCH] [alan-turing][sm] - fixes requested --- .../alan-turing-portal/components/Header.jsx | 10 +---- .../content/{index.md => index.mdx} | 38 ++++++++++++------ examples/alan-turing-portal/markdown.db | Bin 45056 -> 45056 bytes .../alan-turing-portal/pages/[...slug].jsx | 6 ++- .../alan-turing-portal/pages/_document.jsx | 10 +---- examples/alan-turing-portal/pages/index.jsx | 2 +- .../alan-turing-portal/tailwind.config.js | 1 + 7 files changed, 33 insertions(+), 34 deletions(-) rename examples/alan-turing-portal/content/{index.md => index.mdx} (58%) diff --git a/examples/alan-turing-portal/components/Header.jsx b/examples/alan-turing-portal/components/Header.jsx index 98ab6efd..3d438dc9 100644 --- a/examples/alan-turing-portal/components/Header.jsx +++ b/examples/alan-turing-portal/components/Header.jsx @@ -45,16 +45,8 @@ function ModeToggle() { function toggleMode() { disableTransitionsTemporarily() - - let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)') - let isSystemDarkMode = darkModeMediaQuery.matches let isDarkMode = document.documentElement.classList.toggle('dark') - - if (isDarkMode === isSystemDarkMode) { - delete window.localStorage.isDarkMode - } else { - window.localStorage.isDarkMode = isDarkMode - } + window.localStorage.isDarkMode = isDarkMode } return ( diff --git a/examples/alan-turing-portal/content/index.md b/examples/alan-turing-portal/content/index.mdx similarity index 58% rename from examples/alan-turing-portal/content/index.md rename to examples/alan-turing-portal/content/index.mdx index 758f1739..efd038f6 100644 --- a/examples/alan-turing-portal/content/index.md +++ b/examples/alan-turing-portal/content/index.mdx @@ -12,23 +12,35 @@ If you use these resources, please cite (and read!) our paper: Directions in Abu If you’re looking for a good paper on online hate training datasets (beyond our paper, of course!) then have a look at ‘Resources and benchmark corpora for hate speech detection: a systematic review’ by Poletto et al. in Language Resources and Evaluation. +See the datasets + ## How to contribute We accept entries to our catalogue based on pull requests to the content folder. The dataset must be avaliable for download to be included in the list. If you want to add an entry, follow these steps! Please send just one dataset addition/edit at a time - edit it in, then save. This will make everyone’s life easier (including yours!) -- Go to the repo url file and click the "Add file" dropdown and then click on "Create new file". -![](https://i.imgur.com/2PR0ZgL.png) - -- In the following page type `content/datasets/.md`. if you want to add an entry to the datasets catalog or `content/keywords/.md` if you want to add an entry to the lists of abusive keywords, if you want to just add an static page you can leave in the root of `content` it will automatically get assigned an url eg: `/content/about.md` becomes the `/about` page -![](https://i.imgur.com/rr3uSYu.png) - -- Copy the contents of `templates/dataset.md` or `templates/keywords.md` respectively to the camp below, filling out the fields with the correct data format -![](https://i.imgur.com/x6JIjhz.png) - -- Click on "Commit changes", on the popup make sure you give some brief detail on the proposed change. and then click on Propose changes - - -- Submit the pull request on the next page when prompted. +### Create file + +Go to the repo url file and click the "Add file" dropdown and then click on "Create new file". +![](https://i.imgur.com/2PR0ZgL.png) + +### Choose location + +In the following page type `content/datasets/.md`. if you want to add an entry to the datasets catalog or `content/keywords/.md` if you want to add an entry to the lists of abusive keywords, if you want to just add an static page you can leave in the root of `content` it will automatically get assigned an url eg: `/content/about.md` becomes the `/about` page +![](https://i.imgur.com/rr3uSYu.png) + +### Fill in content + +Copy the contents of `templates/dataset.md` or `templates/keywords.md` respectively to the camp below, filling out the fields with the correct data format +![](https://i.imgur.com/x6JIjhz.png) + +### Commit changes + +Click on "Commit changes", on the popup make sure you give some brief detail on the proposed change. and then click on Propose changes + + +### Submit PR + +Submit the pull request on the next page when prompted. diff --git a/examples/alan-turing-portal/markdown.db b/examples/alan-turing-portal/markdown.db index f47a064d6a49d893c0cd513bf53fa8caaf0984e3..9909701c5763e5e70c462ee37995b899801ff3a7 100644 GIT binary patch delta 453 zcmZp8z|`=7X@a!iVg?2VZXkw%sS|aK85eI%u;XK7**u>whmnJo|2O|P<|~X78{ckb z613oR&1GVb)feVxh)**!NH$3_F*hfD?_Yq{9CfFv*P4hDW--lu#s`4#x9cz5vS z@CosK=D)&sjDPuN1%+;YU1Dux(q@k3oV-C^LkVmy&wB>`H~ee(!}wYGF7c)E3Gi;> zZQ(WMzs4)f^M13T!dafpAAFuOiHb7oGh#S&@@s!d5fA{;?VX84L^{H*;?m zG5E+dal+Nj_ZBPhYzkm=;ALRoU(RpA^_Ja}24OY7or{^7m4W*NdowfZ#>VeVn^}#2 G^8f&7x`FNh delta 448 zcmZp8z|`=7X@a!iOa=x9ZXkw%o{2ifj59YT*zqy4Zl2GV!^p|a|C|3C^EF1MiH+|z z30m+uXEU+K>I(8R#G6?r8Jnf08W^P*86;Ym8d@3|nwc0IrdS$U8km?QrBc`Puj`^QG|#@^0pB { const urlPath = params.slug ? params.slug.join('/') : '' @@ -82,10 +82,12 @@ export default function DRDPage({ mdxSource }) { ) return ( <> +
{meta.title} - + +

diff --git a/examples/alan-turing-portal/pages/_document.jsx b/examples/alan-turing-portal/pages/_document.jsx index 307d1a77..68e37ba4 100644 --- a/examples/alan-turing-portal/pages/_document.jsx +++ b/examples/alan-turing-portal/pages/_document.jsx @@ -1,25 +1,17 @@ import { Head, Html, Main, NextScript } from 'next/document' const modeScript = ` - let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)') - updateMode() - darkModeMediaQuery.addEventListener('change', updateModeWithoutTransitions) window.addEventListener('storage', updateModeWithoutTransitions) function updateMode() { - let isSystemDarkMode = darkModeMediaQuery.matches - let isDarkMode = window.localStorage.isDarkMode === 'true' || (!('isDarkMode' in window.localStorage) && isSystemDarkMode) + let isDarkMode = window.localStorage.isDarkMode === 'true' if (isDarkMode) { document.documentElement.classList.add('dark') } else { document.documentElement.classList.remove('dark') } - - if (isDarkMode === isSystemDarkMode) { - delete window.localStorage.isDarkMode - } } function disableTransitionsTemporarily() { diff --git a/examples/alan-turing-portal/pages/index.jsx b/examples/alan-turing-portal/pages/index.jsx index 3ee70c68..8d067e0d 100644 --- a/examples/alan-turing-portal/pages/index.jsx +++ b/examples/alan-turing-portal/pages/index.jsx @@ -139,7 +139,7 @@ export default function Home({

{indexText.frontmatter.title}

-
+
diff --git a/examples/alan-turing-portal/tailwind.config.js b/examples/alan-turing-portal/tailwind.config.js index 1717462b..a459329d 100644 --- a/examples/alan-turing-portal/tailwind.config.js +++ b/examples/alan-turing-portal/tailwind.config.js @@ -2,6 +2,7 @@ module.exports = { content: [ "./app/**/*.{js,ts,jsx,tsx,mdx}", + "./content/**/*.{js,ts,jsx,tsx,mdx}", "./pages/**/*.{js,ts,jsx,tsx,mdx}", "./components/**/*.{js,ts,jsx,tsx,mdx}", ],