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 f47a064d..9909701c 100644 Binary files a/examples/alan-turing-portal/markdown.db and b/examples/alan-turing-portal/markdown.db differ diff --git a/examples/alan-turing-portal/pages/[...slug].jsx b/examples/alan-turing-portal/pages/[...slug].jsx index 77227f8c..e8bb71c6 100644 --- a/examples/alan-turing-portal/pages/[...slug].jsx +++ b/examples/alan-turing-portal/pages/[...slug].jsx @@ -2,11 +2,11 @@ import { Container } from '../components/Container' import clientPromise from '../lib/mddb' import { promises as fs } from 'fs'; import { MDXRemote } from 'next-mdx-remote' -import { serialize } from 'next-mdx-remote/serialize' import { Card } from '../components/Card' import Head from 'next/head' import parse from '../lib/markdown' import { Mermaid } from '@flowershow/core'; +import { Header } from '../components/Header'; export const getStaticProps = async ({ params }) => { 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}", ],