diff --git a/components/Element.tsx b/components/Element.tsx index 1fe55f3..d8ac5b9 100644 --- a/components/Element.tsx +++ b/components/Element.tsx @@ -37,7 +37,11 @@ export default class Element extends React.Component {
{this.props.image ? ( - {this.props.alt}/ + + + + + //{this.props.alt}/ ) : (
)} diff --git a/components/Navbar.tsx b/components/Navbar.tsx index f981d17..d8193d9 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -27,9 +27,6 @@ export default class Navbar extends React.Component { } public componentDidMount() { - if (window.location.origin !== config.domain) { - window.location.replace(`${config.domain}${window.location.pathname}`) - } window.addEventListener('scroll', this.onScroll) } diff --git a/config.ts b/config.ts index d89b3f6..db2dc8a 100644 --- a/config.ts +++ b/config.ts @@ -5,7 +5,7 @@ const config = { 500: '#6200EE', 600: '#3700B3', }, - domain: 'https://blog.dzeio.com', + domain: 'https://www.avior.me', // domain: 'http://localhost:5000', og: { description: 'Markblog - Simple Markdown blog CMS', diff --git a/public/uploads/dzeio.png b/images/uploads/dzeio.png similarity index 100% rename from public/uploads/dzeio.png rename to images/uploads/dzeio.png diff --git a/public/uploads/stm.png b/images/uploads/stm.png similarity index 100% rename from public/uploads/stm.png rename to images/uploads/stm.png diff --git a/next.config.js b/next.config.js index a84e21b..ee5d4e5 100644 --- a/next.config.js +++ b/next.config.js @@ -1,10 +1,11 @@ const withCSS = require('@zeit/next-stylus') const glob = require('glob') const withOffline = require('next-offline') +const withOptimizedImages = require('next-optimized-images'); const matter = require('gray-matter') const fs = require('fs') -module.exports = withOffline(withCSS({ +module.exports = withOptimizedImages(withOffline(withCSS({ /* config options here */ exportTrailingSlash: true, webpack: function(config) { @@ -38,4 +39,4 @@ module.exports = withOffline(withCSS({ return paths } -})) +}))) diff --git a/package.json b/package.json index 129b8a1..775a520 100644 --- a/package.json +++ b/package.json @@ -1,37 +1,51 @@ { - "name": "@dzeio/markblog", - "version": "1.0.1", - "license": "MIT", - "scripts": { - "dev": "next dev", - "build": "next build", - "export": "next export && node export.js && yarn move_next", - "start": "next start", - "move_next": "mv out/_next out/assets", - "serve": "serve out", - "lint": "tslint -c tslint.json --project tsconfig.json" - }, - "dependencies": { - "@zeit/next-stylus": "^1.0.1", - "glob": "^7.1.6", - "gray-matter": "^4.0.2", - "next": "^9.1.7", - "next-offline": "^4.0.6", - "node-emoji": "^1.10.0", - "raw-loader": "^4.0.0", - "react": "^16.12.0", - "react-dom": "^16.12.0", - "react-feather": "^2.0.3", - "react-markdown": "^4.3.0", - "replace-in-file": "^5.0.2", - "serve": "^11.3.0", - "stylus": "^0.54.7", - "typescript": "^3.7.4", - "webpack": "^4.41.5" - }, - "devDependencies": { - "@types/node": "^13.1.4", - "@types/react": "^16.9.17", - "tslint": "^5.20.1" - } + "name": "@dzeio/markblog", + "version": "1.0.1", + "license": "MIT", + "scripts": { + "dev": "next dev", + "build": "next build", + "export": "next export && node export.js && yarn move_next", + "start": "next start", + "move_next": "mv out/_next out/assets", + "serve": "serve out", + "prod": "yarn build && yarn export && yarn serve", + "lint": "tslint -c tslint.json --project tsconfig.json" + }, + "dependencies": { + "@zeit/next-stylus": "^1.0.1", + "file-loader": "^5.0.2", + "glob": "^7.1.6", + "gray-matter": "^4.0.2", + "image-trace-loader": "^1.0.2", + "imagemin-cli": "^5.1.0", + "imagemin-mozjpeg": "^8.0.0", + "imagemin-optipng": "^7.1.0", + "imagemin-svgo": "^7.0.0", + "jimp": "^0.9.3", + "lqip-loader": "^2.2.0", + "next": "^9.1.7", + "next-offline": "^4.0.6", + "next-optimized-images": "^2.5.4", + "node-emoji": "^1.10.0", + "raw-loader": "^4.0.0", + "react": "^16.12.0", + "react-dom": "^16.12.0", + "react-feather": "^2.0.3", + "react-markdown": "^4.3.0", + "replace-in-file": "^5.0.2", + "responsive-loader": "^1.2.0", + "serve": "^11.3.0", + "stylus": "^0.54.7", + "svg-sprite-loader": "^4.1.6", + "typescript": "^3.7.4", + "webp-loader": "^0.6.0", + "webpack": "^4.41.5", + "webpack-cli": "^3.3.10" + }, + "devDependencies": { + "@types/node": "^13.1.4", + "@types/react": "^16.9.17", + "tslint": "^5.20.1" + } } diff --git a/pages/[category]/[slug].tsx b/pages/[category]/[slug].tsx index 7233c74..43b6ef9 100644 --- a/pages/[category]/[slug].tsx +++ b/pages/[category]/[slug].tsx @@ -42,6 +42,7 @@ export default class PostPage extends Component { /> + {`${this.props.post.header.title} - ${config.og.title}`} { {this.props.post.header.image ? ( ) : undefined} + {this.props.post === undefined ? ( ) : (
- {this.props.post.header.imageAlt} + + + + {this.props.post.header.imageAlt} + `${code}`)}/>

Détails

Tags:

@@ -73,6 +79,7 @@ export default class PostPage extends Component { ) : undefined}
)} +