From bb3bc967d8728eaf3e5b50810cca1202a1c1d8de Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 26 Mar 2021 21:04:29 +0300 Subject: [PATCH] Fix blinks and separate project tag and project type. --- gatsby-config.js | 1 - gatsby-node.js | 4 +- package.json | 3 +- src/components/layout.js | 4 +- src/components/navBar.js | 54 ++++++++------- src/components/projectsNavbar.js | 41 ++++++++++++ src/components/redirect.js | 2 +- src/components/templates/news.js | 4 +- src/components/templates/projectsTemplate.js | 62 +++++++++++++++++ src/content/en/projects/education/analysis.md | 3 +- src/content/en/projects/education/atom.md | 3 +- src/content/en/projects/education/kotlin.md | 3 +- src/content/en/projects/education/labs.md | 3 +- .../en/projects/education/lowbackground.md | 3 +- src/content/en/projects/math/deconvolution.md | 3 +- src/content/en/projects/math/significance.md | 3 +- src/content/en/projects/physics/gerda.md | 3 +- src/content/en/projects/physics/iaxo.md | 3 +- src/content/en/projects/physics/mm.md | 3 +- src/content/en/projects/physics/numass.md | 3 +- src/content/en/projects/physics/satelite.md | 3 +- .../en/projects/physics/spectMatter.md | 3 +- src/content/en/projects/physics/tgf.md | 3 +- src/content/en/projects/software/biref.md | 3 +- src/content/en/projects/software/dataforge.md | 3 +- src/content/en/projects/software/kmath.md | 3 +- src/content/en/projects/software/muon-sim.md | 3 +- src/content/en/projects/software/plotly.md | 3 +- .../en/projects/software/prog-seminar.md | 3 +- src/content/en/projects/software/reactor.md | 3 +- .../ru/{compMethods => magprog}/intro.md | 0 src/content/ru/projects/education/analysis.md | 3 +- src/content/ru/projects/education/atom.md | 3 +- src/content/ru/projects/education/kotlin.md | 3 +- src/content/ru/projects/education/labs.md | 3 +- .../ru/projects/education/lowbackground.md | 3 +- src/content/ru/projects/math/deconvolution.md | 3 +- src/content/ru/projects/math/significance.md | 3 +- src/content/ru/projects/physics/gerda.md | 3 +- src/content/ru/projects/physics/iaxo.md | 3 +- src/content/ru/projects/physics/mm.md | 3 +- src/content/ru/projects/physics/numass.md | 3 +- src/content/ru/projects/physics/satelite.md | 3 +- .../ru/projects/physics/spectMatter.md | 3 +- src/content/ru/projects/physics/tgf.md | 3 +- src/content/ru/projects/software/biref.md | 3 +- src/content/ru/projects/software/dataforge.md | 3 +- src/content/ru/projects/software/kmath.md | 3 +- src/content/ru/projects/software/muon-sim.md | 3 +- src/content/ru/projects/software/plotly.md | 3 +- .../ru/projects/software/prog-seminar.md | 3 +- src/content/ru/projects/software/reactor.md | 3 +- src/pages/about.js | 10 ++- src/pages/index.js | 7 +- src/pages/magprog.js | 2 +- src/pages/partners.js | 7 +- src/pages/projects/education.js | 22 ++---- src/pages/projects/math.js | 59 +++------------- src/pages/projects/physics.js | 57 +++------------- src/pages/projects/software.js | 67 +++---------------- src/pages/publications.js | 7 +- src/pages/quarks.js | 7 +- src/styles/navbar.css | 22 ++++-- 63 files changed, 285 insertions(+), 283 deletions(-) create mode 100644 src/components/projectsNavbar.js create mode 100644 src/components/templates/projectsTemplate.js rename src/content/ru/{compMethods => magprog}/intro.md (100%) diff --git a/gatsby-config.js b/gatsby-config.js index 3709ac1..243731f 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -3,7 +3,6 @@ module.exports = { title: `MIPT-NPM laboratory`, description: `Nuclear Physics Methods Laboratory`, }, - plugins: [ { resolve: 'gatsby-source-filesystem', diff --git a/gatsby-node.js b/gatsby-node.js index 45f41c2..8ea7d98 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -26,7 +26,7 @@ exports.createPages = async ({actions, graphql}) => { const result = await graphql(` { courses: allMarkdownRemark( - filter: {frontmatter: {content_type: {eq: "page_education"}, published: {eq: true}}} + filter: {frontmatter: {content_type: {eq: "page_education"}, published: {ne: false}}} ){ edges{ node{ @@ -40,7 +40,7 @@ exports.createPages = async ({actions, graphql}) => { } news: allMarkdownRemark( - filter: {frontmatter: {content_type: {eq: "post"}, published: {eq: true}}}, + filter: {frontmatter: {content_type: {eq: "post"}, published: {ne: false}}}, sort: {fields: [frontmatter___date], order: DESC} ) { edges{ diff --git a/package.json b/package.json index 6299b50..d7b0203 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,8 @@ "name": "npm-site", "private": true, "description": "Nuclear Physics Methods laboratory", - "version": "0.1.0", + "version": "0.2.0", "dependencies": { - "@types/bootstrap": "5.0.9", "bootstrap": "4.6.0", "gatsby": "3.1.1", "gatsby-awesome-pagination": "0.3.6", diff --git a/src/components/layout.js b/src/components/layout.js index 0398f92..867f619 100644 --- a/src/components/layout.js +++ b/src/components/layout.js @@ -1,6 +1,6 @@ import React from "react" import PropTypes from "prop-types" -import {injectIntl, useIntl} from "gatsby-plugin-react-intl" +import {injectIntl, useIntl} from "react-intl" import Navbar from "./navBar" import Footer from "./footer" @@ -15,8 +15,8 @@ const Layout = ({children}) => { const lang = intl.locale; return ( <> - +
{children}
diff --git a/src/components/navBar.js b/src/components/navBar.js index e3f16bf..7495085 100644 --- a/src/components/navBar.js +++ b/src/components/navBar.js @@ -2,54 +2,62 @@ import React from "react" import {Link} from "gatsby" import {globalHistory as history} from '@reach/router' -import {FormattedMessage, injectIntl, useIntl} from "gatsby-plugin-react-intl" +import {FormattedMessage, injectIntl, useIntl} from "react-intl" import {Container, Nav, Navbar} from "react-bootstrap" import Language from "./language" -import SEO from "./seo" import "../styles/navbar.css" import logo from "../images/index/logo_white.png" const CustomNavbar = () => { - const {location} = history; + const intl = useIntl(); - let active = ["", "", "", ""] - active[0] = location.pathname.includes('/news/') ? 'active' : "link-no-style"; - active[1] = location.pathname.includes('/about/') ? 'active' : "link-no-style"; - active[2] = location.pathname.includes('/projects/') ? 'active' : "link-no-style"; - active[3] = location.pathname.includes('/partners/') ? 'active' : "link-no-style"; + const {location} = history; + //let active = ["", "", "", ""] + // active[0] = location.pathname.includes('/news/') ? 'active' : "link-no-style"; + // active[1] = location.pathname.includes('/about/') ? 'active' : "link-no-style"; + // active[2] = location.pathname.includes('/projects/') ? 'active' : "link-no-style"; + // active[3] = location.pathname.includes('/partners/') ? 'active' : "link-no-style"; let activeBrand = location.pathname === "/ru/" || location.pathname === "/en/" ? 'activeBrand' : "link-no-style"; - const intl = useIntl(); - const lang = intl.locale; + return ( <> - - + - + diff --git a/src/components/projectsNavbar.js b/src/components/projectsNavbar.js new file mode 100644 index 0000000..9330dcc --- /dev/null +++ b/src/components/projectsNavbar.js @@ -0,0 +1,41 @@ +import {Link} from "gatsby-plugin-react-intl"; +import {FormattedMessage} from "react-intl"; +import React from "react"; + + +export default function ProjectsNavbar({project_type}) { + function navClasses(nav) { + if (project_type === nav) { + return "nav-link active" + } else { + return "nav-link" + } + } + + return ( + <> +
    +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
+ + ) +} \ No newline at end of file diff --git a/src/components/redirect.js b/src/components/redirect.js index a267337..78e5442 100644 --- a/src/components/redirect.js +++ b/src/components/redirect.js @@ -1,5 +1,5 @@ import React from "react" -import {injectIntl} from "gatsby-plugin-react-intl" +import {injectIntl} from "react-intl" import SEO from "./seo" const Redirect = ({intl}) => { diff --git a/src/components/templates/news.js b/src/components/templates/news.js index 65a3475..7b749cf 100644 --- a/src/components/templates/news.js +++ b/src/components/templates/news.js @@ -55,7 +55,7 @@ export default injectIntl(NewsTemplate) export const query = graphql` query NewsQuery($limit: Int!, $skip: Int!) { ru_news: allMarkdownRemark( - filter: {frontmatter: {content_type: {eq: "post"}, published: {eq: true}, language: {eq: "ru"}}}, + filter: {frontmatter: {content_type: {eq: "post"}, published: {ne: false}, language: {eq: "ru"}}}, sort: {fields: [frontmatter___date], order: DESC}, limit: $limit skip: $skip @@ -73,7 +73,7 @@ export const query = graphql` } en_news: allMarkdownRemark( - filter: {frontmatter: {content_type: {eq: "post"}, published: {eq: true}, language: {eq: "en"}}}, + filter: {frontmatter: {content_type: {eq: "post"}, published: {ne: false}, language: {eq: "en"}}}, sort: {fields: [frontmatter___date], order: DESC}, limit: $limit skip: $skip diff --git a/src/components/templates/projectsTemplate.js b/src/components/templates/projectsTemplate.js new file mode 100644 index 0000000..c8a837d --- /dev/null +++ b/src/components/templates/projectsTemplate.js @@ -0,0 +1,62 @@ +import React from "react" +import {FormattedMessage} from "react-intl" +import {Link} from "gatsby-plugin-react-intl" +import Parser from "html-react-parser" +import ProjectsNavbar from "../projectsNavbar"; + +export default function Projects({projects, project_type}) { + return ( + <> + + +

+

+ +
    + {projects.map(({node}) => { + const link = node.frontmatter.shortTitle; + const id = node.frontmatter.id; + return ( +
  • {link}
  • + ) + })} +
+ + {projects.map(({node}) => { + const title = node.frontmatter.title; + const id = node.frontmatter.id; + return ( +
+
+
+

{title}

+
{Parser(node.html)}
+
+
+ ) + })} + {/* {posts.map(({node}) => { + const title = node.frontmatter.title; + const id = node.frontmatter.id; + const courseName = node.frontmatter.courseName; + return ( +
+
+
+

{title}

+
{Parser(node.html)}
+
+
+

+ +

+
+
+
+
+ ) + })}*/} + + ) +} \ No newline at end of file diff --git a/src/content/en/projects/education/analysis.md b/src/content/en/projects/education/analysis.md index f67ab15..f0618fb 100644 --- a/src/content/en/projects/education/analysis.md +++ b/src/content/en/projects/education/analysis.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: analysis shortTitle: Data analysis course title: Statistical methods in experimental physics diff --git a/src/content/en/projects/education/atom.md b/src/content/en/projects/education/atom.md index e3eb54c..420b625 100644 --- a/src/content/en/projects/education/atom.md +++ b/src/content/en/projects/education/atom.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: atom shortTitle: Lecture series on the history of the atomic project title: History of atomic project diff --git a/src/content/en/projects/education/kotlin.md b/src/content/en/projects/education/kotlin.md index 53c8988..71b8cab 100644 --- a/src/content/en/projects/education/kotlin.md +++ b/src/content/en/projects/education/kotlin.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: kotlin shortTitle: Scientific programming title: Introduction to Kotlin scientific programming diff --git a/src/content/en/projects/education/labs.md b/src/content/en/projects/education/labs.md index f5052e4..74ce6ba 100644 --- a/src/content/en/projects/education/labs.md +++ b/src/content/en/projects/education/labs.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: labs shortTitle: Laboratory works title: Laboratory work at the department of general physics diff --git a/src/content/en/projects/education/lowbackground.md b/src/content/en/projects/education/lowbackground.md index a8dc22f..2b60133 100644 --- a/src/content/en/projects/education/lowbackground.md +++ b/src/content/en/projects/education/lowbackground.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: lowbackground shortTitle: Low background experiment course title: Low background subterranean laboratory experiments course diff --git a/src/content/en/projects/math/deconvolution.md b/src/content/en/projects/math/deconvolution.md index 1c83540..4d89d3c 100644 --- a/src/content/en/projects/math/deconvolution.md +++ b/src/content/en/projects/math/deconvolution.md @@ -1,5 +1,6 @@ --- -content_type: project_math +content_type: project +project_type: math id: deconvolution shortTitle: Inverse problems title: Statistical regularization of incorrect inverse problems diff --git a/src/content/en/projects/math/significance.md b/src/content/en/projects/math/significance.md index a377832..bdec4a1 100644 --- a/src/content/en/projects/math/significance.md +++ b/src/content/en/projects/math/significance.md @@ -1,5 +1,6 @@ --- -content_type: project_math +content_type: project +project_type: math id: significance shortTitle: Significance functions title: Optimal experiment planning with parameter significance functions diff --git a/src/content/en/projects/physics/gerda.md b/src/content/en/projects/physics/gerda.md index edeb8eb..6d56991 100644 --- a/src/content/en/projects/physics/gerda.md +++ b/src/content/en/projects/physics/gerda.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: gerda shortTitle: GERDA title: International experiment GERDA diff --git a/src/content/en/projects/physics/iaxo.md b/src/content/en/projects/physics/iaxo.md index da7c860..0f4294d 100644 --- a/src/content/en/projects/physics/iaxo.md +++ b/src/content/en/projects/physics/iaxo.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: iaxo shortTitle: IAXO title: International collaboration IAXO diff --git a/src/content/en/projects/physics/mm.md b/src/content/en/projects/physics/mm.md index 49ed06c..0bb7768 100644 --- a/src/content/en/projects/physics/mm.md +++ b/src/content/en/projects/physics/mm.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: mounMonitor shortTitle: Muon monitor title: Muon monitor for subterranean low-background experiments diff --git a/src/content/en/projects/physics/numass.md b/src/content/en/projects/physics/numass.md index 83005a5..80236b9 100644 --- a/src/content/en/projects/physics/numass.md +++ b/src/content/en/projects/physics/numass.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: numass shortTitle: Troitsk nu-mass title: Neutrino mass search facility Troitsk nu-mass diff --git a/src/content/en/projects/physics/satelite.md b/src/content/en/projects/physics/satelite.md index 065d089..851a2e5 100644 --- a/src/content/en/projects/physics/satelite.md +++ b/src/content/en/projects/physics/satelite.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: satelite shortTitle: Satellite detector title: Satellite detector of solar radiation diff --git a/src/content/en/projects/physics/spectMatter.md b/src/content/en/projects/physics/spectMatter.md index 424977f..be173c4 100644 --- a/src/content/en/projects/physics/spectMatter.md +++ b/src/content/en/projects/physics/spectMatter.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: spectMatter shortTitle: Spectator matter title: Spectator matter diff --git a/src/content/en/projects/physics/tgf.md b/src/content/en/projects/physics/tgf.md index fbb25f2..fe9f29d 100644 --- a/src/content/en/projects/physics/tgf.md +++ b/src/content/en/projects/physics/tgf.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: atmosphere shortTitle: TGE/TGF title: Studying TGE and TGF diff --git a/src/content/en/projects/software/biref.md b/src/content/en/projects/software/biref.md index 65836df..c9d35ef 100644 --- a/src/content/en/projects/software/biref.md +++ b/src/content/en/projects/software/biref.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: biref shortTitle: Birefringence title: Data analysis in laboratory work on birefringence diff --git a/src/content/en/projects/software/dataforge.md b/src/content/en/projects/software/dataforge.md index 45c68fb..a837830 100644 --- a/src/content/en/projects/software/dataforge.md +++ b/src/content/en/projects/software/dataforge.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: dataforge shortTitle: DataForge title: DataForge, an automated data processing system diff --git a/src/content/en/projects/software/kmath.md b/src/content/en/projects/software/kmath.md index b086084..49f8670 100644 --- a/src/content/en/projects/software/kmath.md +++ b/src/content/en/projects/software/kmath.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: dataforge shortTitle: Kmath title: Experimental Kotlin math library diff --git a/src/content/en/projects/software/muon-sim.md b/src/content/en/projects/software/muon-sim.md index 656d0c5..c57a595 100644 --- a/src/content/en/projects/software/muon-sim.md +++ b/src/content/en/projects/software/muon-sim.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: muon-sim shortTitle: Modeling Muon Monitor title: Muon Monitor experiment data analysis model diff --git a/src/content/en/projects/software/plotly.md b/src/content/en/projects/software/plotly.md index c39cc51..aa2b53f 100644 --- a/src/content/en/projects/software/plotly.md +++ b/src/content/en/projects/software/plotly.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: plotly shortTitle: Plotly.kt title: Plotly.kt wrapper library for kotlin-multiplatform diff --git a/src/content/en/projects/software/prog-seminar.md b/src/content/en/projects/software/prog-seminar.md index 22dfe59..b09efac 100644 --- a/src/content/en/projects/software/prog-seminar.md +++ b/src/content/en/projects/software/prog-seminar.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: prog-seminar shortTitle: Programming workshop title: Programming in experimental physics diff --git a/src/content/en/projects/software/reactor.md b/src/content/en/projects/software/reactor.md index d8b2dab..3cd2a9a 100644 --- a/src/content/en/projects/software/reactor.md +++ b/src/content/en/projects/software/reactor.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: reactor shortTitle: RL-TGE modeling title: Macro modeling for a reactor model in atmospheric physics diff --git a/src/content/ru/compMethods/intro.md b/src/content/ru/magprog/intro.md similarity index 100% rename from src/content/ru/compMethods/intro.md rename to src/content/ru/magprog/intro.md diff --git a/src/content/ru/projects/education/analysis.md b/src/content/ru/projects/education/analysis.md index c4594c7..66cd934 100644 --- a/src/content/ru/projects/education/analysis.md +++ b/src/content/ru/projects/education/analysis.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: analysis shortTitle: Курс по анализу данных title: Статистические методы в экспериментальной физике diff --git a/src/content/ru/projects/education/atom.md b/src/content/ru/projects/education/atom.md index 2ae500a..c47647a 100644 --- a/src/content/ru/projects/education/atom.md +++ b/src/content/ru/projects/education/atom.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: atom shortTitle: Цикл лекций по истории атомного проекта title: История атомного проекта diff --git a/src/content/ru/projects/education/kotlin.md b/src/content/ru/projects/education/kotlin.md index 21f0220..5956dec 100644 --- a/src/content/ru/projects/education/kotlin.md +++ b/src/content/ru/projects/education/kotlin.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: kotlin shortTitle: Научное программирование title: Введение в научное программирование на языке Kotlin diff --git a/src/content/ru/projects/education/labs.md b/src/content/ru/projects/education/labs.md index 57266b7..caab6ce 100644 --- a/src/content/ru/projects/education/labs.md +++ b/src/content/ru/projects/education/labs.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: labs shortTitle: Лабораторные работы title: Лабораторные работы на кафедре общей физики diff --git a/src/content/ru/projects/education/lowbackground.md b/src/content/ru/projects/education/lowbackground.md index 5d474af..b8d2f8f 100644 --- a/src/content/ru/projects/education/lowbackground.md +++ b/src/content/ru/projects/education/lowbackground.md @@ -1,5 +1,6 @@ --- -content_type: project_education +content_type: project +project_type: education id: lowbackground shortTitle: Курс по низкофоновым экспериментам title: Курс по экспериментам, проводимым в низкофоновых подземных лабораториях diff --git a/src/content/ru/projects/math/deconvolution.md b/src/content/ru/projects/math/deconvolution.md index bbdabd1..c40ea15 100644 --- a/src/content/ru/projects/math/deconvolution.md +++ b/src/content/ru/projects/math/deconvolution.md @@ -1,5 +1,6 @@ --- -content_type: project_math +content_type: project +project_type: math id: deconvolution shortTitle: Обратные задачи title: Статистическая регуляризация некорректных обратных задач diff --git a/src/content/ru/projects/math/significance.md b/src/content/ru/projects/math/significance.md index 7943873..bb132bc 100644 --- a/src/content/ru/projects/math/significance.md +++ b/src/content/ru/projects/math/significance.md @@ -1,5 +1,6 @@ --- -content_type: project_math +content_type: project +project_type: math id: significance shortTitle: Функции значимости title: Оптимальное планирование эксперимента при помощи функций значимости параметров diff --git a/src/content/ru/projects/physics/gerda.md b/src/content/ru/projects/physics/gerda.md index ab94f70..b7cdb9b 100644 --- a/src/content/ru/projects/physics/gerda.md +++ b/src/content/ru/projects/physics/gerda.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: gerda shortTitle: GERDA title: Международный эксперимент GERDA diff --git a/src/content/ru/projects/physics/iaxo.md b/src/content/ru/projects/physics/iaxo.md index 2688df5..d18c8d5 100644 --- a/src/content/ru/projects/physics/iaxo.md +++ b/src/content/ru/projects/physics/iaxo.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: iaxo shortTitle: IAXO title: Международная коллаборация IAXO diff --git a/src/content/ru/projects/physics/mm.md b/src/content/ru/projects/physics/mm.md index e7f73d5..92d59e8 100644 --- a/src/content/ru/projects/physics/mm.md +++ b/src/content/ru/projects/physics/mm.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: mounMonitor shortTitle: Мюонный монитор title: Мюонный монитор для подземных низкофоновых экспериментов diff --git a/src/content/ru/projects/physics/numass.md b/src/content/ru/projects/physics/numass.md index 712427a..a5ee3bc 100644 --- a/src/content/ru/projects/physics/numass.md +++ b/src/content/ru/projects/physics/numass.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: numass shortTitle: Троицк ню-масс title: Установка по поиску массы нейтрино Троицк ню-масс diff --git a/src/content/ru/projects/physics/satelite.md b/src/content/ru/projects/physics/satelite.md index f6b58a3..4856a34 100644 --- a/src/content/ru/projects/physics/satelite.md +++ b/src/content/ru/projects/physics/satelite.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: satelite shortTitle: Спутниковый детектор title: Спутниковый детектор солнечного излучения diff --git a/src/content/ru/projects/physics/spectMatter.md b/src/content/ru/projects/physics/spectMatter.md index d64001a..4e2666d 100644 --- a/src/content/ru/projects/physics/spectMatter.md +++ b/src/content/ru/projects/physics/spectMatter.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: spectMatter shortTitle: Спектаторная материя title: Спектаторная материя diff --git a/src/content/ru/projects/physics/tgf.md b/src/content/ru/projects/physics/tgf.md index 043c000..c0e3a50 100644 --- a/src/content/ru/projects/physics/tgf.md +++ b/src/content/ru/projects/physics/tgf.md @@ -1,5 +1,6 @@ --- -content_type: project_physics +content_type: project +project_type: physics id: atmosphere shortTitle: TGE/TGF title: Изучение TGE и TGF diff --git a/src/content/ru/projects/software/biref.md b/src/content/ru/projects/software/biref.md index 9550d49..a7391b7 100644 --- a/src/content/ru/projects/software/biref.md +++ b/src/content/ru/projects/software/biref.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: biref shortTitle: Двулучепреломление title: Анализ данных в лабораторной работе по двулучепреломлению diff --git a/src/content/ru/projects/software/dataforge.md b/src/content/ru/projects/software/dataforge.md index bd57ad6..d9ed8c2 100644 --- a/src/content/ru/projects/software/dataforge.md +++ b/src/content/ru/projects/software/dataforge.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: dataforge shortTitle: DataForge title: Система автоматизированной обработки данных DataForge diff --git a/src/content/ru/projects/software/kmath.md b/src/content/ru/projects/software/kmath.md index 97ccfa3..f1fee7b 100644 --- a/src/content/ru/projects/software/kmath.md +++ b/src/content/ru/projects/software/kmath.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: dataforge shortTitle: Kmath title: "Экспериментальная математическая библиотека на kotlin" diff --git a/src/content/ru/projects/software/muon-sim.md b/src/content/ru/projects/software/muon-sim.md index d2b4978..6eda09c 100644 --- a/src/content/ru/projects/software/muon-sim.md +++ b/src/content/ru/projects/software/muon-sim.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: muon-sim shortTitle: Моделирование Muon Monitor title: Модель для анализа данных эксперимента Muon Monitor diff --git a/src/content/ru/projects/software/plotly.md b/src/content/ru/projects/software/plotly.md index 65328d7..68a08a9 100644 --- a/src/content/ru/projects/software/plotly.md +++ b/src/content/ru/projects/software/plotly.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: plotly shortTitle: Plotly.kt title: Plotly.kt для Kotlin-multiplatform diff --git a/src/content/ru/projects/software/prog-seminar.md b/src/content/ru/projects/software/prog-seminar.md index e6c5f51..c76bd46 100644 --- a/src/content/ru/projects/software/prog-seminar.md +++ b/src/content/ru/projects/software/prog-seminar.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: prog-seminar shortTitle: Семинар по программированию title: Программирование в экспериментальной физике diff --git a/src/content/ru/projects/software/reactor.md b/src/content/ru/projects/software/reactor.md index 3a6065c..17651b7 100644 --- a/src/content/ru/projects/software/reactor.md +++ b/src/content/ru/projects/software/reactor.md @@ -1,5 +1,6 @@ --- -content_type: project_software +content_type: project +project_type: software id: reactor shortTitle: Моделирование RL-TGE title: Макро-моделирование для реакторной модели в физике атмосферы diff --git a/src/pages/about.js b/src/pages/about.js index 7151f00..f10067b 100644 --- a/src/pages/about.js +++ b/src/pages/about.js @@ -4,7 +4,6 @@ import {graphql} from "gatsby" import Parser from "html-react-parser" import Layout from "../components/layout" -import SEO from "../components/seo" import "../styles/main.css" const AboutPage = ({data}) => { @@ -18,9 +17,8 @@ const AboutPage = ({data}) => { } return ( - -

-

+

+

{ return ( - - {/* --------------------------------- */} head @@ -89,7 +86,7 @@ export default injectIntl(IndexPage) export const query = graphql` query { - ru_posts: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "post"}, published: {eq: true}, language: {eq: "ru"}}}, + ru_posts: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "post"}, published: {ne: false}, language: {eq: "ru"}}}, sort: {fields: [frontmatter___date], order: DESC}, limit: 3 ) { edges{ @@ -104,7 +101,7 @@ export const query = graphql` } } - en_posts: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "post"}, published: {eq: true}, language: {eq: "en"}}}, + en_posts: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "post"}, published: {ne: false}, language: {eq: "en"}}}, sort: {fields: [frontmatter___date], order: DESC}, limit: 3 ) { edges{ diff --git a/src/pages/magprog.js b/src/pages/magprog.js index 9957cb4..8763cf6 100644 --- a/src/pages/magprog.js +++ b/src/pages/magprog.js @@ -23,7 +23,7 @@ export default injectIntl(MagProg) export const query = graphql` query{ - page: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "magprog"}, published: {eq: true}, language: {eq: "ru"}}}){ + page: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "magprog"}, published: {ne: false}, language: {eq: "ru"}}}){ edges{ node{ html diff --git a/src/pages/partners.js b/src/pages/partners.js index ab59267..2b2dcdf 100644 --- a/src/pages/partners.js +++ b/src/pages/partners.js @@ -1,6 +1,6 @@ import React from "react" import Layout from "../components/layout" -import {FormattedMessage, injectIntl, useIntl} from "gatsby-plugin-react-intl" +import {FormattedMessage, injectIntl} from "gatsby-plugin-react-intl" import "../styles/main.css" ///------------------------------------------------------ import mipt_logo from "../images/partners/mipt_logo.jpg" @@ -8,15 +8,10 @@ import inr_linac from "../images/partners/Linac-OUK_big.gif" import inr_logo from "../images/partners/inr_logo.png" import jetbrains_logo from "../images/partners/jetbrains.svg" import jbr from "../images/partners/JBR.svg" -import SEO from "../components/seo" const PartnersPage = () => { - const intl = useIntl() - const lang = intl.locale return ( - -

{ const intl = useIntl() @@ -17,21 +17,7 @@ const SoftwarePage = ({data}) => { } return ( - - -
    -
  • -
  • -
  • -
  • -
  • -
  • -
+

@@ -76,7 +62,7 @@ export default injectIntl(SoftwarePage) export const query = graphql` query{ - ru_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project_education"}, published: {eq: true}, language: {eq: "ru"}}}, + ru_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project"}, project_type: {eq: "education"}, published: {ne: false}, language: {eq: "ru"}}}, sort: {fields: [frontmatter___order], order: ASC}){ edges{ node{ @@ -90,7 +76,7 @@ export const query = graphql` } }} - en_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project_education"}, published: {eq: true}, language: {eq: "en"}}}, + en_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project"}, project_type: {eq: "education"}, published: {ne: false}, language: {eq: "en"}}}, sort: {fields: [frontmatter___order], order: ASC}){ edges{ node{ diff --git a/src/pages/projects/math.js b/src/pages/projects/math.js index ccf29a9..30bb4c7 100644 --- a/src/pages/projects/math.js +++ b/src/pages/projects/math.js @@ -1,64 +1,23 @@ import React from "react" import {graphql} from "gatsby" -import {FormattedMessage, injectIntl, Link, useIntl} from "gatsby-plugin-react-intl" -import Parser from "html-react-parser" +import {injectIntl, useIntl} from "gatsby-plugin-react-intl" import Layout from "../../components/layout" -import SEO from "../../components/seo" +import Projects from "../../components/templates/projectsTemplate"; const SoftwarePage = ({data}) => { const intl = useIntl() const lang = intl.locale - var posts = "" + let mathProjects = []; if (lang === "ru") { - posts = data.ru_projects.edges; + mathProjects = data.ru_projects.edges; } else if (lang === "en") { - posts = data.en_projects.edges; + mathProjects = data.en_projects.edges; } + return ( - - -
    -
  • -
  • -
  • -
  • -
  • -
  • -
- -

-

- -
    - {posts.map(({node}) => { - const link = node.frontmatter.shortTitle; - const id = node.frontmatter.id; - return ( -
  • {link}
  • - ) - })} -
- - {posts.map(({node}) => { - const title = node.frontmatter.title; - const id = node.frontmatter.id; - return ( -
-
-
-

{title}

-
{Parser(node.html)}
-
-
- ) - })} +
) } @@ -67,7 +26,7 @@ export default injectIntl(SoftwarePage) export const query = graphql` query{ - ru_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project_math"}, published: {eq: true}, language: {eq: "ru"}}}, + ru_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project"}, project_type: {eq: "math"}, published: {ne: false}, language: {eq: "ru"}}}, sort: {fields: [frontmatter___order], order: ASC}){ edges{ node{ @@ -80,7 +39,7 @@ export const query = graphql` } }} - en_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project_math"}, published: {eq: true}, language: {eq: "en"}}}, + en_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project"}, project_type: {eq: "math"}, published: {ne: false}, language: {eq: "en"}}}, sort: {fields: [frontmatter___order], order: ASC}){ edges{ node{ diff --git a/src/pages/projects/physics.js b/src/pages/projects/physics.js index 08f34c0..8da11dc 100644 --- a/src/pages/projects/physics.js +++ b/src/pages/projects/physics.js @@ -1,63 +1,22 @@ import React from "react" import {graphql} from "gatsby" -import {FormattedMessage, injectIntl, Link, useIntl} from "gatsby-plugin-react-intl" -import Parser from "html-react-parser" +import {injectIntl, useIntl} from "gatsby-plugin-react-intl" import Layout from "../../components/layout" -import SEO from "../../components/seo" +import Projects from "../../components/templates/projectsTemplate"; const PhysicsPage = ({data}) => { const intl = useIntl() const lang = intl.locale - var posts = "" + let physicsProjects = ""; if (lang === "ru") { - posts = data.ru_projects.edges; + physicsProjects = data.ru_projects.edges; } else if (lang === "en") { - posts = data.en_projects.edges; + physicsProjects = data.en_projects.edges; } return ( - -
    -
  • -
  • -
  • -
  • -
  • -
  • -
- -

-

- -
    - {posts.map(({node}) => { - const link = node.frontmatter.shortTitle; - const id = node.frontmatter.id; - return ( -
  • {link}
  • - ) - })} -
- - {posts.map(({node}) => { - const title = node.frontmatter.title; - const id = node.frontmatter.id; - return ( -
-
-
-

{title}

-
{Parser(node.html)}
-
-
- ) - })} +
) } @@ -66,7 +25,7 @@ export default injectIntl(PhysicsPage) export const query = graphql` query{ - ru_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project_physics"}, published: {eq: true}, language: {eq: "ru"}}}, + ru_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project"}, project_type: {eq: "physics"} published: {ne: false}, language: {eq: "ru"}}}, sort: {fields: [frontmatter___order], order: ASC}){ edges{ node{ @@ -79,7 +38,7 @@ export const query = graphql` } }} - en_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project_physics"}, published: {eq: true}, language: {eq: "en"}}}, + en_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project"}, project_type: {eq: "physics"} published: {ne: false}, language: {eq: "en"}}}, sort: {fields: [frontmatter___order], order: ASC}){ edges{ node{ diff --git a/src/pages/projects/software.js b/src/pages/projects/software.js index 5d8f27b..76289de 100644 --- a/src/pages/projects/software.js +++ b/src/pages/projects/software.js @@ -1,73 +1,22 @@ import React from "react" import {graphql} from "gatsby" -import {FormattedMessage, injectIntl, Link, useIntl} from "gatsby-plugin-react-intl" -import Parser from "html-react-parser" +import {injectIntl, useIntl} from "react-intl" import Layout from "../../components/layout" -import SEO from "../../components/seo" +import Projects from "../../components/templates/projectsTemplate"; const SoftwarePage = ({data}) => { const intl = useIntl() const lang = intl.locale - var posts = "" + let softwareProjects = ""; if (lang === "ru") { - posts = data.ru_projects.edges; + softwareProjects = data.ru_projects.edges; } else if (lang === "en") { - posts = data.en_projects.edges; + softwareProjects = data.en_projects.edges; } return ( - - -
    -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
- -

-

- -
    - {posts.map(({node}) => { - const link = node.frontmatter.shortTitle; - const id = node.frontmatter.id; - return ( -
  • {link}
  • - ) - })} -
- - {posts.map(({node}) => { - const title = node.frontmatter.title; - const id = node.frontmatter.id; - return ( -
-
-
-

{title}

-
{Parser(node.html)}
-
-
- ) - })} +
) } @@ -76,7 +25,7 @@ export default injectIntl(SoftwarePage) export const query = graphql` query{ - ru_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project_software"}, published: {eq: true}, language: {eq: "ru"}}}, + ru_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project"}, project_type: {eq: "software"}, published: {ne: false}, language: {eq: "ru"}}}, sort: {fields: [frontmatter___order], order: ASC}){ edges{ node{ @@ -89,7 +38,7 @@ export const query = graphql` } }} - en_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project_software"}, published: {eq: true}, language: {eq: "en"}}}, + en_projects: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "project"}, project_type: {eq: "software"}, published: {ne: false}, language: {eq: "en"}}}, sort: {fields: [frontmatter___order], order: ASC}){ edges{ node{ diff --git a/src/pages/publications.js b/src/pages/publications.js index e590fef..036ad4b 100644 --- a/src/pages/publications.js +++ b/src/pages/publications.js @@ -4,7 +4,6 @@ import {injectIntl, Link, useIntl} from "gatsby-plugin-react-intl" import Parser from "html-react-parser" import Layout from "../components/layout" -import SEO from "../components/seo" const PublicationsPage = ({data}) => { const intl = useIntl() @@ -17,8 +16,6 @@ const PublicationsPage = ({data}) => { } return ( - - {publications.map(({node}) => { const title = node.frontmatter.title return ( @@ -44,7 +41,7 @@ export default injectIntl(PublicationsPage) export const query = graphql` query{ - ru_publications: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "publications"}, published: {eq: true}, language: {eq: "ru"}}}){ + ru_publications: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "publications"}, published: {ne: false}, language: {eq: "ru"}}}){ edges{ node{ html @@ -55,7 +52,7 @@ export const query = graphql` } }} - en_publications: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "publications"}, published: {eq: true}, language: {eq: "en"}}}){ + en_publications: allMarkdownRemark(filter: {frontmatter: {content_type: {eq: "publications"}, published: {ne: false}, language: {eq: "en"}}}){ edges{ node{ html diff --git a/src/pages/quarks.js b/src/pages/quarks.js index b5bace8..97b2a1d 100644 --- a/src/pages/quarks.js +++ b/src/pages/quarks.js @@ -4,7 +4,6 @@ import {FormattedMessage, injectIntl, Link, useIntl} from "gatsby-plugin-react-i import Parser from "html-react-parser" import Layout from "../components/layout" -import SEO from "../components/seo" const QuarksPage = ({data}) => { const intl = useIntl() @@ -17,8 +16,6 @@ const QuarksPage = ({data}) => { } return ( - -