Source structure refactoring
This commit is contained in:
parent
e2517c0ed0
commit
cb54a6fe1a
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -9,15 +9,15 @@ jobs:
|
|||||||
name: build and deploy
|
name: build and deploy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Build Gatsby Site
|
- name: Build Gatsby Site
|
||||||
uses: jzweifel/gatsby-cli-github-action@master
|
uses: jzweifel/gatsby-cli-github-action@v1.0.0
|
||||||
with:
|
with:
|
||||||
gatsby-arg: build
|
gatsby-arg: build
|
||||||
|
|
||||||
- name: Deply via ssh
|
- name: Deply via ssh
|
||||||
uses: appleboy/scp-action@master
|
uses: appleboy/scp-action@v0.1.1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.HOST }}
|
host: ${{ secrets.HOST }}
|
||||||
username: ${{ secrets.WEBMASTER_USERNAME }}
|
username: ${{ secrets.WEBMASTER_USERNAME }}
|
||||||
|
7
.gitignore
vendored
7
.gitignore
vendored
@ -56,7 +56,9 @@ typings/
|
|||||||
|
|
||||||
# gatsby files
|
# gatsby files
|
||||||
.cache/
|
.cache/
|
||||||
public
|
public/
|
||||||
|
static/files/
|
||||||
|
static/images/
|
||||||
|
|
||||||
# Mac files
|
# Mac files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@ -68,4 +70,5 @@ yarn-error.log
|
|||||||
# Yarn Integrity file
|
# Yarn Integrity file
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
|
||||||
.idea/
|
.idea/
|
||||||
|
schema.graphql
|
||||||
|
15
.graphqlconfig
Normal file
15
.graphqlconfig
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "Gatsby",
|
||||||
|
"schemaPath": "schema.graphql",
|
||||||
|
"extensions": {
|
||||||
|
"endpoints": {
|
||||||
|
"Default GraphQL Endpoint": {
|
||||||
|
"url": "http://localhost:8000/___graphql",
|
||||||
|
"headers": {
|
||||||
|
"user-agent": "JS GraphQL"
|
||||||
|
},
|
||||||
|
"introspect": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,2 +0,0 @@
|
|||||||
xcopy "src/images" "static/images" /f /y /i /s
|
|
||||||
xcopy "src/files" "static/files" /f /y /i /s
|
|
@ -22,6 +22,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
`gatsby-plugin-catch-links`,
|
||||||
`gatsby-plugin-react-helmet`,
|
`gatsby-plugin-react-helmet`,
|
||||||
{
|
{
|
||||||
resolve: 'gatsby-source-filesystem',
|
resolve: 'gatsby-source-filesystem',
|
||||||
@ -34,7 +35,7 @@ module.exports = {
|
|||||||
resolve: `gatsby-source-filesystem`,
|
resolve: `gatsby-source-filesystem`,
|
||||||
options: {
|
options: {
|
||||||
name: `content`,
|
name: `content`,
|
||||||
path: `${__dirname}/src/pages/content`,
|
path: `${__dirname}/src/content`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -46,7 +47,7 @@ module.exports = {
|
|||||||
start_url: `/`,
|
start_url: `/`,
|
||||||
// start_url: `/new`,
|
// start_url: `/new`,
|
||||||
display: `minimal-ui`,
|
display: `minimal-ui`,
|
||||||
icon: `src/images/icon.png`, // This path is relative to the root of the site.
|
icon: `src/images/icon.png`, // This path is relative to the root of the site.
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
`gatsby-plugin-netlify-cms`,
|
`gatsby-plugin-netlify-cms`,
|
||||||
|
124
gatsby-node.js
124
gatsby-node.js
@ -1,15 +1,33 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const ncp = require('ncp').ncp;
|
||||||
|
|
||||||
exports.createPages = async ({ actions, graphql }) => {
|
const filesSource = "./src/files"
|
||||||
|
const imagesSource = "./src/images"
|
||||||
|
|
||||||
|
exports.onPreBootstrap = () => {
|
||||||
|
ncp(filesSource, "./static/files", function (err) {
|
||||||
|
if (err) {
|
||||||
|
return console.error(err);
|
||||||
|
}
|
||||||
|
console.log('Files copied');
|
||||||
|
});
|
||||||
|
ncp(imagesSource, "./static/images", function (err) {
|
||||||
|
if (err) {
|
||||||
|
return console.error(err);
|
||||||
|
}
|
||||||
|
console.log('Images copied');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.createPages = async ({actions, graphql}) => {
|
||||||
const {createPage} = actions;
|
const {createPage} = actions;
|
||||||
|
|
||||||
|
// language=GraphQL
|
||||||
const result = await graphql(`
|
const result = await graphql(`
|
||||||
{
|
{
|
||||||
courses: allMarkdownRemark(
|
courses: allMarkdownRemark(
|
||||||
filter: {frontmatter: {
|
filter: {frontmatter: {content_type: {eq: "page_education"}, published: {eq: true}}}
|
||||||
content_type: {eq: "page_education"},
|
){
|
||||||
published: {eq: true}}}
|
|
||||||
){
|
|
||||||
edges{
|
edges{
|
||||||
node{
|
node{
|
||||||
html
|
html
|
||||||
@ -20,26 +38,28 @@ exports.createPages = async ({ actions, graphql }) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
news: allMarkdownRemark(
|
news: allMarkdownRemark(
|
||||||
filter: {frontmatter: {content_type: {eq: "post"}, published: {eq: true}}},
|
filter: {frontmatter: {content_type: {eq: "post"}, published: {eq: true}}},
|
||||||
sort: {fields: [frontmatter___date], order: DESC}
|
sort: {fields: [frontmatter___date], order: DESC}
|
||||||
) {
|
) {
|
||||||
edges{
|
edges{
|
||||||
node{
|
node{
|
||||||
frontmatter{
|
frontmatter{
|
||||||
title
|
title
|
||||||
slug
|
slug
|
||||||
date(formatString: "DD.MM.YYYY")
|
date(formatString: "DD.MM.YYYY")
|
||||||
|
}
|
||||||
|
html
|
||||||
}
|
}
|
||||||
html
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`)
|
||||||
}`)
|
|
||||||
|
if (result.errors) {
|
||||||
if( result.errors ){ throw result.errors; }
|
throw result.errors;
|
||||||
|
}
|
||||||
|
|
||||||
const courseTemplate = path.resolve(`./src/components/templates/courseTemplate.js`);
|
const courseTemplate = path.resolve(`./src/components/templates/courseTemplate.js`);
|
||||||
const courses = result.data.courses.edges;
|
const courses = result.data.courses.edges;
|
||||||
|
|
||||||
@ -54,37 +74,37 @@ exports.createPages = async ({ actions, graphql }) => {
|
|||||||
|
|
||||||
const newsTemplate = path.resolve(`./src/components/templates/news.js`);
|
const newsTemplate = path.resolve(`./src/components/templates/news.js`);
|
||||||
const posts = result.data.news.edges;
|
const posts = result.data.news.edges;
|
||||||
|
|
||||||
const postsPerPage = 5;
|
const postsPerPage = 5;
|
||||||
const numberOfNewsItems = posts.length;
|
const numberOfNewsItems = posts.length;
|
||||||
const numberOfNewsPages = Math.ceil(numberOfNewsItems / postsPerPage);
|
const numberOfNewsPages = Math.ceil(numberOfNewsItems / postsPerPage);
|
||||||
|
|
||||||
|
|
||||||
for (let pageIndex = 0; pageIndex < numberOfNewsPages; pageIndex++) {
|
for (let pageIndex = 0; pageIndex < numberOfNewsPages; pageIndex++) {
|
||||||
const pageNumber = pageIndex + 1;
|
const pageNumber = pageIndex + 1;
|
||||||
const path = pageIndex === 0 ? '/news' : `/news/${pageNumber}`;
|
const path = pageIndex === 0 ? '/news' : `/news/${pageNumber}`;
|
||||||
const skip = pageIndex * postsPerPage;
|
const skip = pageIndex * postsPerPage;
|
||||||
|
|
||||||
function getPreviousPageLink() {
|
function getPreviousPageLink() {
|
||||||
if (!pageIndex) return null
|
if (!pageIndex) return null
|
||||||
if (pageIndex === 1) return '/news'
|
if (pageIndex === 1) return '/news'
|
||||||
return `/news/${pageIndex}`
|
return `/news/${pageIndex}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNextPageLink() {
|
function getNextPageLink() {
|
||||||
if (pageNumber < numberOfNewsPages) return `news/${pageNumber + 1}`
|
if (pageNumber < numberOfNewsPages) return `news/${pageNumber + 1}`
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
createPage({
|
createPage({
|
||||||
path,
|
path,
|
||||||
component: newsTemplate,
|
component: newsTemplate,
|
||||||
context: {
|
context: {
|
||||||
limit: postsPerPage,
|
limit: postsPerPage,
|
||||||
skip,
|
skip,
|
||||||
next: getNextPageLink(),
|
next: getNextPageLink(),
|
||||||
prev: getPreviousPageLink(),
|
prev: getPreviousPageLink(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
13381
package-lock.json
generated
13381
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
59
package.json
59
package.json
@ -4,45 +4,50 @@
|
|||||||
"description": "Nuclear Physics Methods laboratory",
|
"description": "Nuclear Physics Methods laboratory",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/bootstrap": "^4.3.1",
|
"@types/bootstrap": "^4.5.0",
|
||||||
"bootstrap": "^4.4.1",
|
"bootstrap": "^4.5.2",
|
||||||
"gatsby": "^2.18.12",
|
"gatsby": "^2.24.47",
|
||||||
"gatsby-awesome-pagination": "^0.3.5",
|
"gatsby-awesome-pagination": "^0.3.6",
|
||||||
"gatsby-cli": "^2.8.22",
|
"gatsby-cli": "^2.12.87",
|
||||||
"gatsby-plugin-intl": "^0.3.2",
|
"gatsby-plugin-catch-links": "^2.3.11",
|
||||||
"gatsby-plugin-manifest": "^2.2.31",
|
"gatsby-plugin-intl": "^0.3.3",
|
||||||
"gatsby-plugin-netlify-cms": "^4.1.33",
|
"gatsby-plugin-manifest": "^2.4.23",
|
||||||
"gatsby-plugin-react-helmet": "^3.2.0",
|
"gatsby-plugin-netlify-cms": "^4.3.11",
|
||||||
"gatsby-plugin-sharp": "^2.3.10",
|
"gatsby-plugin-react-helmet": "^3.3.10",
|
||||||
"gatsby-remark-images": "^3.1.39",
|
"gatsby-plugin-sharp": "^2.6.27",
|
||||||
"gatsby-remark-katex": "^3.1.20",
|
"gatsby-remark-images": "^3.3.25",
|
||||||
|
"gatsby-remark-katex": "^3.3.10",
|
||||||
"gatsby-remark-relative-images": "^0.2.3",
|
"gatsby-remark-relative-images": "^0.2.3",
|
||||||
"gatsby-source-filesystem": "^2.1.43",
|
"gatsby-source-filesystem": "^2.3.24",
|
||||||
"gatsby-source-graphql": "^2.1.29",
|
"gatsby-source-graphql": "^2.7.1",
|
||||||
"gatsby-transformer-remark": "^2.6.45",
|
"gatsby-transformer-remark": "^2.8.28",
|
||||||
"gatsby-transformer-sharp": "^2.3.7",
|
"gatsby-transformer-sharp": "^2.5.13",
|
||||||
"html-react-parser": "^0.10.2",
|
"html-react-parser": "^0.10.5",
|
||||||
"katex": "^0.10.0",
|
"jquery": "^3.5.1",
|
||||||
|
"katex": "^0.10.2",
|
||||||
"mini-css-extract-plugin": "^0.9.0",
|
"mini-css-extract-plugin": "^0.9.0",
|
||||||
"netlify-cms-app": "^2.10.1",
|
"ncp": "^2.0.0",
|
||||||
|
"netlify-cms-app": "^2.12.19",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react": "^16.12.0",
|
"react": "^16.13.1",
|
||||||
"react-bootstrap": "^1.0.0-beta.16",
|
"react-bootstrap": "^1.3.0",
|
||||||
"react-helmet": "^5.2.1",
|
"react-helmet": "^5.2.1",
|
||||||
"vertical-timeline-component-for-react": "^1.0.6"
|
"redux": "^3.7.2",
|
||||||
|
"typescript": "^4.0.2",
|
||||||
|
"vertical-timeline-component-for-react": "^1.0.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^9.7.3",
|
"autoprefixer": "^9.8.6",
|
||||||
"clean-webpack-plugin": "^3.0.0",
|
"clean-webpack-plugin": "^3.0.0",
|
||||||
"copy-webpack-plugin": "^5.1.1",
|
"copy-webpack-plugin": "^5.1.1",
|
||||||
"file-loader": "^5.0.2",
|
"file-loader": "^5.1.0",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"imagemin-webpack-plugin": "^2.4.2",
|
"imagemin-webpack-plugin": "^2.4.2",
|
||||||
"img-loader": "^3.0.1",
|
"img-loader": "^3.0.1",
|
||||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||||
"webpack": "^4.42.0",
|
"webpack": "^4.44.1",
|
||||||
"webpack-cli": "^3.3.10",
|
"webpack-cli": "^3.3.12",
|
||||||
"webpack-dev-server": "^3.10.1"
|
"webpack-dev-server": "^3.11.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"gatsby"
|
"gatsby"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { graphql } from "gatsby"
|
import {graphql} from "gatsby"
|
||||||
import { Link, useIntl, injectIntl } from "gatsby-plugin-intl"
|
import {injectIntl, Link, useIntl} from "gatsby-plugin-intl"
|
||||||
import Parser from "html-react-parser"
|
import Parser from "html-react-parser"
|
||||||
|
|
||||||
import SEO from "../seo"
|
import SEO from "../seo"
|
||||||
@ -12,7 +12,7 @@ const Template = (props) => {
|
|||||||
const course = props.data.course
|
const course = props.data.course
|
||||||
|
|
||||||
let par = 'Физика'
|
let par = 'Физика'
|
||||||
if (lang === "ru"){
|
if (lang === "ru") {
|
||||||
switch (course.frontmatter.parent) {
|
switch (course.frontmatter.parent) {
|
||||||
case 'education':
|
case 'education':
|
||||||
par = 'Образование';
|
par = 'Образование';
|
||||||
@ -25,8 +25,8 @@ const Template = (props) => {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
par = 'Физика';
|
par = 'Физика';
|
||||||
}}
|
}
|
||||||
else {
|
} else {
|
||||||
switch (course.frontmatter.parent) {
|
switch (course.frontmatter.parent) {
|
||||||
case 'education':
|
case 'education':
|
||||||
par = 'Education';
|
par = 'Education';
|
||||||
@ -39,18 +39,18 @@ const Template = (props) => {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
par = 'Physics';
|
par = 'Physics';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<SEO lang={lang} title={intl.formatMessage({ id: "title" })} />
|
<SEO lang={lang} title={intl.formatMessage({id: "title"})}/>
|
||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol className="breadcrumb" style={{margin: 0}}>
|
<ol className="breadcrumb" style={{margin: 0}}>
|
||||||
<li className="breadcrumb-item">
|
<li className="breadcrumb-item">
|
||||||
<Link to={`/projects/${course.frontmatter.parent}`}>{par}</Link>
|
<Link to={`/projects/${course.frontmatter.parent}`}>{par}</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="breadcrumb-item active" aria-current="page">{course.frontmatter.shortTitle}</li>
|
<li className="breadcrumb-item active" aria-current="page">{course.frontmatter.shortTitle}</li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<h1 style={{marginTop: `15px`, textAlign: `center`}}>{course.frontmatter.title}</h1>
|
<h1 style={{marginTop: `15px`, textAlign: `center`}}>{course.frontmatter.title}</h1>
|
||||||
@ -64,12 +64,12 @@ export default injectIntl(Template)
|
|||||||
export const CourseQuery = graphql`
|
export const CourseQuery = graphql`
|
||||||
query CourseByPath($path: String){
|
query CourseByPath($path: String){
|
||||||
course: markdownRemark(frontmatter: {slug: {eq: $path}}){
|
course: markdownRemark(frontmatter: {slug: {eq: $path}}){
|
||||||
html
|
html
|
||||||
frontmatter{
|
frontmatter{
|
||||||
title
|
title
|
||||||
shortTitle
|
shortTitle
|
||||||
path
|
path
|
||||||
parent
|
parent
|
||||||
slug
|
slug
|
||||||
}}
|
}}
|
||||||
}`
|
}`
|
13
src/content/en/projects/software/plotly.md
Normal file
13
src/content/en/projects/software/plotly.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
content_type: project_software
|
||||||
|
id: plotly
|
||||||
|
shortTitle: Plotly.kt
|
||||||
|
title: Plotly.kt wrapper library for kotlin-multiplatform
|
||||||
|
order: 5
|
||||||
|
published: true
|
||||||
|
language: en
|
||||||
|
------------
|
||||||
|
|
||||||
|
[Plotly.kt](https://github.com/mipt-npm/plotly.kt) library wraps popular [Plotly](https://plotly.com/javascript/) frontend library and allows access to it from Kotlin-multiplatform (both from front-end and back-end) as well as kotlin jupyter kernel support and other nice things.
|
||||||
|
|
||||||
|
More detailed description is available in the [project repository](https://github.com/mipt-npm/plotly.kt) and on the [special page](/files/plotly.html) prepared by Ekaterina Samorodova.
|
@ -3,7 +3,7 @@ content_type: project_software
|
|||||||
id: prog-seminar
|
id: prog-seminar
|
||||||
shortTitle: Programming workshop
|
shortTitle: Programming workshop
|
||||||
title: Programming in experimental physics
|
title: Programming in experimental physics
|
||||||
order: 3
|
order: 300
|
||||||
published: true
|
published: true
|
||||||
language: en
|
language: en
|
||||||
---
|
---
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user