Skip to content

Commit

Permalink
Highlight code
Browse files Browse the repository at this point in the history
  • Loading branch information
diegogriep committed Feb 24, 2021
1 parent ac74247 commit b095222
Show file tree
Hide file tree
Showing 10 changed files with 2,098 additions and 198 deletions.
Empty file added .nojekyll
Empty file.
4 changes: 3 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const isProd = process.env.NODE_ENV === 'production'

module.exports = withPWA({
// Use the CDN in production and localhost for development.
assetPrefix: isProd ? 'https://cdn.statically.io/gh/concretesolutions/tecla-sap/gh-pages/' : '',
assetPrefix: isProd
? 'https://cdn.statically.io/gh/concretesolutions/tecla-sap/gh-pages/'
: '',
pwa: {
dest: 'public'
}
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "tecla-sap",
"private": true,
"homepage": "https://concretesolutions.github.io/tecla-sap",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
Expand All @@ -11,17 +11,17 @@
"test": "jest",
"test:watch": "yarn test --watchAll",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
"deploy": "gh-pages -b main -d build"
},
"dependencies": {
"next": "10.0.5",
"next-pwa": "^3.1.5",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-highlight": "^0.13.0",
"styled-components": "^5.2.1"
},
"devDependencies": {
"gh-pages": "^3.1.0",
"@babel/core": "^7.12.3",
"@babel/preset-typescript": "^7.12.1",
"@testing-library/jest-dom": "^5.11.6",
Expand All @@ -39,6 +39,7 @@
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"gh-pages": "^3.1.0",
"husky": "^4.3.0",
"jest": "^26.6.3",
"jest-styled-components": "^7.0.3",
Expand Down
48 changes: 28 additions & 20 deletions pages/posts/17-dicas-otimizacao-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Link from 'next/link'
import Head from 'next/head'
import Image from 'next/image'
import styles from '../../styles/Home.module.css'
import Highlight from 'react-highlight'
import 'highlight.js/styles/a11y-dark.css'

export default function TipsJavascriptOptimization() {
return (
Expand All @@ -13,13 +15,17 @@ export default function TipsJavascriptOptimization() {
</header>
<div className={styles.container}>
<main className={styles.posts}>
<Image
src="/logo_high.png"
className={styles.logo}
alt="Logotipo do projeto"
width={400}
height={262}
/>
<Link href="/">
<a title="Página principal">
<Image
src="/logo_high.png"
className={styles.logo}
alt="Logotipo do projeto"
width={400}
height={262}
/>
</a>
</Link>

<p>
<Link href="/">
Expand All @@ -30,10 +36,16 @@ export default function TipsJavascriptOptimization() {
<h1 className={styles.post}>
17 dicas de otimização de Javascript para conhecer em 2021
</h1>
<p className={styles.author}>Autor: Blessing Hirwa || <a className={styles.link} href="https://dev.to/blessingartcreator/17-javascript-optimization-tips-3gil">
Versão original
</a></p>

<p className={styles.author}>
Autor: Blessing Hirwa ||{' '}
<a
className={styles.link}
href="https://dev.to/blessingartcreator/17-javascript-optimization-tips-3gil"
>
Versão original
</a>
</p>

<p>
Mesmo utilizando Javascript há bastante tempo, às vezes podemos
não estar atualizados quanto aos novos recursos que ele oferece, e
Expand All @@ -47,18 +59,14 @@ export default function TipsJavascriptOptimization() {
includes para fazer a verificação da condição:
</p>
<pre className={styles.pre}>
<code>
<Highlight language="javascript">
{`
//formato mais longo
<br />
if (x === 'abc' || x === 'def' || x === 'ghi' || x ==='jkl'){' '}
{<br />}
<br />
<br />
//formato mais curto
<br />
if (['abc', 'def', 'ghi', 'jkl'].includes(x)) {<br />}
<br />
</code>
if (['abc', 'def', 'ghi', 'jkl'].includes(x))
`}
</Highlight>
</pre>
</article>
</main>
Expand Down
108 changes: 107 additions & 1 deletion public/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/sw.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion public/workbox-c2b5e142.js

This file was deleted.

Loading

0 comments on commit b095222

Please sign in to comment.